Skip to content

Commit 8104c39

Browse files
committed
Merged PR 19200: Merge dev to master
1 parent b3fc219 commit 8104c39

9 files changed

Lines changed: 53 additions & 8 deletions

File tree

‎demo/code-demo/scripts/codesamples.js‎

Lines changed: 17 additions & 0 deletions
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‎

Lines changed: 12 additions & 0 deletions
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‎

Lines changed: 4 additions & 0 deletions
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‎

Lines changed: 1 addition & 0 deletions
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‎

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/powerbi.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/powerbi.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/service.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class Service implements IService {
6969
/**
7070
* A list of components that this service can embed
7171
*/
72-
private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [
72+
private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [
7373
Tile,
7474
Report,
7575
Dashboard
@@ -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;
@@ -270,7 +269,7 @@ export class Service implements IService {
270269
const report = new Report(this, element, config, element.powerBiEmbed.iframe);
271270
report.load(<embed.IInternalEmbedConfiguration>config);
272271
element.powerBiEmbed = report;
273-
272+
274273
this.addOrOverwriteEmbed(component, element);
275274

276275
return report;
@@ -350,7 +349,13 @@ export class Service implements IService {
350349
/** Removes the iframe from the element. */
351350
const iframe = element.querySelector('iframe');
352351
if (iframe) {
353-
iframe.remove();
352+
if(iframe.remove !== undefined) {
353+
iframe.remove();
354+
}
355+
else {
356+
/** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */
357+
iframe.parentElement.removeChild(iframe);
358+
}
354359
}
355360
}
356361

‎tslint.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"check-decl",
1919
"check-operator",
2020
"check-module",
21-
"check-seperator",
21+
"check-separator",
2222
"check-type"
2323
],
2424
"object-literal-sort-keys": false

0 commit comments

Comments
 (0)