Fix compilation

This commit is contained in:
Paulo Gustavo Veiga 2021-12-23 11:41:39 -08:00
parent 0dec2cc4cb
commit 7bae385924
3 changed files with 9 additions and 6 deletions

View File

@ -8,6 +8,9 @@
"airbnb-base", "airbnb-base",
"plugin:cypress/recommended" "plugin:cypress/recommended"
], ],
"parserOptions": {
"ecmaVersion": 11
},
"globals": { "globals": {
// designer is a global currently used as a hack. Remove this when fixing the hack. // designer is a global currently used as a hack. Remove this when fixing the hack.
"designer": true "designer": true

View File

@ -56,7 +56,7 @@ export function buildDesigner(options) {
// Configure default persistence manager ... // Configure default persistence manager ...
const persistence = options.persistenceManager; const persistence = options.persistenceManager;
$assert(persistence, "persistence must be defined"); $assert(persistence, 'persistence must be defined');
PersistenceManager.init(persistence); PersistenceManager.init(persistence);
// Register toolbar event ... // Register toolbar event ...
@ -73,7 +73,7 @@ export function buildDesigner(options) {
} }
export function buildDefaultOptions(persistence, readOnly = false) { 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. // Set workspace screen size as default. In this way, resize issues are solved.
const containerSize = { const containerSize = {
height: Number.parseInt(window.screen.height, 10), height: Number.parseInt(window.screen.height, 10),
@ -85,7 +85,7 @@ export function buildDefaultOptions(persistence, readOnly = false) {
width: Number.parseInt(window.innerWidth, 10), width: Number.parseInt(window.innerWidth, 10),
}; };
return { return {
readOnly: readOnly, readOnly,
zoom: 0.85, zoom: 0.85,
saveOnLoad: true, saveOnLoad: true,
size: containerSize, size: containerSize,
@ -109,7 +109,7 @@ export async function loadOptions(jsonConf, persistence, readOnly = false) {
export function loadExample(exampleFn) { export function loadExample(exampleFn) {
$(() => { $(() => {
// Hack: load bootstrap first // eslint-disable-next-line import/no-extraneous-dependencies
import('@libraries/bootstrap').then(exampleFn); import('@libraries/bootstrap').then(exampleFn);
}); });
} }

View File

@ -1,5 +1,5 @@
import { $notify } from '@wisemapping/core-js'; import { $notify } from '@wisemapping/core-js';
import { buildDesigner, loadDesignerOptions } from './components/DesignerBuilder'; import { buildDesigner, buildDefaultOptions } from './components/DesignerBuilder';
import RESTPersistenceManager from './components/RestPersistenceManager'; import RESTPersistenceManager from './components/RestPersistenceManager';
import PersistenceManager from './components/PersistenceManager'; import PersistenceManager from './components/PersistenceManager';
@ -13,7 +13,7 @@ global.lockSession = 111111;
global.lockTimestamp = 11111; global.lockTimestamp = 11111;
// Configure designer options ... // Configure designer options ...
const options = loadDesignerOptions(); const options = buildDefaultOptions();
if (!global.memoryPersistence && !global.readOnlyMode) { if (!global.memoryPersistence && !global.readOnlyMode) {
options.persistenceManager = new RESTPersistenceManager( options.persistenceManager = new RESTPersistenceManager(