Merged PR 19200: Merge dev to master

This commit is contained in:
Ali Hamud 2017-03-26 15:06:46 +00:00
Родитель b3fc219590
Коммит 8104c39d95
9 изменённых файлов: 53 добавлений и 8 удалений

Просмотреть файл

@ -503,6 +503,23 @@ function _Report_Reload() {
}); });
} }
function _Report_Refresh() {
// Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0];
// Get a reference to the embedded report.
report = powerbi.get(reportContainer);
// Refresh the displayed report
report.refresh()
.then(function (result) {
Log.log(result);
})
.catch(function (errors) {
Log.log(errors);
});
}
function _Report_FullScreen() { function _Report_FullScreen() {
// Get a reference to the embedded report HTML element // Get a reference to the embedded report HTML element
var reportContainer = $('#reportContainer')[0]; var reportContainer = $('#reportContainer')[0];

Просмотреть файл

@ -4,6 +4,7 @@ const SessionKeys = {
AccessToken : "accessToken", AccessToken : "accessToken",
EmbedUrl : "embedUrl", EmbedUrl : "embedUrl",
EmbedId : "embedId", EmbedId : "embedId",
GroupId : "groupId",
IsSampleReport: "isSampleReport" IsSampleReport: "isSampleReport"
}; };
@ -48,6 +49,17 @@ function SetTextBoxesFromSessionOrUrlParam(accessTokenSelector, embedUrlSelector
if (!embedUrl) if (!embedUrl)
{ {
embedUrl = GetSession(SessionKeys.EmbedUrl); embedUrl = GetSession(SessionKeys.EmbedUrl);
} else {
var groupId = GetParameterByName(SessionKeys.GroupId);
if(groupId)
{
if (embedUrl.indexOf("?") != -1)
{
embedUrl += "&groupId=" + groupId;
} else {
embedUrl += "?groupId=" + groupId;
}
}
} }
var embedId = GetParameterByName(SessionKeys.EmbedId); var embedId = GetParameterByName(SessionKeys.EmbedId);

Просмотреть файл

@ -35,6 +35,10 @@ function Report_Reload() {
SetCode(_Report_Reload); SetCode(_Report_Reload);
} }
function Report_Refresh() {
SetCode(_Report_Refresh);
}
function Report_FullScreen() { function Report_FullScreen() {
SetCode(_Report_FullScreen); SetCode(_Report_FullScreen);
} }

Просмотреть файл

@ -31,6 +31,7 @@
<li class="" onclick="Report_PrintCurrentReport()">Print</li> <li class="" onclick="Report_PrintCurrentReport()">Print</li>
<li class="" onclick="Report_UpdateSettings()">Update settings</li> <li class="" onclick="Report_UpdateSettings()">Update settings</li>
<li class="" onclick="Report_Reload()">Reload</li> <li class="" onclick="Report_Reload()">Reload</li>
<li class="" onclick="Report_Refresh()">Refresh</li>
<li class="" onclick="Report_FullScreen()">Full screen</li> <li class="" onclick="Report_FullScreen()">Full screen</li>
<li class="" onclick="Report_ExitFullScreen()">Exit full screen</li> <li class="" onclick="Report_ExitFullScreen()">Exit full screen</li>
</ul> </ul>

8
dist/powerbi.js поставляемый
Просмотреть файл

@ -313,7 +313,13 @@ return /******/ (function(modules) { // webpackBootstrap
/** Removes the iframe from the element. */ /** Removes the iframe from the element. */
var iframe = element.querySelector('iframe'); var iframe = element.querySelector('iframe');
if (iframe) { if (iframe) {
iframe.remove(); if (iframe.remove !== undefined) {
iframe.remove();
}
else {
/** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */
iframe.parentElement.removeChild(iframe);
}
} }
}; };
/** /**

2
dist/powerbi.js.map поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

2
dist/powerbi.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -69,7 +69,7 @@ export class Service implements IService {
/** /**
* A list of components that this service can embed * A list of components that this service can embed
*/ */
private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [ private static components: (typeof Report | typeof Tile | typeof Dashboard)[] = [
Tile, Tile,
Report, Report,
Dashboard Dashboard
@ -170,7 +170,6 @@ export class Service implements IService {
let powerBiElement = <IPowerBiElement>element; let powerBiElement = <IPowerBiElement>element;
const component = new Create(this, powerBiElement, config); const component = new Create(this, powerBiElement, config);
powerBiElement.powerBiEmbed = component; powerBiElement.powerBiEmbed = component;
this.addOrOverwriteEmbed(component, element); this.addOrOverwriteEmbed(component, element);
return component; return component;
@ -270,7 +269,7 @@ export class Service implements IService {
const report = new Report(this, element, config, element.powerBiEmbed.iframe); const report = new Report(this, element, config, element.powerBiEmbed.iframe);
report.load(<embed.IInternalEmbedConfiguration>config); report.load(<embed.IInternalEmbedConfiguration>config);
element.powerBiEmbed = report; element.powerBiEmbed = report;
this.addOrOverwriteEmbed(component, element); this.addOrOverwriteEmbed(component, element);
return report; return report;
@ -350,7 +349,13 @@ export class Service implements IService {
/** Removes the iframe from the element. */ /** Removes the iframe from the element. */
const iframe = element.querySelector('iframe'); const iframe = element.querySelector('iframe');
if (iframe) { if (iframe) {
iframe.remove(); if(iframe.remove !== undefined) {
iframe.remove();
}
else {
/** Workaround for IE: unhandled rejection TypeError: object doesn't support propert or method 'remove' */
iframe.parentElement.removeChild(iframe);
}
} }
} }

Просмотреть файл

@ -18,7 +18,7 @@
"check-decl", "check-decl",
"check-operator", "check-operator",
"check-module", "check-module",
"check-seperator", "check-separator",
"check-type" "check-type"
], ],
"object-literal-sort-keys": false "object-literal-sort-keys": false