Skip to content

Commit b8b5fa7

Browse files
authored
Extended audit for network calls (#100)
1 parent f18af79 commit b8b5fa7

4 files changed

Lines changed: 15 additions & 11 deletions

File tree

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This page contains information about changes to the **PowerBI-visuals-webpack-plugin**.
44

5+
## 4.3.1
6+
7+
* Extended audit for network calls
8+
59
## 4.3.0
610

711
* Added support for dynamic {capabilities.js, dependencies.js} configs

package-lock.json

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-visuals-webpack-plugin",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"description": "PowerBI Custom Visuals webpack plugin",
55
"main": "src/index.js",
66
"keywords": [

src/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,22 +236,21 @@ class PowerBICustomVisualsWebpackPlugin {
236236
},
237237

238238
MemberExpression(path) {
239-
const object = path.get("object");
240239
const property = path.get("property");
241240

242-
if (object.isIdentifier({ name: "window" }) && property.isIdentifier()) {
241+
if (property.isIdentifier()) {
243242
checkAndReplace(path, property.node.name);
244243
}
245244
}
246245
});
247246

248-
this.logAudit(certificationAudit, forceFix, audit);
247+
this.logAudit(certificationAudit, forceFix, audit, callsToCheck);
249248
return generate(parsedCode, { retainLines: true }).code;
250249
}
251250

252-
logAudit(certificationAudit, forceFix, audit) {
251+
logAudit(certificationAudit, forceFix, audit, callsToCheck) {
253252
if (forceFix) {
254-
logger.warn(`${certificationAudit.total} external requests were removed, test the visual before publishing`);
253+
logger.warn(`${certificationAudit.total} entries of ${callsToCheck.join(", ")} were removed. Test the visual before publishing`);
255254
} else if (audit) {
256255
logger.separator();
257256
logger.info('External requests audit:');

0 commit comments

Comments
 (0)