powerbi-visuals-tools 5.2.0-beta.1 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/Changelog.md +3 -0
  2. package/bin/pbiviz.js +1 -0
  3. package/certs/PowerBICustomVisualTest_private.key +26 -26
  4. package/certs/PowerBICustomVisualTest_public.crt +17 -17
  5. package/lib/CertificateTools.js +10 -5
  6. package/lib/CommandManager.js +2 -2
  7. package/lib/VisualManager.js +19 -14
  8. package/lib/features/AdvancedEditMode.js +1 -0
  9. package/lib/features/AllowInteractions.js +1 -0
  10. package/lib/features/AnalyticsPane.js +1 -0
  11. package/lib/features/BaseFeature.js +1 -3
  12. package/lib/features/Bookmarks.js +1 -0
  13. package/lib/features/ColorPalette.js +1 -0
  14. package/lib/features/ConditionalFormatting.js +1 -0
  15. package/lib/features/ContextMenu.js +1 -0
  16. package/lib/features/DrillDown.js +1 -0
  17. package/lib/features/ESLint.js +2 -1
  18. package/lib/features/FetchMoreData.js +1 -0
  19. package/lib/features/FileDownload.js +1 -0
  20. package/lib/features/FormatPane.js +1 -0
  21. package/lib/features/HighContrast.js +1 -0
  22. package/lib/features/HighlightData.js +1 -0
  23. package/lib/features/KeyboardNavigation.js +1 -0
  24. package/lib/features/LandingPage.js +1 -0
  25. package/lib/features/LaunchURL.js +1 -0
  26. package/lib/features/LocalStorage.js +1 -0
  27. package/lib/features/Localizations.js +1 -0
  28. package/lib/features/ModalDialog.js +1 -0
  29. package/lib/features/RenderingEvents.js +1 -0
  30. package/lib/features/SelectionAcrossVisuals.js +1 -0
  31. package/lib/features/SyncSlicer.js +1 -0
  32. package/lib/features/Tooltips.js +1 -0
  33. package/lib/features/TotalSubTotal.js +2 -1
  34. package/lib/features/WarningIcon.js +1 -0
  35. package/package.json +8 -8
  36. package/templates/visuals/default/package.json +1 -1
  37. package/templates/visuals/default/src/settings.ts +1 -1
  38. package/templates/visuals/default/src/visual.ts +1 -1
  39. package/templates/visuals/rhtml/package.json +1 -1
  40. package/templates/visuals/rhtml/src/settings.ts +1 -1
  41. package/templates/visuals/rhtml/src/visual.ts +1 -1
  42. package/templates/visuals/rvisual/package.json +1 -1
  43. package/templates/visuals/rvisual/src/settings.ts +1 -1
  44. package/templates/visuals/rvisual/src/visual.ts +1 -1
  45. package/templates/visuals/slicer/package.json +1 -1
  46. package/templates/visuals/slicer/src/settings.ts +1 -1
  47. package/templates/visuals/slicer/src/visual.ts +1 -1
  48. package/templates/visuals/table/package.json +1 -1
