Skip to content

Commit b0b3bcf

Browse files
author
Omri Armstrong
committed
merge internal master
2 parents 284b9a4 + 69111a4 commit b0b3bcf

55 files changed

Lines changed: 7459 additions & 162 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ docs
55
typings/
66
tmp
77
.publish
8-
npm-debug.log*
8+
npm-debug.log*
9+
dist/*.js.map

‎demo/code-demo/anyReport.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ <h3>Embed your own report</h3>
66
<div class="settings">
77
<div id="EmbedWithSpecificReportDiv">
88
<div class="line">
9-
<h5>Prerequisites</h5>
9+
<h5>Prerequisites:</h5>
1010
<ul>
1111
<li>A workspace in the <a href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-get-started/">Power BI embedded service.</a></li>
1212
<li>Power BI report imported to your workspace.</li>
1313
</ul>
1414
</div>
1515

1616
<div class="line">
17-
<h5>Instructions to generate an embed App Token</h5>
18-
Once you have improted a report into Power BI workspace, you are ready to embed it.
17+
<h5>Instructions to generate an Embed Token</h5>
18+
Once you have imported a report into Power BI workspace, you are ready to embed it.
1919

20-
To embed a report, you need to get an embed App Token. You can create this token in multiple ways.
20+
To embed a report, you need to get an Embed Token. You can create this token in multiple ways.
2121
<ul>
2222
<li>Using <a href="https://github.com/Microsoft/PowerBI-cli">PowerBI-Cli</a> tool.</li>
2323
<li>From .Net Code using <a href="http://www.nuget.org/packages/Microsoft.PowerBI.Core/">Microsoft.PowerBI.Core</a> package.</li>
@@ -26,11 +26,11 @@ <h5>Instructions to generate an embed App Token</h5>
2626
</div>
2727

2828
<div id="authorizeParameterDiv" class="line">
29-
<h5>Enter embed details</h5>
29+
<h5>Enter embed details:</h5>
3030

3131
<table id="user-embed-details">
3232
<tr>
33-
<td class="td-field-name">Embed App Token</td>
33+
<td class="td-field-name">Embed Token</td>
3434
<td><input type="text" id="auth_txtAccessToken" onchange="UpdateSession(this, SessionKeys.AccessToken);" /></td>
3535
</tr>
3636
<tr>

‎demo/code-demo/scripts/codesamples.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,28 +496,28 @@ function _Report_Reload() {
496496
// Reload the displayed report
497497
report.reload()
498498
.then(function (result) {
499-
Log.log(result);
499+
Log.logText("Reloaded");
500500
})
501501
.catch(function (errors) {
502502
Log.log(errors);
503503
});
504504
}
505505

506506
function _Report_Refresh() {
507-
// Get a reference to the embedded report HTML element
508-
var reportContainer = $('#reportContainer')[0];
507+
// Get a reference to the embedded report HTML element
508+
var reportContainer = $('#reportContainer')[0];
509509

510-
// Get a reference to the embedded report.
510+
// Get a reference to the embedded report.
511511
report = powerbi.get(reportContainer);
512512

513513
// Refresh the displayed report
514514
report.refresh()
515515
.then(function (result) {
516-
Log.log(result);
516+
Log.logText("Refreshed");
517517
})
518518
.catch(function (errors) {
519519
Log.log(errors);
520-
});
520+
});
521521
}
522522

523523
function _Report_FullScreen() {

‎demo/code-demo/scripts/function_mapping.js‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ function datasetNotSupported() {
2424
Log.logText('Operation not supported for dataset')
2525
}
2626

27-
function IsSaveMock(func) {
28-
return ((func.name === '_Report_save' || func.name === '_Report_saveAs') && (
27+
function IsSaveMock(funcName) {
28+
return ((funcName === '_Report_save' || funcName === '_Report_saveAs') && (
2929
_session.embedId === 'c52af8ab-0468-4165-92af-dc39858d66ad' /*Sample Report*/ ||
3030
_session.embedId === '1ee0b264-b280-43f1-bbb7-9d8bd2d03a78' /*Sample dataset*/ ));
3131
}
3232

