Skip to content

Commit

Permalink
Merge remote-tracking branch 'powerbi/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-hamud committed Mar 13, 2019
2 parents cbe8c2a + 143631c commit fa039b2
Show file tree
Hide file tree
Showing 10 changed files with 5,830 additions and 5,659 deletions.
56 changes: 56 additions & 0 deletions demo/v2-demo/scripts/codesamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ function _Embed_BasicEmbed() {
Log.logText("Loaded");
});

// Report.off removes a given event handler if it exists.
report.off("rendered");

// Report.on will add an event handler which prints to Log window.
report.on("rendered", function() {
Log.logText("Rendered");
});

report.on("error", function(event) {
Log.log(event.detail);

Expand Down Expand Up @@ -121,6 +129,14 @@ function _Embed_BasicEmbed_Mobile() {
Log.logText("Loaded");
});

// Report.off removes a given event handler if it exists.
report.off("rendered");

// Report.on will add an event handler which prints to Log window.
report.on("rendered", function() {
Log.logText("Rendered");
});

report.on("error", function(event) {
Log.log(event.detail);

Expand Down Expand Up @@ -186,6 +202,14 @@ function _Embed_VisualEmbed() {
Log.logText("Loaded");
});

// Report.off removes a given event handler if it exists.
report.off("rendered");

// Report.on will add an event handler which prints to Log window.
report.on("rendered", function() {
Log.logText("Rendered");
});

report.on("error", function(event) {
Log.log(event.detail);

Expand Down Expand Up @@ -356,6 +380,14 @@ function _Mock_Embed_BasicEmbed(isEdit) {
Log.logText("Loaded");
});

// Report.off removes a given event handler if it exists.
report.off("rendered");

// Report.on will add an event handler which prints to Log window.
report.on("rendered", function() {
Log.logText("Rendered");
});

report.off("saveAsTriggered");
report.on("saveAsTriggered", function() {
Log.logText("Cannot save sample report");
Expand Down Expand Up @@ -431,6 +463,14 @@ function _Embed_BasicEmbed_EditMode() {
Log.logText("Loaded");
});

// Report.off removes a given event handler if it exists.
report.off("rendered");

// Report.on will add an event handler which prints to Log window.
report.on("rendered", function() {
Log.logText("Rendered");
});

report.off("error");
report.on("error", function(event) {
Log.log(event.detail);
Expand Down Expand Up @@ -582,6 +622,14 @@ function _Embed_Create() {
Log.logText("Loaded");
});

// Report.off removes a given event handler if it exists.
report.off("rendered");

// Report.on will add an event handler which prints to Log window.
report.on("rendered", function() {
Log.logText("Rendered");
});

report.off("error");
report.on("error", function(event) {
Log.log(event.detail);
Expand Down Expand Up @@ -637,6 +685,14 @@ function _Mock_Embed_Create() {
Log.logText("Loaded");
});

// Report.off removes a given event handler if it exists.
report.off("rendered");

// Report.on will add an event handler which prints to Log window.
report.on("rendered", function() {
Log.logText("Rendered");
});

report.off("saveAsTriggered");
report.on("saveAsTriggered", function() {
Log.logText("Cannot save sample report");
Expand Down
47 changes: 39 additions & 8 deletions dist/powerbi-client.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*! powerbi-client v2.7.1 | (c) 2016 Microsoft Corporation MIT */
/*! powerbi-client v2.7.2 | (c) 2016 Microsoft Corporation MIT */
declare module "util" {
import { HttpPostMessage } from 'http-post-message';
/**
* Raises a custom event with event data on the specified HTML element.
*
Expand Down Expand Up @@ -62,6 +63,16 @@ declare module "util" {
* @returns {string}
*/
export function addParamToUrl(url: string, paramName: string, value: string): string;
/**
* Checks if the report is saved.
*
* @export
* @param {HttpPostMessage} hpm
* @param {string} uid
* @param {Window} contentWindow
* @returns {Promise<boolean>}
*/
export function isSavedInternal(hpm: HttpPostMessage, uid: string, contentWindow: Window): Promise<boolean>;
}
declare module "embed" {
import * as service from "service";
Expand Down Expand Up @@ -208,7 +219,7 @@ declare module "embed" {
/**
* Handler function for the 'ready' event
*/
frontLoadHandler: (HTMLElement) => any;
frontLoadHandler: () => any;
/**
* Creates an instance of Embed.
*
Expand Down Expand Up @@ -941,12 +952,22 @@ declare module "report" {
*/
refresh(): Promise<void>;
/**
* Apply a theme to the report
*
* ```javascript
* report.applyTheme(theme);
* ```
*/
* checks if the report is saved.
*
* ```javascript
* report.isSaved()
* ```
*
* @returns {Promise<boolean>}
*/
isSaved(): Promise<boolean>;
/**
* Apply a theme to the report
*
* ```javascript
* report.applyTheme(theme);
* ```
*/
applyTheme(theme: models.IReportTheme): Promise<void>;
/**
* Reset and apply the default theme of the report
Expand Down Expand Up @@ -983,6 +1004,16 @@ declare module "create" {
* @returns {void}
*/
populateConfig(baseConfig: embed.IEmbedConfigurationBase): void;
/**
* checks if the report is saved.
*
* ```javascript
* report.isSaved()
* ```
*
* @returns {Promise<boolean>}
*/
isSaved(): Promise<boolean>;
/**
* Adds the ability to get datasetId from url.
* (e.g. http://embedded.powerbi.com/appTokenReportEmbed?datasetId=854846ed-2106-4dc2-bc58-eb77533bf2f1).
Expand Down
Loading

0 comments on commit fa039b2

Please sign in to comment.