Skip to content

Commit 284b9a4

Browse files
authored
Merge pull request microsoft#183 from Microsoft/merge_master
Changes - 27.03
2 parents 3170616 + 3632863 commit 284b9a4

File tree

8 files changed

+50
-10
lines changed

8 files changed

+50
-10
lines changed

demo/code-demo/scripts/codesamples.js

+17
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,23 @@ function _Report_Reload() {
503503
});
504504
}
505505

506+
function _Report_Refresh() {
507+
// Get a reference to the embedded report HTML element
508+
var reportContainer = $('#reportContainer')[0];
509+
510+
// Get a reference to the embedded report.
511+
report = powerbi.get(reportContainer);
512+
513+
// Refresh the displayed report
514+
report.refresh()
515+
.then(function (result) {
516+
Log.log(result);
517+
})
518+
.catch(function (errors) {
519+
Log.log(errors);
520+
});
521+
}
522+
506523
function _Report_FullScreen() {
507524
// Get a reference to the embedded report HTML element
508525
var reportContainer = $('#reportContainer')[0];

demo/code-demo/scripts/session_utils.js

+12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const SessionKeys = {
44
AccessToken : "accessToken",
55
EmbedUrl : "embedUrl",
66
EmbedId : "embedId",
7+
GroupId : "groupId",
78
IsSampleReport: "isSampleReport"
89
};
910

@@ -48,6 +49,17 @@ function SetTextBoxesFromSessionOrUrlParam(accessTokenSelector, embedUrlSelector
4849
if (!embedUrl)
4950
{
5051
embedUrl = GetSession(SessionKeys.EmbedUrl);
52+
} else {
53+
var groupId = GetParameterByName(SessionKeys.GroupId);
54+
if(groupId)
55+
{
56+
if (embedUrl.indexOf("?") != -1)
57+
{
58+
embedUrl += "&groupId=" + groupId;
59+
} else {
60+
embedUrl += "?groupId=" + groupId;
61+
}
62+
}
5163
}
5264

5365
var embedId = GetParameterByName(SessionKeys.EmbedId);

demo/code-demo/scripts/step_embed.js

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ function Report_Reload() {
3535
SetCode(_Report_Reload);
3636
}
3737

38+
function Report_Refresh() {
39+
SetCode(_Report_Refresh);
40+
}
41+
3842
function Report_FullScreen() {
3943
SetCode(_Report_FullScreen);
4044
}

demo/code-demo/settings_interact.html

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<li class="" onclick="Report_PrintCurrentReport()">Print</li>
3232
<li class="" onclick="Report_UpdateSettings()">Update settings</li>
3333
<li class="" onclick="Report_Reload()">Reload</li>
34+
<li class="" onclick="Report_Refresh()">Refresh</li>
3435
<li class="" onclick="Report_FullScreen()">Full screen</li>
3536
<li class="" onclick="Report_ExitFullScreen()">Exit full screen</li>
3637
</ul>

dist/powerbi.js

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/service.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ export class Service implements IService {
170170
let powerBiElement = <IPowerBiElement>element;
171171
const component = new Create(this, powerBiElement, config);
172172
powerBiElement.powerBiEmbed = component;
173-
174173
this.addOrOverwriteEmbed(component, element);
175174

176175
return component;
@@ -266,7 +265,7 @@ export class Service implements IService {
266265
/**
267266
* When loading report after create we want to use existing Iframe to optimize load period
268267
*/
269-
if (config.type === "report" && component.config.type === "create") {
268+
if(config.type === "report" && component.config.type === "create") {
270269
const report = new Report(this, element, config, element.powerBiEmbed.iframe);
271270
report.load(<embed.IInternalEmbedConfiguration>config);
272271
element.powerBiEmbed = report;
@@ -323,7 +322,7 @@ export class Service implements IService {
323322

324323
addOrOverwriteEmbed(component: embed.Embed, element: HTMLElement): void {
325324
// remove embeds over the same div element.
326-
this.embeds = this.embeds.filter(function (embed) {
325+
this.embeds = this.embeds.filter(function(embed) {
327326
return embed.element.id !== element.id;
328327
});
329328

@@ -350,11 +349,12 @@ export class Service implements IService {
350349
/** Removes the iframe from the element. */
351350
const iframe = element.querySelector('iframe');
352351
if (iframe) {
353-
if (iframe.remove !== undefined) {
352+
if(iframe.remove !== undefined) {
354353
iframe.remove();
355-
} else {
356-
// workaround for IE: Unhandled rejection TypeError: object doesn't support property or method 'remove'
357-
iframe.parentElement.removeChild(iframe);
354+
}
355+
else {
356+
/** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */
357+
iframe.parentElement.removeChild(iframe);
358358
}
359359
}
360360
}

0 commit comments

Comments
 (0)