33-
function IsBasicMock(func) {
34-
return ((func.name === '_Embed_BasicEmbed' || func.name === '_Embed_BasicEmbed_EditMode') && _session.embedId === 'c52af8ab-0468-4165-92af-dc39858d66ad');
33+
function IsBasicMock(funcName) {
34+
return ((funcName === '_Embed_BasicEmbed' || funcName === '_Embed_BasicEmbed_EditMode') && _session.embedId === 'c52af8ab-0468-4165-92af-dc39858d66ad');
3535
}
3636

37-
function IsCreateMock(func) {
38-
return (func.name === '_Embed_Create' && _session.embedId === '1ee0b264-b280-43f1-bbb7-9d8bd2d03a78');
37+
function IsCreateMock(funcName) {
38+
return (funcName === '_Embed_Create' && _session.embedId === '1ee0b264-b280-43f1-bbb7-9d8bd2d03a78');
3939
}
4040

41-
function IsNotSupported(func) {
41+
function IsNotSupported(funcName) {
4242
if (powerbi.embeds.length === 0) {
4343
return false
4444
}
@@ -49,14 +49,27 @@ function IsNotSupported(func) {
4949
return false;
5050
}
5151

52-
var runFunc = mockDict[func.name];
52+
var runFunc = mockDict[funcName];
5353
return (runFunc && runFunc === datasetNotSupported) ? true : false;
5454
}
5555

56-
function IsMock(func) {
57-
return (IsBasicMock(func) || IsSaveMock(func) || IsCreateMock(func) || IsNotSupported(func));
56+
function IsMock(funcName) {
57+
return (IsBasicMock(funcName) || IsSaveMock(funcName) || IsCreateMock(funcName) || IsNotSupported(funcName));
5858
}
5959

6060
function mapFunc(func) {
61-
return IsMock(func) ? mockDict[func.name] : func;
61+
var funcName = getFuncName(func);
62+
return IsMock(funcName) ? mockDict[funcName] : func;
63+
}
64+
65+
function getFuncName(func) {
66+
var funcName = func.name;
67+
68+
if (!funcName)
69+
{
70+
// in IE, func.name is invalid method. so, function name should be extracted manually.
71+
funcName = func.toString().match(/^function\s*([^\s(]+)/)[1];
72+
}
73+
74+
return funcName;
6275
}

‎demo/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"es6-promise": "^3.2.2",
3535
"bootstrap": "^3.3.6",
3636
"jquery": "^3.1.0",
37-
"powerbi-client": "^2.3.0",
37+
"powerbi-client": "^2.3",
3838
"http-server": "^0.9.0",
3939
"syntaxhighlighter": "4.0.1"
4040
},

‎demo/v2-demo/anyReport.html‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<div id="userReport" class="line">
2+
<div class="pageTitle">
3+
<h3>Embed your own report</h3>
4+
<h8>You can also embed your own report by following the instructions below.</h8>
5+
</div>
6+
<div class="settings">
7+
<div id="EmbedWithSpecificReportDiv">
8+
<div class="line">
9+
<h5>Prerequisites:</h5>
10+
<ul>
11+
<li>A workspace in the <a href="https://azure.microsoft.com/en-us/documentation/articles/power-bi-embedded-get-started/">Power BI embedded service.</a></li>
12+
<li>Power BI report imported to your workspace.</li>
13+
</ul>
14+
</div>
15+
16+
<div class="line">
17+
<h5>Instructions to generate an Embed Token</h5>
18+
Once you have imported a report into Power BI workspace, you are ready to embed it.
19+
20+
To embed a report, you need to get an Embed Token. You can create this token in multiple ways.
21+
<ul>
22+
<li>Using <a href="https://github.com/Microsoft/PowerBI-cli">PowerBI-Cli</a> tool.</li>
23+
<li>From .Net Code using <a href="http://www.nuget.org/packages/Microsoft.PowerBI.Core/">Microsoft.PowerBI.Core</a> package.</li>
24+
<li>From NodeJS code using <a href="https://github.com/Microsoft/PowerBI-Node">powerbi-api</a> package.</li>
25+
</ul>
26+
</div>
27+
28+
<div id="authorizeParameterDiv" class="line">
29+
<h5>Enter embed details:</h5>
30+
31+
<table id="user-embed-details">
32+
<tr>
33+
<td class="td-field-name">Embed Token</td>
34+
<td><input type="text" id="auth_txtAccessToken" onchange="UpdateSession(this, SessionKeys.AccessToken);" /></td>
35+
</tr>
36+
<tr>
37+
<td class="td-field-name">Embed URL</td>
38+
<td>
39+
<input type="text" id="auth_txtReportEmbed" onchange="UpdateSession(this, SessionKeys.EmbedUrl);" />
40+
</td>
41+
</tr>
42+
<tr>
43+
<td class="td-field-name">Report Id</td>
44+
<td><input type="text" id="auth_txtEmbedReportId" onchange="UpdateSession(this, SessionKeys.EmbedId);"/></td>
45+
</tr>
46+
</table>
47+
<button id="nextStep" class="blueButton" onclick="OpenEmbedStepFromUserSettings()">Next step - Embed</button>
48+
</div>
49+
50+
</div>
51+
</div>
52+
</div>

‎demo/v2-demo/code_area.html‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<div class="editorTitle">Code</div>
3+
<div class="textAreaControls">
4+
<button id="btnRunCode" class="textAreaControl">
5+
<img src="images\run.png" /> Run
6+
</button>
7+
<button id="btnCopyCode" class="textAreaControl" onclick="CopyCode();">
8+
<img src="images\copy.png" /> Copy
9+
</button>
10+
</div>
11+
12+
<div id="highlighter">
13+
</div>

‎demo/v2-demo/docs.html‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<div>
2+
<div class="title">
3+
<h2>Getting Started</h2>
4+
</div>
5+
<div>
6+
Please visit our
7+
<a href="https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-what-is-power-bi-embedded">documentation</a>
8+
to start using Power BI Embedded.
9+
</div>
10+
</div>
11+
12+
<h2>Videos</h2>
13+
14+
<div>
15+
<div class="title">
16+
1. Learn how to Embed and Interact with Power BI Reports.
17+
</div>
18+
<iframe class="video" src="https://www.youtube.com/embed/nfkVljh_9O4" frameborder="0" allowfullscreen></iframe>
19+
</div>
20+
21+
<div>
22+
<div class="title">
23+
2. Learn how to Create, Edit and Save Power BI reports in Embedded view.
24+
</div>
25+
<iframe class="video" src="https://www.youtube.com/embed/ibuN4DzCl5c?showinfo=0" frameborder="0" allowfullscreen></iframe>
26+
</div>

‎demo/v2-demo/images/arrow.png‎

602 Bytes
Loading
665 Bytes
Loading

0 commit comments

Comments
 (0)