package/Changelog.md CHANGED
@@ -5,6 +5,9 @@ This page contains information about changes to the PowerBI Visual Tools (pbiviz
5
5
  ## 5.2.0
6
6
  * Integrated PAC validation
7
7
 
8
+ ## 5.1.1
9
+ * Updated crypto import to fix error in old Node versions
10
+
8
11
  ## 5.1.0
9
12
  * New flag `--skip-api` to skip verifying api version. It might produce different errors in visual, so use it only in some specific cases (ex. installing something during the build process brakes packages managed by monorepo managers).
10
13
  * New flag `--all-locales` to disable optimization using localization loader. It's recommended not to use this flag because all locales take a huge amount of package size. If you need just a few of them follow [this guide](https://learn.microsoft.com/en-us/power-bi/developer/visuals/localization?tabs=English#step-5---add-a-resources-file-for-each-language). In this case, only declared in stringResources locales will be added to your visual package.
package/bin/pbiviz.js CHANGED
@@ -89,6 +89,7 @@ pbiviz
89
89
  .option('--no-stats', "Doesn't generate statistics files")
90
90
  .option('--skip-api', "Skips powerbi-visuals-api verifying")
91
91
  .option('-l, --all-locales', "Keeps all locale files in the package. By default only used inside stringResources folder locales are included.")
92
+ .option('-v, --verbose', "Enables verbose logging")
92
93
  .addOption(new Option('-c, --compression <compressionLevel>', "Enables compression of visual package")
93
94
  .choices(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])
94
95
  .default('6')
@@ -1,28 +1,28 @@
1
1
  -----BEGIN PRIVATE KEY-----
2
- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCrmhAfEgcfLpAN
3
-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wEB/zANBgkqhkiG9w0BAQsFAAOCAQEABoyo
13
+ Ul3UHn0htYQfe3luetCk4gp+oi2g3uiuCaG0CXcCLw/fcrn/a+BXIu89M/Lr3B58
14
+ 0fMU8M8X86MSztKXHU31b6w44J/zbqRKV8NR1f3pRnfKW1LIQAMg6RZCvFoFLKdL
15
+ jUuhGeig9JtyYFJ1wrbS8B+Z6ZqLci+whR6KG517umutIRfkjFeY4w/kblMLLBbp
16
+ EB7eHuflR06swZDZzyFm1hoJWSQkraiovuwFDPO02YfQAQdxH6y+ZyGoK7okSszs
17
+ 9ARzORTmiMGqaQIw0BDMji8GOij27ou8MQhWXJ+BS0xLBPPCjMcT5JujV/ewqeUh
18
+ 2CwYaihEXAJtwSvwSw==
19
19
  -----END CERTIFICATE-----
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-case-declarations */
1
2
  /*
2
3
  * Power BI Visual CLI
3
4
  *
@@ -28,7 +29,7 @@ import { exec as nodeExec } from 'child_process';
28
29
  import fs from 'fs-extra';
29
30
  import os from 'os';
30
31
  import path from 'path';
31
- import crypto, { webcrypto } from "crypto";
32
+ import crypto from "crypto";
32
33
  import { getRootPath, readJsonFromRoot } from './utils.js';
33
34
  import ConsoleWriter from './ConsoleWriter.js';
34
35
  const certSafePeriod = 1000 * 60 * 60 * 24; // 24 hours
@@ -114,11 +115,8 @@ export async function createCertFile(config, open) {
114
115
  }
115
116
  break;
116
117
  case "win32":
117
- // eslint-disable-next-line no-case-declarations
118
- let passphrase = "";
119
118
  // for windows 7 and others
120
119
  // 6.1 - Windows 7
121
- // eslint-disable-next-line no-case-declarations
122
120
  const osVersion = os.release().split(".");
123
121
  if ((Number(osVersion[0]) === 6 && Number(osVersion[1]) === 1) || Number(osVersion[0]) < 6) {
124
122
  await removeCertFiles(certPath, keyPath, pfxPath);
@@ -140,7 +138,14 @@ export async function createCertFile(config, open) {
140
138
  }
141
139
  break;
142
140
  }
143
- passphrase = (crypto.getRandomValues || webcrypto.getRandomValues)(new Uint32Array(1))[0].toString().substring(2);
141
+ let randomValues;
142
+ if (crypto.getRandomValues !== undefined) {
143
+ randomValues = crypto.getRandomValues(new Uint32Array(1));
144
+ }
145
+ else {
146
+ randomValues = crypto.webcrypto.getRandomValues(new Uint32Array(1));
147
+ }
148
+ const passphrase = randomValues[0].toString().substring(2);
144
149
  config.server.passphrase = passphrase;
145
150
  fs.writeFileSync(path.join(rootPath, confPath), JSON.stringify(config));
146
151
  // for windows 8 / 8.1 / server 2012 R2 /
@@ -40,9 +40,9 @@ export default class CommandManager {
40
40
  };
41
41
  new VisualManager(rootPath)
42
42
  .prepareVisual()
43
- .validateVisual()
43
+ .validateVisual(options.verbose)
44
44
  .initializeWebpack(webpackOptions)
45
- .then(visualManager => visualManager.generatePackage());
45
+ .then(visualManager => visualManager.generatePackage(options.verbose));
46
46
  }
47
47
  static new({ force, template }, name, rootPath) {
48
48
  const generateOptions = {
@@ -78,11 +78,11 @@ export default class VisualManager {
78
78
  this.compiler = webpack(this.webpackConfig);
79
79
  return this;
80
80
  }
81
- generatePackage() {
81
+ generatePackage(verbose = false) {
82
82
  const callback = (err, stats) => {
83
83
  this.createPackageInstance();
84
84
  const logs = this.validatePackage();
85
- this.outputResults(logs);
85
+ this.outputResults(logs, verbose);
86
86
  this.parseCompilationResults(err, stats);
87
87
  };
88
88
  this.compiler.run(callback);
@@ -114,10 +114,10 @@ export default class VisualManager {
114
114
  process.exit(1);
115
115
  }
116
116
  }
117
- validateVisual() {
117
+ validateVisual(verbose = false) {
118
118
  this.featureManager = new FeatureManager();
119
119
  const { status, logs } = this.featureManager.validate(Stage.PreBuild, this.visual);
120
- this.outputResults(logs);
120
+ this.outputResults(logs, verbose);
121
121
  if (status === Status.Error) {
122
122
  process.exit(1);
123
123
  }
@@ -128,17 +128,21 @@ export default class VisualManager {
128
128
  const { logs } = featureManager.validate(Stage.PostBuild, this.package);
129
129
  return logs;
130
130
  }
131
- outputResults({ errors, deprecation, warnings, info }) {
132
- const featuresTotalLog = {
133
- errors: `Visual doesn't support some features required for all custom visuals:`,
131
+ outputResults({ errors, deprecation, warnings, info }, verbose) {
132
+ const headerMessage = {
133
+ error: `Visual doesn't support some features required for all custom visuals:`,
134
134
  deprecation: `Some features are going to be required soon, please update the visual:`,
135
- warn: `Visual doesn't support some features recommended for all custom visuals:`,
136
- info: `Visual can be improved by adding some features:`
135
+ warning: `Visual doesn't support some features recommended for all custom visuals:`,
136
+ verboseInfo: `Visual can be improved by adding some features:`,
137
+ shortInfo: `Visual can be improved by adding ${info.length} more optional features.`
137
138
  };
138
- this.outputLogsWithHeadMessage(featuresTotalLog.errors, errors, Severity.Error);
139
- this.outputLogsWithHeadMessage(featuresTotalLog.deprecation, deprecation, Severity.Deprecation);
140
- this.outputLogsWithHeadMessage(featuresTotalLog.warn, warnings, Severity.Warning);
141
- this.outputLogsWithHeadMessage(featuresTotalLog.info, info, Severity.Info);
139
+ this.outputLogsWithHeadMessage(headerMessage.error, errors, Severity.Error);
140
+ this.outputLogsWithHeadMessage(headerMessage.deprecation, deprecation, Severity.Deprecation);
141
+ this.outputLogsWithHeadMessage(headerMessage.warning, warnings, Severity.Warning);
142
+ const verboseSuggestion = 'Run `pbiviz package` with --verbose flag to see more details.';
143
+ const headerInfoMessage = headerMessage[verbose ? "verboseInfo" : "shortInfo"];
144
+ const infoLogs = (!info.length || verbose) ? info : [verboseSuggestion];
145
+ this.outputLogsWithHeadMessage(headerInfoMessage, infoLogs, Severity.Info);
142
146
  }
143
147
  displayInfo() {
144
148
  if (this.pbivizConfig) {
@@ -246,7 +250,8 @@ export default class VisualManager {
246
250
  }
247
251
  let outputLog;
248
252
  switch (severity) {
249
- case Severity.Error || Severity.Deprecation:
253
+ case Severity.Deprecation:
254
+ case Severity.Error:
250
255
  outputLog = ConsoleWriter.error;
251
256
  break;
252
257
  case Severity.Warning:
@@ -5,6 +5,7 @@ export default class AdvancedEditMode {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return !packageInstance.isCapabilityEnabled({ advancedEditMode: 0 }); // 0 - Advanced edit mode is disabled
10
11
  }
@@ -5,6 +5,7 @@ export default class AllowInteractions {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain('.allowInteractions');
10
11
  }
@@ -5,6 +5,7 @@ export default class AnalyticsPane {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return (packageInstance.isCapabilityEnabled({
10
11
  objects: {
@@ -4,8 +4,6 @@ export default class BaseFeature {
4
4
  static visualFeatureType;
5
5
  static featureName;
6
6
  static documentationLink;
7
- static get errorMessage() {
8
- return `${this.featureName} - ${this.documentationLink}`;
9
- }
7
+ static errorMessage;
10
8
  static isSupported() { }
11
9
  }
@@ -5,6 +5,7 @@ export default class Bookmarks {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain("applySelectionFromFilter") || packageInstance.contain("registerOnSelectCallback");
10
11
  }
@@ -5,6 +5,7 @@ export default class ColorPalette {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".colorPalette");
10
11
  }
@@ -5,6 +5,7 @@ export default class ConditionalFormatting {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".createDataViewWildcardSelector");
10
11
  }
@@ -5,6 +5,7 @@ export default class ContextMenu {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".showContextMenu");
10
11
  }
@@ -5,6 +5,7 @@ export default class DrillDown {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({
10
11
  drilldown: {
@@ -2,9 +2,10 @@ import { Severity, Stage, VisualFeatureType } from "./FeatureTypes.js";
2
2
  export default class ESLint {
3
3
  static featureName = "ESLint";
4
4
  static documentationLink = "https://github.com/microsoft/eslint-plugin-powerbi-visuals";
5
- static severity = Severity.Error;
5
+ static severity = Severity.Warning;
6
6
  static stage = Stage.PreBuild;
7
7
  static visualFeatureType = VisualFeatureType.All;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(visual) {
9
10
  return visual.doesESLlintSupported();
10
11
  }
@@ -5,6 +5,7 @@ export default class FetchMoreData {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({
10
11
  dataViewMappings: [
@@ -5,6 +5,7 @@ export default class FileDownload {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".downloadService") && packageInstance.contain(".exportVisualsContent");
10
11
  }
@@ -5,6 +5,7 @@ export default class FormatPane {
5
5
  static severity = Severity.Deprecation;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.All;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain("getFormattingModel");
10
11
  }
@@ -5,6 +5,7 @@ export default class HighContrast {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".isHighContrast");
10
11
  }
@@ -5,6 +5,7 @@ export default class HighlightData {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({ supportsHighlight: true });
10
11
  }
@@ -5,6 +5,7 @@ export default class KeyboardNavigation {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({ supportsKeyboardFocus: true });
10
11
  }
@@ -5,6 +5,7 @@ export default class LandingPage {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({ supportsLandingPage: true });
10
11
  }
@@ -5,6 +5,7 @@ export default class LaunchURL {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".launchUrl");
10
11
  }
@@ -5,6 +5,7 @@ export default class LocalStorage {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".storageService");
10
11
  }
@@ -5,6 +5,7 @@ export default class Localizations {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".createLocalizationManager");
10
11
  }
@@ -5,6 +5,7 @@ export default class ModalDialog {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".openModalDialog");
10
11
  }
@@ -5,6 +5,7 @@ export default class RenderingEvents {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.All;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  const keywords = [".eventService", ".renderingStarted", ".renderingFinished"];
10
11
  return !keywords.some(keyword => !packageInstance.contain(keyword));
@@ -5,6 +5,7 @@ export default class SelectionAcrossVisuals {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({ supportsMultiVisualSelection: true });
10
11
  }
@@ -5,6 +5,7 @@ export default class SyncSlicer {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({ supportsSynchronizingFilterState: true });
10
11
  }
@@ -5,6 +5,7 @@ export default class Tooltips {
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain("tooltipService") && packageInstance.isCapabilityEnabled({ tooltips: {} });
10
11
  }
@@ -4,7 +4,8 @@ export default class TotalSubTotal {
4
4
  static documentationLink = "https://learn.microsoft.com/en-us/power-bi/developer/visuals/total-subtotal-api";
5
5
  static severity = Severity.Warning;
6
6
  static stage = Stage.PostBuild;
7
- static visualFeatureType = VisualFeatureType.Matrix | VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
7
+ static visualFeatureType = VisualFeatureType.Matrix;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.isCapabilityEnabled({ subtotals: true });
10
11
  }
@@ -5,6 +5,7 @@ export default class WarningIcon {
5
5
  static severity = Severity.Info;
6
6
  static stage = Stage.PostBuild;
7
7
  static visualFeatureType = VisualFeatureType.NonSlicer | VisualFeatureType.Slicer;
8
+ static errorMessage = `${this.featureName} - ${this.documentationLink}`;
8
9
  static isSupported(packageInstance) {
9
10
  return packageInstance.contain(".displayWarningIcon");
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerbi-visuals-tools",
3
- "version": "5.2.0-beta.1",
3
+ "version": "5.2.0",
4
4
  "description": "Command line tool for creating and publishing visuals for Power BI",
5
5
  "main": "./bin/pbiviz.js",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "homepage": "https://github.com/Microsoft/PowerBI-visuals-tools#readme",
31
31
  "dependencies": {
32
- "@typescript-eslint/parser": "^5.62.0",
33
- "assert": "^2.0.0",
32
+ "@typescript-eslint/parser": "^6.7.5",
33
+ "assert": "^2.1.0",
34
34
  "async": "^3.2.4",
35
35
  "browserify-zlib": "^0.2.0",
36
36
  "buffer": "^6.0.3",
@@ -68,19 +68,19 @@
68
68
  "string_decoder": "^1.3.0",
69
69
  "terser-webpack-plugin": "^5.3.9",
70
70
  "timers-browserify": "^2.0.12",
71
- "ts-loader": "^9.4.4",
71
+ "ts-loader": "^9.5.0",
72
72
  "tty-browserify": "^0.0.1",
73
73
  "typescript": "^4.9.5",
74
- "url": "^0.11.1",
74
+ "url": "^0.11.3",
75
75
  "util": "^0.12.5",
76
76
  "vm-browserify": "^1.1.2",
77
77
  "webpack": "^5.88.2",
78
- "webpack-bundle-analyzer": "4.9.0",
78
+ "webpack-bundle-analyzer": "4.9.1",
79
79
  "webpack-dev-server": "^4.15.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@typescript-eslint/eslint-plugin": "^5.62.0",
83
- "eslint": "^8.47.0",
82
+ "@typescript-eslint/eslint-plugin": "^6.7.5",
83
+ "eslint": "^8.51.0",
84
84
  "eslint-plugin-powerbi-visuals": "^0.8.1",
85
85
  "jasmine": "5.1.0",
86
86
  "jasmine-spec-reporter": "7.0.0",
@@ -17,7 +17,7 @@
17
17
  "@types/d3": "7.4.0",
18
18
  "d3": "7.8.5",
19
19
  "powerbi-visuals-api": "5.4.0",
20
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
20
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@typescript-eslint/eslint-plugin": "^5.59.11",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -59,7 +59,7 @@ export class Visual implements IVisual {
59
59
  }
60
60
 
61
61
  public update(options: VisualUpdateOptions) {
62
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
62
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
63
63
 
64
64
  console.log('Visual update', options);
65
65
  if (this.textNode) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visual",
3
3
  "dependencies": {
4
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
4
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
5
5
  },
6
6
  "devDependencies": {
7
7
  "powerbi-visuals-api": "5.4.0",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -111,7 +111,7 @@ export class Visual implements IVisual {
111
111
  }
112
112
 
113
113
  const dataView: DataView = options.dataViews[0];
114
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
114
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
115
115
 
116
116
  let payloadBase64: string = null;
117
117
  if (dataView.scriptResult && dataView.scriptResult.payloadBase64) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visual",
3
3
  "dependencies": {
4
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
4
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
5
5
  },
6
6
  "devDependencies": {
7
7
  "powerbi-visuals-api": "5.4.0",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -63,7 +63,7 @@ export class Visual implements IVisual {
63
63
  }
64
64
 
65
65
  const dataView: DataView = options.dataViews[0];
66
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
66
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
67
67
 
68
68
  let imageUrl: string = null;
69
69
  if (dataView.scriptResult && dataView.scriptResult.payloadBase64) {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "d3": "7.8.5",
11
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
11
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@types/d3": "7.4.0",
@@ -28,7 +28,7 @@
28
28
 
29
29
  import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
30
30
 
31
- import FormattingSettingsCard = formattingSettings.Card;
31
+ import FormattingSettingsCard = formattingSettings.SimpleCard;
32
32
  import FormattingSettingsSlice = formattingSettings.Slice;
33
33
  import FormattingSettingsModel = formattingSettings.Model;
34
34
 
@@ -59,7 +59,7 @@ export class Visual implements IVisual {
59
59
  }
60
60
 
61
61
  public update(options: VisualUpdateOptions) {
62
- this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews);
62
+ this.formattingSettings = this.formattingSettingsService.populateFormattingSettingsModel(VisualFormattingSettingsModel, options.dataViews[0]);
63
63
  console.log("Visual update", options);
64
64
  if (this.textNode) {
65
65
  this.textNode.textContent = (this.updateCount++).toString();
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "d3": "7.8.5",
11
- "powerbi-visuals-utils-formattingmodel": "5.0.0"
11
+ "powerbi-visuals-utils-formattingmodel": "6.0.0"
12
12
  },
13
13
  "devDependencies": {
14
14
  "powerbi-visuals-api": "5.4.0",