Skip to content

Commit c87eb45

Browse files
authored
Merge pull request microsoft#366 from microsoft/releases-2.14.1
Releases 2.14.1
2 parents abe3298 + 834b8c7 commit c87eb45

21 files changed

+282
-181
lines changed

demo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"http-server": "^0.9.0",
3737
"jquery": "^3.1.0",
3838
"powerbi-client": "file:..",
39-
"powerbi-report-authoring": "^1.0",
39+
"powerbi-report-authoring": "^1.1",
4040
"syntaxhighlighter": "4.0.1"
4141
},
4242
"devDependencies": {}

demo/v2-demo/scripts/aisdk.js

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
const appUrl = 'https://powerbiplaygroundbe.azurewebsites.net/App';
2+
const appUrlEnabled = false;
3+
const defaultInstrumentationKey = "ffe7093c-af96-4df9-8452-b9f4b35ccded";
24

35
var appInsightsInstanceDeferred = $.Deferred();
46

5-
$.getJSON(appUrl, function (appConfig) {
7+
if (appUrlEnabled) {
8+
$.getJSON(appUrl, function (appConfig) {
9+
createAppInsightsInstance(appConfig.instrumentationKey);
10+
});
11+
}
12+
else {
13+
createAppInsightsInstance(defaultInstrumentationKey);
14+
}
15+
16+
function createAppInsightsInstance(instrumentationKey) {
617
// Application Insights setup
718
var sdkInstance="appInsightsSDK";window[sdkInstance]="appInsights";var aiName=window[sdkInstance],aisdk=window[aiName]||function(e){function n(e){t[e]=function(){var n=arguments;t.queue.push(function(){t[e].apply(t,n)})}}var t={config:e};t.initialize=!0;var i=document,a=window;setTimeout(function(){var n=i.createElement("script");n.src=e.url||"https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js",i.getElementsByTagName("script")[0].parentNode.appendChild(n)});try{t.cookie=i.cookie}catch(e){}t.queue=[],t.version=2;for(var r=["Event","PageView","Exception","Trace","DependencyData","Metric","PageViewPerformance"];r.length;)n("track"+r.pop());n("startTrackPage"),n("stopTrackPage");var s="Track"+r[0];if(n("start"+s),n("stop"+s),n("addTelemetryInitializer"),n("setAuthenticatedUserContext"),n("clearAuthenticatedUserContext"),n("flush"),!(!0===e.disableExceptionTracking||e.extensionConfig&&e.extensionConfig.ApplicationInsightsAnalytics&&!0===e.extensionConfig.ApplicationInsightsAnalytics.disableExceptionTracking)){n("_"+(r="onerror"));var o=a[r];a[r]=function(e,n,i,a,s){var c=o&&o(e,n,i,a,s);return!0!==c&&t["_"+r]({message:e,url:n,lineNumber:i,columnNumber:a,error:s}),c},e.autoExceptionInstrumented=!0}return t}(
8-
{
9-
instrumentationKey: appConfig.instrumentationKey
10-
}
11-
);window[aiName]=aisdk,aisdk.queue&&0===aisdk.queue.length&&aisdk.trackPageView({});
19+
{
20+
instrumentationKey: instrumentationKey
21+
}
22+
);window[aiName]=aisdk,aisdk.queue&&0===aisdk.queue.length&&aisdk.trackPageView({});
1223

13-
appInsightsInstanceDeferred.resolve(appInsights);
14-
});
24+
appInsightsInstanceDeferred.resolve(appInsights);
25+
}
1526

1627
function getAppInsightsInstance() {
1728
return appInsightsInstanceDeferred;

dist/powerbi-client.d.ts

+25-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.13.2 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.14.1 | (c) 2016 Microsoft Corporation MIT */
22
declare module "util" {
33
import { HttpPostMessage } from 'http-post-message';
44
/**
@@ -93,6 +93,14 @@ declare module "util" {
9393
* Returns random number
9494
*/
9595
export function getRandomValue(): number;
96+
/**
97+
* Returns the time interval between two dates in milliseconds
98+
* @export
99+
* @param {Date} start
100+
* @param {Date} end
101+
* @returns {number}
102+
*/
103+
export function getTimeDiffInMilliseconds(start: Date, end: Date): number;
96104
}
97105
declare module "config" {
98106
/** @ignore */ /** */
@@ -102,14 +110,6 @@ declare module "config" {
102110
};
103111
export default config;
104112
}
105-
declare module "defaults" {
106-
import * as models from 'powerbi-models';
107-
/** @hidden */
108-
export abstract class Defaults {
109-
static defaultSettings: models.ISettings;
110-
static defaultQnaSettings: models.IQnaSettings;
111-
}
112-
}
113113
declare module "errors" {
114114
export let APINotSupportedForRDLError: string;
115115
export let EmbedUrlNotSupported: string;
@@ -259,6 +259,15 @@ declare module "embed" {
259259
* @hidden
260260
*/
261261
iframe: HTMLIFrameElement;
262+
/**
263+
* Saves the iframe state. Each iframe should be loaded only once.
264+
* After first load, .embed will go into embedExisting path which will send
265+
* a postMessage of /report/load instead of creating a new iframe.
266+
*
267+
* @type {boolean}
268+
* @hidden
269+
*/
270+
iframeLoaded: boolean;
262271
/**
263272
* Gets or sets the configuration settings for the Power BI embed component.
264273
*
@@ -300,6 +309,11 @@ declare module "embed" {
300309
* @hidden
301310
*/
302311
frontLoadHandler: () => any;
312+
/**
313+
* The time the last /load request was sent
314+
* @hidden
315+
*/
316+
lastLoadRequest: Date;
303317
/**
304318
* Creates an instance of Embed.
305319
*
@@ -376,7 +390,7 @@ declare module "embed" {
376390
* @param {boolean} phasedRender
377391
* @returns {Promise<void>}
378392
*/
379-
load(config: IEmbedConfigurationBase, phasedRender?: boolean): Promise<void>;
393+
load(phasedRender?: boolean): Promise<void>;
380394
/**
381395
* Removes one or more event handlers from the list of handlers.
382396
* If a reference to the existing handle function is specified, remove the specific handler.
@@ -1479,7 +1493,7 @@ declare module "visual" {
14791493
* @hidden
14801494
*/
14811495
constructor(service: service.Service, element: HTMLElement, baseConfig: embed.IEmbedConfigurationBase, phasedRender?: boolean, isBootstrap?: boolean, iframe?: HTMLIFrameElement);
1482-
load(baseConfig: embed.IEmbedConfigurationBase, phasedRender?: boolean): Promise<void>;
1496+
load(phasedRender?: boolean): Promise<void>;
14831497
/**
14841498
* Gets the list of pages within the report - not supported in visual embed.
14851499
*

0 commit comments

Comments
 (0)