-
Notifications
You must be signed in to change notification settings - Fork 475
Merge Dev Into Master #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
dade325
Live Demo with visible code.
ali-hamud 23b13fd
spaces instead of tabs.
ali-hamud dc1b715
Add pageView to loadDashboardConfiguration
noanu e72fcc1
fix comments from review - adding null checks.
ali-hamud 744c0b7
Merge pull request #93 from Microsoft/alihamud-live-code
ali-hamud 57208e5
Merge pull request #95 from Microsoft/add_pageview_to_dashboard_embed…
noanu 944aaf1
Add Link to old sample.
ali-hamud 031d6ec
spaces.
ali-hamud 4225d30
Merge pull request #97 from Microsoft/alihamud-live-code
ali-hamud fc3ae10
enable getting embedUrl, embedId and accessToken from url params.
ali-hamud a337a44
replace tabs with spaces
ali-hamud e15763f
Merge pull request #99 from Microsoft/alihamud-live-code
ali-hamud 0b674d7
Fix dependecy module to only work with npm (#103)
breueran f343434
build things
t-naabus 873345d
Add bower install support
breueran f413e6e
text fixed
t-naabus 441e0d3
text fixed
t-naabus 307cc61
Merge branch 't-naabus/textfixing' of https://github.com/Microsoft/Po…
t-naabus d11c2b7
fix sample referencing
breueran 25605e5
fix demo references
breueran 8b9dc5b
text fixed
t-naabus 32968df
text fixed
t-naabus 64bab62
Merge branch 'dev' of https://github.com/Microsoft/PowerBI-JavaScript…
t-naabus 75bbc70
merge
t-naabus 605eb19
merge
t-naabus b4b0087
Textfix fix
t-naabus cc78003
Merge pull request #106 from Microsoft/t-naabus/textfixing
t-naabus 095d342
increment version and update dist folder
ali-hamud ee91c23
Merge pull request #107 from Microsoft/merge_dev_into_master
ali-hamud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,4 +23,4 @@ | |
| "powerbi-client": "^2.2.1" | ||
| }, | ||
| "devDependencies": {} | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <!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" type="text/css" href="style/style.css"> | ||
| </head> | ||
|
|
||
| <body> | ||
| <header class="ms-font-xxl"> | ||
| <div class="logo-text"> | ||
| <span class="logo-text-span">Microsoft Power BI JavaScript SDK - Live Sample</span> | ||
| </div> | ||
| <div id="oldSample"> | ||
| <a href="/static.html">Old Sample</a> | ||
| </div> | ||
| </header> | ||
|
|
||
| <div id="mainContent" class="jumbotron"> | ||
| </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/fetch/lib/fetch.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/session_utils.js"></script> | ||
|
|
||
|
|
||
| <script src="scripts/report.js"></script> | ||
|
|
||
| <script src="scripts/step_authorize.js"></script> | ||
| <script src="scripts/step_embed.js"></script> | ||
| <script src="scripts/step_interact.js"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <!DOCTYPE html> | ||
| <div> | ||
| <div id="steps-nav-bar"> | ||
| <div class="main-title">Report Embed</div> | ||
| <div id="steps-ul-dev"> | ||
| <ul id="steps-ul" class="steps-ul"> | ||
| <li id="steps-auth" class="steps-li-active" onclick="OpenAuthStep();"><a href="#">Authorize</a></li> | ||
| <li id="steps-embed" onclick="OpenEmbedStep();"><a href="#">Embed</a></li> | ||
| <li id="steps-interact" onclick="OpenInteractStep();"><a href="#">Interact</a></li> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div id="embed-and-interact-panel"> | ||
| <div id="right-pane" class="halfWidth left"> | ||
| </div> | ||
|
|
||
| <div id="left-pane" class="halfWidth right"> | ||
| <div id="embedArea"> | ||
| <h3>Embedded Report Area</h3> | ||
| <h5>The following div id is <b>reportContainer</b>. In code, we embed a report to it.</h5> | ||
| <div id="reportContainer" style="width: 800px; height: 600px; background: #DDDDDD;"></div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script> | ||
| var embedUrl = GetParameterByName("embedUrl"); | ||
| if (!embedUrl) | ||
| { | ||
| // Open Authorization Step after this page loads. | ||
| OpenAuthStep(); | ||
| } | ||
| else | ||
| { | ||
| OpenEmbedStep(); | ||
| } | ||
|
|
||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,273 @@ | ||
| /* | ||
| This file contains the code samples which will appear live in the web-page. | ||
| Each sample method name starts with _Report_ or _Page or _Embed depends on which section it appears. | ||
| Please keep this. | ||
| */ | ||
|
|
||
| // ---- Embed Code ---------------------------------------------------- | ||
|
|
||
| function _Embed_BasicEmbed() { | ||
| var txtAccessToken = $('#txtAccessToken').val(); | ||
| var txtEmbedUrl = $('#txtReportEmbed').val(); | ||
| var txtEmbedReportId = $('#txtEmbedReportId').val(); | ||
|
|
||
| var embedConfiguration = { | ||
| type: 'report', | ||
| accessToken: txtAccessToken, | ||
| embedUrl: txtEmbedUrl, | ||
| id: txtEmbedReportId, | ||
| settings: { | ||
| filterPaneEnabled: true, | ||
| navContentPaneEnabled: true | ||
| } | ||
| }; | ||
|
|
||
| var reportContainer = document.getElementById('reportContainer'); | ||
| powerbi.embed(reportContainer, embedConfiguration); | ||
| } | ||
|
|
||
| function _Embed_EmbedWithDefaultFilter() { | ||
| var txtAccessToken = $('#txtAccessToken').val(); | ||
| var txtEmbedUrl = $('#txtReportEmbed').val(); | ||
| var txtEmbedReportId = $('#txtEmbedReportId').val(); | ||
|
|
||
| const filter = { | ||
| $schema: "http://powerbi.com/product/schema#basic", | ||
| target: { | ||
| table: "Store", | ||
| column: "Chain" | ||
| }, | ||
| operator: "In", | ||
| values: ["Lindseys"] | ||
| }; | ||
|
|
||
| var embedConfiguration = { | ||
| type: 'report', | ||
| accessToken: txtAccessToken, | ||
| embedUrl: txtEmbedUrl, | ||
| id: txtEmbedReportId, | ||
| settings: { | ||
| filterPaneEnabled: false, | ||
| navContentPaneEnabled: false | ||
| }, | ||
| filters: [filter] | ||
| }; | ||
|
|
||
| var reportContainer = document.getElementById('reportContainer'); | ||
| powerbi.embed(reportContainer, embedConfiguration); | ||
| } | ||
|
|
||
| // ---- Report Operations ---------------------------------------------------- | ||
|
|
||
| function _Report_GetId() { | ||
| report = powerbi.embeds[0]; | ||
| $('#result').html(report.getId()); | ||
| } | ||
|
|
||
| function _Report_UpdateSettings() { | ||
| const newSettings = { | ||
| navContentPaneEnabled: true, | ||
| filterPaneEnabled: false | ||
| }; | ||
|
|
||
| report = powerbi.embeds[0]; | ||
| report.updateSettings(newSettings) | ||
| .then(function (result) { | ||
| $("#result").html(result); | ||
| }) | ||
| .catch(function (error) { | ||
| $("#result").html(error); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_GetPages() { | ||
| report = powerbi.embeds[0]; | ||
|
|
||
| report.getPages() | ||
| .then(function (pages) { | ||
| var result = ""; | ||
| var index = 1; | ||
| pages.forEach(function(page) { | ||
| result = result + index + ") " + page.name + "(displayName: " + page.displayName + ")" + "<br/>"; | ||
| index++; | ||
| }); | ||
|
|
||
| $("#result").html("Done. <br/>" + result); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_SetPage() { | ||
| report = powerbi.embeds[0]; | ||
| report.setPage("ReportSection2") | ||
| .then(function (result) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(result)); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_GetFilters() { | ||
| report = powerbi.embeds[0]; | ||
|
|
||
| report.getFilters() | ||
| .then(function (filters) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(filters, null, " ")); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_SetFilters() { | ||
| const filter = { | ||
| $schema: "http://powerbi.com/product/schema#basic", | ||
| target: { | ||
| table: "Store", | ||
| column: "Chain" | ||
| }, | ||
| operator: "In", | ||
| values: ["Lindseys"] | ||
| }; | ||
|
|
||
| report = powerbi.embeds[0]; | ||
| report.setFilters([filter]) | ||
| .then(function (result) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(result)); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_RemoveFilters() { | ||
| report = powerbi.embeds[0]; | ||
| report.removeFilters() | ||
| .then(function (result) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(result)); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_PrintCurrentReport() { | ||
| report = powerbi.embeds[0]; | ||
| report.print() | ||
| .then(function (result) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(result)); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_Reload() { | ||
| report = powerbi.embeds[0]; | ||
| report.reload() | ||
| .then(function (result) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(result)); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Report_FullScreen() { | ||
| report = powerbi.embeds[0]; | ||
| report.fullscreen(); | ||
|
|
||
| $("#result").html("Done!"); | ||
| } | ||
|
|
||
| function _Report_ExitFullScreen() { | ||
| report = powerbi.embeds[0]; | ||
| report.exitFullscreen(); | ||
|
|
||
| $("#result").html("Done!"); | ||
| } | ||
|
|
||
| // ---- Page Operations ---------------------------------------------------- | ||
|
|
||
| function _Page_SetActive() { | ||
| report = powerbi.embeds[0]; | ||
|
|
||
| // Set the second page active | ||
| report.getPages() | ||
| .then(function (pages) { | ||
| pages[1].setActive().then(function (result) { | ||
| $("#result").html("Done. <br/>" + result) | ||
| }); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("getPages Error. " + errors); | ||
| }); | ||
| } | ||
|
|
||
| function _Page_GetFilters() { | ||
| report = powerbi.embeds[0]; | ||
|
|
||
| // Get Filters of first page | ||
| report.getPages() | ||
| .then(function (pages) { | ||
| pages[1].getFilters() | ||
| .then(function (filters) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(filters, null, " ")) | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("getPages Error. " + errors); | ||
| }); | ||
| } | ||
|
|
||
| function _Page_SetFilters() { | ||
| const filter = { | ||
| $schema: "http://powerbi.com/product/schema#basic", | ||
| target: { | ||
| table: "Store", | ||
| column: "Chain" | ||
| }, | ||
| operator: "In", | ||
| values: ["Lindseys"] | ||
| }; | ||
|
|
||
| report = powerbi.embeds[0]; | ||
| report.getPages() | ||
| .then(function (pages) { | ||
| pages[1].setFilters([filter]) | ||
| .then(function (result) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(result)); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| } | ||
|
|
||
| function _Page_RemoveFilters() { | ||
| report = powerbi.embeds[0]; | ||
|
|
||
| // Get Filters of first page | ||
| report.getPages() | ||
| .then(function (pages) { | ||
| pages[1].removeFilters() | ||
| .then(function (result) { | ||
| $("#result").html("Done. <br/>" + JSON.stringify(result)); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("Error. <br/>" + JSON.stringify(errors)); | ||
| }); | ||
| }) | ||
| .catch(function (errors) { | ||
| $("#result").html("getPages Error. " + errors); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| $(function() { | ||
| // Open Report Sample. | ||
| $("#mainContent").load("report.html"); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this change?