diff --git a/packages/mindplot/.eslintrc.json b/packages/mindplot/.eslintrc.json index 2aa693db..05357107 100644 --- a/packages/mindplot/.eslintrc.json +++ b/packages/mindplot/.eslintrc.json @@ -8,6 +8,9 @@ "airbnb-base", "plugin:cypress/recommended" ], + "parserOptions": { + "ecmaVersion": 11 + }, "globals": { // designer is a global currently used as a hack. Remove this when fixing the hack. "designer": true diff --git a/packages/mindplot/src/components/DesignerBuilder.js b/packages/mindplot/src/components/DesignerBuilder.js index 57fb02ef..a2df7bd4 100644 --- a/packages/mindplot/src/components/DesignerBuilder.js +++ b/packages/mindplot/src/components/DesignerBuilder.js @@ -56,7 +56,7 @@ export function buildDesigner(options) { // Configure default persistence manager ... const persistence = options.persistenceManager; - $assert(persistence, "persistence must be defined"); + $assert(persistence, 'persistence must be defined'); PersistenceManager.init(persistence); // Register toolbar event ... @@ -73,7 +73,7 @@ export function buildDesigner(options) { } export function buildDefaultOptions(persistence, readOnly = false) { - $assert(persistence, "persistence must be defined"); + $assert(persistence, 'persistence must be defined'); // Set workspace screen size as default. In this way, resize issues are solved. const containerSize = { height: Number.parseInt(window.screen.height, 10), @@ -85,7 +85,7 @@ export function buildDefaultOptions(persistence, readOnly = false) { width: Number.parseInt(window.innerWidth, 10), }; return { - readOnly: readOnly, + readOnly, zoom: 0.85, saveOnLoad: true, size: containerSize, @@ -109,7 +109,7 @@ export async function loadOptions(jsonConf, persistence, readOnly = false) { export function loadExample(exampleFn) { $(() => { - // Hack: load bootstrap first + // eslint-disable-next-line import/no-extraneous-dependencies import('@libraries/bootstrap').then(exampleFn); }); } diff --git a/packages/mindplot/src/indexLoader.js b/packages/mindplot/src/indexLoader.js index 3b9d72aa..2afe60c5 100644 --- a/packages/mindplot/src/indexLoader.js +++ b/packages/mindplot/src/indexLoader.js @@ -1,5 +1,5 @@ import { $notify } from '@wisemapping/core-js'; -import { buildDesigner, loadDesignerOptions } from './components/DesignerBuilder'; +import { buildDesigner, buildDefaultOptions } from './components/DesignerBuilder'; import RESTPersistenceManager from './components/RestPersistenceManager'; import PersistenceManager from './components/PersistenceManager'; @@ -13,7 +13,7 @@ global.lockSession = 111111; global.lockTimestamp = 11111; // Configure designer options ... -const options = loadDesignerOptions(); +const options = buildDefaultOptions(); if (!global.memoryPersistence && !global.readOnlyMode) { options.persistenceManager = new RESTPersistenceManager(