Skip to content

Commit e2ec9fd

Browse files
authored
Merge branch 'dev' into t-naabus-refresh
2 parents 36eed6b + 41899b4 commit e2ec9fd

18 files changed

Lines changed: 4194 additions & 74 deletions

‎NOTICE.txt‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Microsoft.PowerBI.JavaScript
2+
3+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
4+
Do Not Translate or Localize
5+
6+
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
7+
8+
1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)
9+
10+
Copyright (c) 2004-2013, Alex Gorbatchev
11+
12+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎demo/LICENSE.txt‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Microsoft.PowerBI.JavaScript
2+
3+
Copyright (c) Microsoft Corporation
4+
5+
All rights reserved.
6+
7+
MIT License
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎demo/NOTICE.txt‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Microsoft.PowerBI.JavaScript
2+
3+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
4+
Do Not Translate or Localize
5+
6+
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
7+
8+
1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)
9+
10+
Copyright (c) 2004-2013, Alex Gorbatchev
11+
12+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎demo/code-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 App Token</h5>
18+
Once you have improted a report into Power BI workspace, you are ready to embed it.
19+
20+
To embed a report, you need to get an embed App 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 App 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/code-demo/code_area.html‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<div class="editorTitle">Code</div>
33
<div class="textAreaControls">
44
<button id="btnRunCode" class="textAreaControl">
5-
<img src="images\run.png"/> Run
5+
<img src="images\run.png" /> Run
66
</button>
77
<button id="btnCopyCode" class="textAreaControl" onclick="CopyCode();">
8-
<img src="images\copy.png"/> Copy
8+
<img src="images\copy.png" /> Copy
99
</button>
1010
</div>
11-
<textarea id="txtCode" readonly />
11+
12+
<div id="highlighter">
13+
</div>

‎demo/code-demo/docs.html‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +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+
114
<div>
215
<div class="title">
316
1. Learn how to Embed and Interact with Power BI Reports.
417
</div>
518
<iframe class="video" src="https://www.youtube.com/embed/nfkVljh_9O4" frameborder="0" allowfullscreen></iframe>
6-
</div>
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/code-demo/index.html‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

88
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" />
9+
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/theme.css">
910
<link rel="stylesheet" type="text/css" href="style/style.css">
1011
<link rel="stylesheet" type="text/css" href="style/layout.css">
12+
<link rel="stylesheet" type="text/css" href="style/syntaxHighlighterOverride.css">
13+
1114
</head>
1215

1316
<body>
@@ -22,6 +25,9 @@
2225
<li id="top-sample" class="top-li-active" onclick="OpenSampleSection();">
2326
<div><a href="#">Sample</a></div>
2427
</li>
28+
<li id="top-anyReport" class="top-li-active" onclick="OpenAnyReportSection();">
29+
<div><a href="#">Any Report</a></div>
30+
</li>
2531
<li id="top-docs" onclick="OpenDocumentationSection();">
2632
<div><a href="#">Documentation</a></div>
2733
</li>
@@ -33,21 +39,19 @@
3339

3440
<div id="contentWrapper">
3541
<div id ="sampleContent" class="content">
36-
3742
</div>
38-
<div id ="documentationContent" class="content">
3943

44+
<div id ="documentationContent" class="content">
4045
</div>
41-
</div>
4246

43-
<div id="oldSample">
44-
<a href="../static.html">Old Sample</a>
47+
<div id ="anyReportContent" class="content">
48+
</div>
4549
</div>
4650

4751
<script src="../node_modules/jquery/dist/jquery.js"></script>
4852
<script src="../node_modules/es6-promise/dist/es6-promise.js"></script>
4953
<script src="../node_modules/powerbi-client/dist/powerbi.js"></script>
50-
54+
5155
<script src="scripts/codesamples.js"></script>
5256

5357
<script src="scripts/index.js"></script>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ function _Embed_BasicEmbed() {
5757

5858
report.off("error");
5959
});
60+
61+
report.off("saved");
62+
report.on("saved", function(event) {
63+
Log.log(event.detail);
64+
if(event.detail.saveAs) {
65+
Log.logText('In order to interact with the new report, create a new token and load the new report');
66+
}
67+
});
6068
}
6169

6270
function _Mock_Embed_BasicEmbed(isEdit) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ function IsNotSupported(func) {
4949
return false;
5050
}
5151

52-
return mockDict[func.name] ? true : false;
52+
var runFunc = mockDict[func.name];
53+
return (runFunc && runFunc === datasetNotSupported) ? true : false;
5354
}
5455

5556
function IsMock(func) {

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
var sampleContentLoaded = false;
22
var documentationContentLoaded = false;
3-
3+
var anyReportSectionLoaded = false;
44

55
$(function() {
66
OpenSampleSection();
77
});
88

99
function OpenSampleSection() {
10+
OpenEmbedWorkspace("#top-sample", "step_authorize.html");
11+
}
12+
13+
function OpenAnyReportSection() {
14+
OpenEmbedWorkspace("#top-anyReport", "anyReport.html");
15+
}
16+
17+
function OpenEmbedWorkspace(activeTabSelector, authStepHtml)
18+
{
19+
// Any report, uses the same settings as sample report. ony changes the auth step.
1020
if (!sampleContentLoaded)
1121
{
1222
// Open Report Sample.
@@ -16,10 +26,12 @@ function OpenSampleSection() {
1626
});
1727
}
1828

19-
SetActiveStyle("#top-sample");
29+
$("#authorize-step-wrapper").load(authStepHtml);
30+
SetActiveStyle(activeTabSelector);
2031

2132
$(".content").hide();
2233
$("#sampleContent").show();
34+
OpenAuthStep();
2335
}
2436

2537
function OpenDocumentationSection() {

0 commit comments

Comments
 (0)