You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merged PR 229864: Release version 2.19.1 - Scrub config
Remove `accessToken` from the config when throwing an exception.
### Notes for reviewers
- Spread operator seems to be [well supported](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax), doesn't work in IE however it was transplied to `__assign` in JS Code
- I can't put it in `utils.ts` because that would create a circular dependency (with `embed.ts` due to type imports).
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "powerbi-client",
3
-
"version": "2.19.0",
3
+
"version": "2.19.1",
4
4
"description": "JavaScript library for embedding Power BI into your apps. Provides service which makes it easy to embed different types of components and an object model which allows easy interaction with these components such as changing pages, applying filters, and responding to data selection.",
thrownewError(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${Embed.typeAttribute}="${Report.type.toLowerCase()}"'.`);
402
+
constscrubbedConfig={ ...config,accessToken: ""};
403
+
thrownewError(`Attempted to embed using config ${JSON.stringify(scrubbedConfig)} on element ${element.outerHTML}, but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '${Embed.typeAttribute}="${Report.type.toLowerCase()}"'.`);
403
404
}
404
405
405
406
// Saves the type as part of the configuration so that it can be referenced later at a known location.
@@ -429,7 +430,8 @@ export class Service implements IService {
thrownewError(`Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML} which already has embedded component associated, but could not find the existing component in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);
433
+
constscrubbedConfig={ ...config,accessToken: ""};
434
+
thrownewError(`Attempted to embed using config ${JSON.stringify(scrubbedConfig)} on element ${element.outerHTML} which already has embedded component associated, but could not find the existing component in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.`);
433
435
}
434
436
435
437
// TODO: Multiple embedding to the same iframe is not supported in QnA
@@ -457,8 +459,8 @@ export class Service implements IService {
457
459
458
460
returnreport;
459
461
}
460
-
461
-
thrownewError(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(config)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);
462
+
constscrubbedConfig={ ...config,accessToken: ""};
463
+
thrownewError(`Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config ${JSON.stringify(scrubbedConfig)} on element ${element.outerHTML}, but the existing element contains an embed of type: ${this.config.type} which does not match the new type: ${config.type}`);
0 commit comments