Skip to content

Commit

Permalink
Merged PR 18976: Merge dev to master
Browse files Browse the repository at this point in the history
Edit & Save final.
bug fixes.
  • Loading branch information
ali-hamud committed Mar 19, 2017
1 parent 933bdcd commit b3fc219
Show file tree
Hide file tree
Showing 60 changed files with 6,807 additions and 666 deletions.
16 changes: 16 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Microsoft.PowerBI.JavaScript

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize

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.

1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)

Copyright (c) 2004-2013, Alex Gorbatchev

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
13 changes: 13 additions & 0 deletions demo/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Microsoft.PowerBI.JavaScript

Copyright (c) Microsoft Corporation

All rights reserved.

MIT License

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
16 changes: 16 additions & 0 deletions demo/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Microsoft.PowerBI.JavaScript

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize

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.

1. SyntaxHighlighter (https://github.com/syntaxhighlighter/syntaxhighlighter)

Copyright (c) 2004-2013, Alex Gorbatchev

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
6 changes: 3 additions & 3 deletions demo/app/dataselection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(function () {

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

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

function initializeDataSelection(report, $dataSelectedContainer) {
report.on('dataSelected', event => {
report.on('dataSelected', function (event) {
console.log('dataSelected: ', event);

var data = event.detail;

$dataSelectedContainer.text(JSON.stringify(data, null, ' '));
});
}
}
8 changes: 5 additions & 3 deletions demo/app/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(function () {

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

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

var defaultFilters = [defaultFilter];

// Init
fetch(staticReportUrl)
.then(function (response) {
Expand All @@ -29,7 +31,7 @@ $(function () {
.then(function (embedConfig) {
var defaultsEmbedConfig = $.extend({}, embedConfig, {
pageName: defaultPageName,
filter: defaultFilter.toJSON(),
filter: defaultFilters,
settings: {
filterPaneEnabled: true,
navContentPaneEnabled: true
Expand All @@ -47,4 +49,4 @@ $(function () {
});
}
});
});
});
2 changes: 1 addition & 1 deletion demo/app/dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $(function () {
console.log('Scenario 2: Dynamic Embed');

// Declare Variables
var allReportsUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports';
var allReportsUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports';
var $reportsList = $('#reportslist');
var $resetButton = $('#resetButton');
var $dynamicReportContainer = $('#reportdynamic');
Expand Down
2 changes: 1 addition & 1 deletion demo/app/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(function () {

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

var reportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
var reportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
var $customFilterPaneContainer = $('#reportcustomfilter');
var customFilterPaneReport;
var customFilterPaneReportPages;
Expand Down
2 changes: 1 addition & 1 deletion demo/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $(function () {
var models = window['powerbi-client'].models;

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

Expand Down
2 changes: 1 addition & 1 deletion demo/app/pagenavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $(function () {
console.log('Scenario 3: Custom Page Navigation');

// Declare Variables
var staticReportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
var staticReportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
var $customPageNavContainer = $('#reportcustompagenav');
var customPageNavReport;
var $reportPagesList = $('#reportpagesbuttons');
Expand Down
2 changes: 1 addition & 1 deletion demo/app/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(function () {

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

var reportUrl = 'https://powerbiembedapi.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
var reportUrl = 'https://powerbi-embed-api.azurewebsites.net/api/reports/c52af8ab-0468-4165-92af-dc39858d66ad';
var $updateSettingsReport = $('#updatesettingsreport');
var updateSettingsReport;
var updateSettingsReportFilterPaneEnabled = false;
Expand Down
52 changes: 52 additions & 0 deletions demo/code-demo/anyReport.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<div id="userReport" class="line">
<div class="pageTitle">
<h3>Embed your own report</h3>
<h8>You can also embed your own report by following the instructions below.</h8>
</div>
<div class="settings">
<div id="EmbedWithSpecificReportDiv">
<div class="line">
<h5>Prerequisites</h5>
<ul>
<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>
<li>Power BI report imported to your workspace.</li>
</ul>
</div>

<div class="line">
<h5>Instructions to generate an embed App Token</h5>
Once you have improted a report into Power BI workspace, you are ready to embed it.

To embed a report, you need to get an embed App Token. You can create this token in multiple ways.
<ul>
<li>Using <a href="https://github.com/Microsoft/PowerBI-cli">PowerBI-Cli</a> tool.</li>
<li>From .Net Code using <a href="http://www.nuget.org/packages/Microsoft.PowerBI.Core/">Microsoft.PowerBI.Core</a> package.</li>
<li>From NodeJS code using <a href="https://github.com/Microsoft/PowerBI-Node">powerbi-api</a> package.</li>
</ul>
</div>

<div id="authorizeParameterDiv" class="line">
<h5>Enter embed details</h5>

<table id="user-embed-details">
<tr>
<td class="td-field-name">Embed App Token</td>
<td><input type="text" id="auth_txtAccessToken" onchange="UpdateSession(this, SessionKeys.AccessToken);" /></td>
</tr>
<tr>
<td class="td-field-name">Embed URL</td>
<td>
<input type="text" id="auth_txtReportEmbed" onchange="UpdateSession(this, SessionKeys.EmbedUrl);" />
</td>
</tr>
<tr>
<td class="td-field-name">Report Id</td>
<td><input type="text" id="auth_txtEmbedReportId" onchange="UpdateSession(this, SessionKeys.EmbedId);"/></td>
</tr>
</table>
<button id="nextStep" class="blueButton" onclick="OpenEmbedStepFromUserSettings()">Next step - Embed</button>
</div>

</div>
</div>
</div>
8 changes: 5 additions & 3 deletions demo/code-demo/code_area.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<div class="editorTitle">Code</div>
<div class="textAreaControls">
<button id="btnRunCode" class="textAreaControl">
<img src="images\run.png"/> Run
<img src="images\run.png" /> Run
</button>
<button id="btnCopyCode" class="textAreaControl" onclick="CopyCode();">
<img src="images\copy.png"/> Copy
<img src="images\copy.png" /> Copy
</button>
</div>
<textarea id="txtCode" readonly />

<div id="highlighter">
</div>
26 changes: 26 additions & 0 deletions demo/code-demo/docs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div>
<div class="title">
<h2>Getting Started</h2>
</div>
<div>
Please visit our
<a href="https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-what-is-power-bi-embedded">documentation</a>
to start using Power BI Embedded.
</div>
</div>

<h2>Videos</h2>

<div>
<div class="title">
1. Learn how to Embed and Interact with Power BI Reports.
</div>
<iframe class="video" src="https://www.youtube.com/embed/nfkVljh_9O4" frameborder="0" allowfullscreen></iframe>
</div>

<div>
<div class="title">
2. Learn how to Create, Edit and Save Power BI reports in Embedded view.
</div>
<iframe class="video" src="https://www.youtube.com/embed/ibuN4DzCl5c?showinfo=0" frameborder="0" allowfullscreen></iframe>
</div>
50 changes: 27 additions & 23 deletions demo/code-demo/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" />
<link type="text/css" rel="stylesheet" href="syntaxHighlighter/theme.css">
<link rel="stylesheet" type="text/css" href="style/style.css">
<link rel="stylesheet" type="text/css" href="style/layout.css">
<link rel="stylesheet" type="text/css" href="style/syntaxHighlighterOverride.css">

</head>

<body>
Expand All @@ -16,45 +19,46 @@
<div class="logo-text">
<div class="logo-text-span">Microsoft Power BI – Report Embed Sample</div>
</div>
<div id="steps-nav-bar">
<div id="steps-ul-dev">
<ul id="steps-ul" class="steps-ul">
<li id="steps-auth" class="steps-li-active" onclick="OpenAuthStep();">
<div><a href="#">Authorize</a></div>
<div class="step-div">
</div>
<div id="top-nav-bar">
<div id="top-ul-dev">
<ul id="top-ul" class="top-ul">
<li id="top-sample" class="top-li-active" onclick="OpenSampleSection();">
<div><a href="#">Sample</a></div>
</li>
<li id="steps-embed" onclick="OpenEmbedStep();">
<div><a href="#">Embed</a></div>
<div class="step-div"></div>
<li id="top-anyReport" class="top-li-active" onclick="OpenAnyReportSection();">
<div><a href="#">Any Report</a></div>
</li>
<li id="steps-interact" onclick="OpenInteractStep();">
<div><a href="#">Interact</a></div>
<div class="step-div"></div>
<li id="top-docs" onclick="OpenDocumentationSection();">
<div><a href="#">Documentation</a></div>
</li>
</ul>
</div>
</div>
</div>
</header>

<div id="mainContent">
</div>
<div id="contentWrapper">
<div id ="sampleContent" class="content">
</div>

<div id ="documentationContent" class="content">
</div>

<div id="oldSample">
<a href="/static.html">Old Sample</a>
<div id ="anyReportContent" class="content">
</div>
</div>

<script src="/node_modules/jquery/dist/jquery.js"></script>
<script src="/node_modules/es6-promise/dist/es6-promise.js"></script>
<script src="/node_modules/powerbi-client/dist/powerbi.js"></script>
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/es6-promise/dist/es6-promise.js"></script>
<script src="../node_modules/powerbi-client/dist/powerbi.js"></script>

<script src="scripts/codesamples.js"></script>

<script src="scripts/index.js"></script>
<script src="scripts/utils.js"></script>
<script src="scripts/logger.js"></script>
<script src="scripts/session_utils.js"></script>
<script src="scripts/function_mapping.js"></script>

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

Expand Down
5 changes: 4 additions & 1 deletion demo/code-demo/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@
$("#authorize-step-wrapper").load("step_authorize.html");

LoadLogWindow("#logWindow");

var modeUrlParam = GetParameterByName("mode");
var mode = modeUrlParam ? modeUrlParam : "view";

if (GetParameterByName("embedUrl") || GetParameterByName("embedId") || GetParameterByName("accessToken"))
{
OpenEmbedStep();
OpenEmbedStep(mode);
}
else
{
Expand Down
24 changes: 24 additions & 0 deletions demo/code-demo/sample.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div id="steps-nav-bar">
<div id="steps-ul-dev">
<ul id="steps-ul" class="steps-ul">
<li id="steps-auth" class="steps-li-active" onclick="OpenAuthStep();">
<div class="stepsButton">
<a href="#">1. Authorize</a>
</div>
</li>
<li id="steps-embed" onclick="OpenEmbedStep('view');">
<div class="stepsButton">
<a href="#">2. Embed</a>
</div>
</li>
<li id="steps-interact" onclick="OpenInteractStep();">
<div class="stepsButton">
<a href="#">3. Interact</a>
</div>
</li>
</ul>
</div>
</div>

<div id="mainContent">
</div>
Loading

0 comments on commit b3fc219

Please sign in to comment.