Skip to content

Commit

Permalink
Change GUID & fix loading package into Desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
zBritva committed Nov 17, 2023
1 parent f38336a commit 43f320d
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 33 deletions.
3 changes: 3 additions & 0 deletions visual/base-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ const performance = {
};

const plugins = [
new webpack.SourceMapDevToolPlugin({
filename: '[name].js.map',
}),
new webpack.DefinePlugin({
CHARTICULATOR_PACKAGE: JSON.stringify({
version,
Expand Down
10 changes: 5 additions & 5 deletions visual/editor-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const webpack = require("webpack");
const Visualizer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

// werbpack plugin
const PowerBICustomVisualsWebpackPlugin = require('powerbi-visuals-webpack-plugin');
const { PowerBICustomVisualsWebpackPlugin } = require('powerbi-visuals-webpack-plugin');

// api configuration
const powerbiApi = require("powerbi-visuals-api");
Expand All @@ -22,9 +22,9 @@ const localizationFolders = fs.existsSync(resourcesFolder) && fs.readdirSync(res
const { merge } = require('webpack-merge');
const base = require('./base-webpack.config.js');

const GUID = 'charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_EDITOR' || pbivizFile.visual.guid;
const NAME = 'Charticulator Community Version (Editor)' || pbivizFile.visual.name;
const DISPLAY_NAME = 'CharticulatorCommunityVersionEditor' || pbivizFile.visual.displayName;
const GUID = 'charticulatorVisualCommunity_EDITOR' || pbivizFile.visual.guid;
const NAME = 'CharticulatorCommunityVersionEditor' || pbivizFile.visual.name;
const DISPLAY_NAME = 'Charticulator Community Version (Editor)' || pbivizFile.visual.displayName;

const pluginLocation = './src/visualPluginEditor.ts';
const statsLocation = "../../editor.webpack.statistics.html";
Expand Down Expand Up @@ -83,7 +83,7 @@ module.exports = merge(base, {
dependenciesSchema: powerbiApi.schemas.dependencies,
devMode: false,
generatePbiviz: true,
generateResources: true,
generateResources: false,
modules: true,
visualSourceLocation: "../src/visual",
pluginLocation: pluginLocation,
Expand Down
2 changes: 1 addition & 1 deletion visual/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"pegjs-loader": "0.5.8",
"powerbi-visuals-api": "4.7.0",
"powerbi-visuals-utils-dataviewutils": "2.4.1",
"powerbi-visuals-webpack-plugin": "3.1.0",
"powerbi-visuals-webpack-plugin": "3.2.1",
"raw-loader": "4.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions visual/pbiviz.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"visual": {
"name": "CharticulatorCommunityVersion",
"name": "Charticulator Community Version",
"displayName": "Charticulator (Community version)",
"guid": "charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD",
"guid": "charticulatorCommunityVersion",
"visualClassName": "Visual",
"version": "0.0.3",
"version": "0.0.4",
"description": "The community version of the charticulator visual. The visual in development mode doesn't include all functionalities implemented in the original version. But the visual uses the latest version of the Charticulator with new features and bug fixes",
"supportUrl": "https://github.com/zBritva/charticulator-visual-community/issues",
"gitHubUrl": "https://github.com/zBritva/charticulator-visual-community"
Expand Down
10 changes: 5 additions & 5 deletions visual/src/visualPluginEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import VisualConstructorOptions = powerbiVisualsApi.extensibility.visual.VisualC
import DialogConstructorOptions = powerbiVisualsApi.extensibility.visual.DialogConstructorOptions;
var powerbiKey: any = "powerbi";
var powerbi: any = window[powerbiKey];
var charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_EDITOR: IVisualPlugin = {
name: 'charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_EDITOR',
displayName: 'CharticulatorCommunityVersionEditor',
var charticulatorVisualCommunity_EDITOR: IVisualPlugin = {
name: 'charticulatorVisualCommunity_EDITOR',
displayName: 'Charticulator Community Version (Editor)',
class: 'Visual',
apiVersion: '4.7.0',
create: (options: VisualConstructorOptions) => {
Expand All @@ -27,6 +27,6 @@ var charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_EDITOR: IVisual
if (typeof powerbi !== "undefined") {
powerbi.visuals = powerbi.visuals || {};
powerbi.visuals.plugins = powerbi.visuals.plugins || {};
powerbi.visuals.plugins["charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_EDITOR"] = charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_EDITOR;
powerbi.visuals.plugins["charticulatorVisualCommunity_EDITOR"] = charticulatorVisualCommunity_EDITOR;
}
export default charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_EDITOR;
export default charticulatorVisualCommunity_EDITOR;
14 changes: 7 additions & 7 deletions visual/src/visualPluginView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import VisualConstructorOptions = powerbiVisualsApi.extensibility.visual.VisualC
import DialogConstructorOptions = powerbiVisualsApi.extensibility.visual.DialogConstructorOptions;
var powerbiKey: any = "powerbi";
var powerbi: any = window[powerbiKey];
var charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_VIEW: IVisualPlugin = {
name: 'charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_VIEW',
displayName: 'CharticulatorCommunityVersionView',
var charticulatorVisualCommunity_VIEW: IVisualPlugin = {
name: 'charticulatorVisualCommunity_VIEW',
displayName: 'Charticulator Community Version (View)',
class: 'Visual',
apiVersion: '4.7.0',
create: (options: VisualConstructorOptions) => {
create: (options?: VisualConstructorOptions) => {
if (Visual) {
return new Visual(options);
}
throw 'Visual instance not found';
},
createModalDialog: (dialogId: string, options: DialogConstructorOptions, initialState: object) => {
const dialogRegistry = globalThis.dialogRegistry;
const dialogRegistry = (<any>globalThis).dialogRegistry;
if (dialogId in dialogRegistry) {
new dialogRegistry[dialogId](options, initialState);
}
Expand All @@ -27,6 +27,6 @@ var charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_VIEW: IVisualPl
if (typeof powerbi !== "undefined") {
powerbi.visuals = powerbi.visuals || {};
powerbi.visuals.plugins = powerbi.visuals.plugins || {};
powerbi.visuals.plugins["charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_VIEW"] = charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_VIEW;
powerbi.visuals.plugins["charticulatorVisualCommunity_VIEW"] = charticulatorVisualCommunity_VIEW;
}
export default charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_VIEW;
export default charticulatorVisualCommunity_VIEW;
8 changes: 4 additions & 4 deletions visual/view-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const localizationFolders = fs.existsSync(resourcesFolder) && fs.readdirSync(res
const { merge } = require('webpack-merge');
const base = require('./base-webpack.config.js');

const GUID = 'charticulatorVisualCommunity487D3ADCA7E14F729E78065092536DBD_VIEW' || pbivizFile.visual.guid;
const NAME = 'Charticulator Community Version (View)' || pbivizFile.visual.name;
const DISPLAY_NAME = 'CharticulatorCommunityVersionView' || pbivizFile.visual.displayName;
const GUID = 'charticulatorVisualCommunity_VIEW' || pbivizFile.visual.guid;
const NAME = 'CharticulatorCommunityVersionView' || pbivizFile.visual.name;
const DISPLAY_NAME = 'Charticulator Community Version (View)' || pbivizFile.visual.displayName;

const pluginLocation = './src/visualPluginView.ts';
const statsLocation = "../../view.webpack.statistics.html";
Expand Down Expand Up @@ -88,7 +88,7 @@ module.exports = merge(base, {
dependenciesSchema: powerbiApi.schemas.dependencies,
devMode: false,
generatePbiviz: true,
generateResources: true,
generateResources: false,
modules: true,
visualSourceLocation: "../src/visual",
pluginLocation: pluginLocation,
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6686,7 +6686,7 @@ jsprim@^1.2.2:
json-schema "0.4.0"
verror "1.10.0"

jszip@^3.7.0:
jszip@^3.10.1:
version "3.10.1"
resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2"
integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==
Expand Down Expand Up @@ -8121,18 +8121,18 @@ [email protected]:
resolved "https://registry.yarnpkg.com/powerbi-visuals-utils-dataviewutils/-/powerbi-visuals-utils-dataviewutils-2.4.1.tgz#8657a24d773ac9e471b621195f04e9a24ccd8138"
integrity sha512-xgI4ru1KWcYFTbftLsR7Pzg14cslVPajUZUyRk6nzCEQvUMN/kVtPpVT5+s8UuhDZe7zpqSDAhSGS5yAcn9GcA==

powerbi-visuals-webpack-plugin@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/powerbi-visuals-webpack-plugin/-/powerbi-visuals-webpack-plugin-3.1.0.tgz#b2794435c788fd0c28e73f7963a59947f8b288d2"
integrity sha512-020pnxD800IPr8ZvQ7eJDZpK3HaJ6Qf7/MA0n+jipH7dpcoHdY/AHYkQQQJzrlB23XxkdmnP15pYXFQufwi7EA==
powerbi-visuals-webpack-plugin@3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/powerbi-visuals-webpack-plugin/-/powerbi-visuals-webpack-plugin-3.2.1.tgz#636d9129e53baef9a71ae7cc13fa6164835cfc35"
integrity sha512-Mb0j3EzInvNcVlYf8EzgmzKl8XMSEvOA+3MQuSYA4/CFtILilqUz5PFXNBqgcyEC0gJ5nZouhXWXujsLvsep6g==
dependencies:
ajv "6.12.3"
chalk "^4.1.1"
compare-versions "^3.6.0"
fs-extra "9.0.1"
jszip "^3.7.0"
jszip "^3.10.1"
lodash.clonedeep "4.5.0"
webpack-sources "^3.2.1"
webpack-sources "^3.2.3"

preact-compat@^3.18.3:
version "3.19.0"
Expand Down Expand Up @@ -10238,7 +10238,7 @@ webpack-merge@^5.10.0, webpack-merge@^5.7.3:
flat "^5.0.2"
wildcard "^2.0.0"

webpack-sources@^3.2.1, webpack-sources@^3.2.3:
webpack-sources@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
Expand Down

0 comments on commit 43f320d

Please sign in to comment.