Skip to content

Commit b3fc219

Browse files
committed
Merged PR 18976: Merge dev to master
Edit & Save final. bug fixes.
1 parent 933bdcd commit b3fc219

Some content is hidden

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

60 files changed

+6807
-666
lines changed

NOTICE.txt

+16
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

+13
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

+16
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/app/dataselection.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(function () {
33

44
console.log('Scenario 7: Data Selection');
55

6-
var reportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
6+
var reportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
77
var $reportContainer = $('#reportContainer');
88
var report;
99
var $dataSelectedContainer = $("#dataSelectedContainer");
@@ -29,11 +29,11 @@ $(function () {
2929
});
3030

3131
function initializeDataSelection(report, $dataSelectedContainer) {
32-
report.on('dataSelected', event => {
32+
report.on('dataSelected', function (event) {
3333
console.log('dataSelected: ', event);
3434

3535
var data = event.detail;
3636

3737
$dataSelectedContainer.text(JSON.stringify(data, null, ' '));
3838
});
39-
}
39+
}

demo/app/defaults.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(function () {
33

44
console.log('Scenario 5: Default Page and/or Filter');
55

6-
var staticReportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
6+
var staticReportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
77
var $defaultPageReportContainer = $('#reportdefaults');
88
var defaultPageReport;
99
var defaultPageName = 'ReportSection2';
@@ -21,6 +21,8 @@ $(function () {
2121
}
2222
]);
2323

24+
var defaultFilters = [defaultFilter];
25+
2426
// Init
2527
fetch(staticReportUrl)
2628
.then(function (response) {
@@ -29,7 +31,7 @@ $(function () {
2931
.then(function (embedConfig) {
3032
var defaultsEmbedConfig = $.extend({}, embedConfig, {
3133
pageName: defaultPageName,
32-
filter: defaultFilter.toJSON(),
34+
filter: defaultFilters,
3335
settings: {
3436
filterPaneEnabled: true,
3537
navContentPaneEnabled: true
@@ -47,4 +49,4 @@ $(function () {
4749
});
4850
}
4951
});
50-
});
52+
});

demo/app/dynamic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $(function () {
44
console.log('Scenario 2: Dynamic Embed');
55

66
// Declare Variables
7-
var allReportsUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports';
7+
var allReportsUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports';
88
var $reportsList = $('#reportslist');
99
var $resetButton = $('#resetButton');
1010
var $dynamicReportContainer = $('#reportdynamic');

demo/app/filters.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(function () {
33

44
console.log('Scenario 4: Custom Filter Pane');
55

6-
var reportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
6+
var reportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
77
var $customFilterPaneContainer = $('#reportcustomfilter');
88
var customFilterPaneReport;
99
var customFilterPaneReportPages;

demo/app/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ $(function () {
22
var models = window['powerbi-client'].models;
33

44
// Scenario 1: Static Embed
5-
var staticReportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
5+
var staticReportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
66
var $staticReportContainer = $('#reportstatic');
77
var staticReport;
88

demo/app/pagenavigation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $(function () {
44
console.log('Scenario 3: Custom Page Navigation');
55

66
// Declare Variables
7-
var staticReportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
7+
var staticReportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
88
var $customPageNavContainer = $('#reportcustompagenav');
99
var customPageNavReport;
1010
var $reportPagesList = $('#reportpagesbuttons');

demo/app/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(function () {
33

44
console.log('Scenario 6: Update settings');
55

6-
var reportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
6+
var reportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
77
var $updateSettingsReport = $('#updatesettingsreport');
88
var updateSettingsReport;
99
var updateSettingsReportFilterPaneEnabled = false;

demo/code-demo/anyReport.html

+52
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

+5-3
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

+26
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/code-demo/index.html

+27-23
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

8-
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css" />
8+
<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>
@@ -16,45 +19,46 @@
1619
<div class="logo-text">
1720
<div class="logo-text-span">Microsoft Power BI – Report Embed Sample</div>
1821
</div>
19-
<div id="steps-nav-bar">
20-
<div id="steps-ul-dev">
21-
<ul id="steps-ul" class="steps-ul">
22-
<li id="steps-auth" class="steps-li-active" onclick="OpenAuthStep();">
23-
<div><a href="#">Authorize</a></div>
24-
<div class="step-div">
25-
</div>
22+
<div id="top-nav-bar">
23+
<div id="top-ul-dev">
24+
<ul id="top-ul" class="top-ul">
25+
<li id="top-sample" class="top-li-active" onclick="OpenSampleSection();">
26+
<div><a href="#">Sample</a></div>
2627
</li>
27-
<li id="steps-embed" onclick="OpenEmbedStep();">
28-
<div><a href="#">Embed</a></div>
29-
<div class="step-div"></div>
28+
<li id="top-anyReport" class="top-li-active" onclick="OpenAnyReportSection();">
29+
<div><a href="#">Any Report</a></div>
3030
</li>
31-
<li id="steps-interact" onclick="OpenInteractStep();">
32-
<div><a href="#">Interact</a></div>
33-
<div class="step-div"></div>
31+
<li id="top-docs" onclick="OpenDocumentationSection();">
32+
<div><a href="#">Documentation</a></div>
3433
</li>
3534
</ul>
3635
</div>
3736
</div>
3837
</div>
3938
</header>
4039

41-
<div id="mainContent">
42-
</div>
40+
<div id="contentWrapper">
41+
<div id ="sampleContent" class="content">
42+
</div>
43+
44+
<div id ="documentationContent" class="content">
45+
</div>
4346

44-
<div id="oldSample">
45-
<a href="/static.html">Old Sample</a>
47+
<div id ="anyReportContent" class="content">
48+
</div>
4649
</div>
4750

48-
<script src="/node_modules/jquery/dist/jquery.js"></script>
49-
<script src="/node_modules/es6-promise/dist/es6-promise.js"></script>
50-
<script src="/node_modules/powerbi-client/dist/powerbi.js"></script>
51-
51+
<script src="../node_modules/jquery/dist/jquery.js"></script>
52+
<script src="../node_modules/es6-promise/dist/es6-promise.js"></script>
53+
<script src="../node_modules/powerbi-client/dist/powerbi.js"></script>
54+
5255
<script src="scripts/codesamples.js"></script>
5356

5457
<script src="scripts/index.js"></script>
5558
<script src="scripts/utils.js"></script>
5659
<script src="scripts/logger.js"></script>
5760
<script src="scripts/session_utils.js"></script>
61+
<script src="scripts/function_mapping.js"></script>
5862

5963
<script src="scripts/report.js"></script>
6064

demo/code-demo/report.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
$("#authorize-step-wrapper").load("step_authorize.html");
2424

2525
LoadLogWindow("#logWindow");
26+
27+
var modeUrlParam = GetParameterByName("mode");
28+
var mode = modeUrlParam ? modeUrlParam : "view";
2629

2730
if (GetParameterByName("embedUrl") || GetParameterByName("embedId") || GetParameterByName("accessToken"))
2831
{
29-
OpenEmbedStep();
32+
OpenEmbedStep(mode);
3033
}
3134
else
3235
{

demo/code-demo/sample.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<div id="steps-nav-bar">
2+
<div id="steps-ul-dev">
3+
<ul id="steps-ul" class="steps-ul">
4+
<li id="steps-auth" class="steps-li-active" onclick="OpenAuthStep();">
5+
<div class="stepsButton">
6+
<a href="#">1. Authorize</a>
7+
</div>
8+
</li>
9+
<li id="steps-embed" onclick="OpenEmbedStep('view');">
10+
<div class="stepsButton">
11+
<a href="#">2. Embed</a>
12+
</div>
13+
</li>
14+
<li id="steps-interact" onclick="OpenInteractStep();">
15+
<div class="stepsButton">
16+
<a href="#">3. Interact</a>
17+
</div>
18+
</li>
19+
</ul>
20+
</div>
21+
</div>
22+
23+
<div id="mainContent">
24+
</div>

0 commit comments

Comments
 (0)