From e31aa2a547045c2b532668e4bf3e7faa3d8f5788 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 11 Apr 2022 15:40:49 -0300 Subject: [PATCH 01/51] Clean up code. --- packages/mindplot/src/indexLoader.ts | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/mindplot/src/indexLoader.ts b/packages/mindplot/src/indexLoader.ts index 7d8bd52a..ec6d48ed 100644 --- a/packages/mindplot/src/indexLoader.ts +++ b/packages/mindplot/src/indexLoader.ts @@ -17,7 +17,6 @@ */ import jquery from 'jquery'; import { - $notify, } from './components/widget/ToolbarNotifier'; import { buildDesigner, @@ -26,20 +25,19 @@ import PersistenceManager from './components/PersistenceManager'; import LocalStorageManager from './components/LocalStorageManager'; import DesignerOptionsBuilder from './components/DesignerOptionsBuilder'; +console.log('loading static mindmap in read-only'); + // This hack is required to initialize Bootstrap. In future, this should be removed. const globalAny: any = global; globalAny.jQuery = jquery; require('../../../libraries/bootstrap/js/bootstrap.min'); // Configure designer options ... -let persistence: PersistenceManager; -if (global.readOnly) { - const historyId = global.historyId ? `${global.historyId}/` : ''; - persistence = new LocalStorageManager( - `/c/restful/maps/{id}/${historyId}document/xml${!global.isAuth ? '-pub' : ''}`, - true, - ); -} +const historyId = global.historyId ? `${global.historyId}/` : ''; +const persistence: PersistenceManager = new LocalStorageManager( + `/c/restful/maps/{id}/${historyId}document/xml${!global.isAuth ? '-pub' : ''}`, + true, +); // Obtain map zoom from query param if it was specified... const params = new URLSearchParams(window.location.search.substring(1)); @@ -63,7 +61,3 @@ const designer = buildDesigner(options); const instance = PersistenceManager.getInstance(); const mindmap = instance.load(global.mapId); designer.loadMap(mindmap); - -if (global.mindmapLocked) { - $notify(global.mindmapLockedMsg); -} From f25ca27ca67bf3e7d0640b215381304a00b5c24b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 12 Apr 2022 08:49:03 -0300 Subject: [PATCH 02/51] Fix events tests. --- bitbucket-pipelines.yml | 1 + packages/mindplot/src/components/Events.ts | 2 +- .../test/playground/layout/FreeTestSuite.js | 536 ------------------ .../test/unit/layout/EventsTestSuite.test.js | 4 +- .../test/unit/layout/FreeTestSuite.test.js | 275 --------- 5 files changed, 4 insertions(+), 814 deletions(-) delete mode 100644 packages/mindplot/test/playground/layout/FreeTestSuite.js delete mode 100644 packages/mindplot/test/unit/layout/FreeTestSuite.test.js diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 68df3d68..f8860a36 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -21,6 +21,7 @@ pipelines: - yarn bootstrap - yarn build - yarn lint + - yarn test:unit # - yarn test artifacts: - packages/**/cypress/snapshots/**/__diff_output__/*.diff.png diff --git a/packages/mindplot/src/components/Events.ts b/packages/mindplot/src/components/Events.ts index 41cf1277..a8727a08 100644 --- a/packages/mindplot/src/components/Events.ts +++ b/packages/mindplot/src/components/Events.ts @@ -17,7 +17,7 @@ */ class Events { - private _handlerByType; + protected _handlerByType; constructor() { this._handlerByType = {}; diff --git a/packages/mindplot/test/playground/layout/FreeTestSuite.js b/packages/mindplot/test/playground/layout/FreeTestSuite.js deleted file mode 100644 index baa80b07..00000000 --- a/packages/mindplot/test/playground/layout/FreeTestSuite.js +++ /dev/null @@ -1,536 +0,0 @@ -/* - * Copyright [2021] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import $ from 'jquery'; -import { $assert } from '@wisemapping/core-js'; -import TestSuite from './TestSuite'; -import LayoutManager from '../../../src/components/layout/LayoutManager'; -import OriginalLayout from '../../../src/components/layout/OriginalLayout'; - -class FreeTestSuite extends TestSuite { - constructor() { - $('#freeTest').css('display', 'block'); - super(); - this.testFreePosition(); - this.testFreePredict(); - this.testReconnectFreeNode(); - this.testSiblingOverlapping(); - this.testRootNodeChildrenPositioning(); - this.testBalancedFreePredict(); - this.testFreeReorder(); - this.testFreeOverlap(); - } - - testFreePosition() { - console.log('testFreePosition:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position); - manager.addNode(2, TestSuite.NODE_SIZE, position); - manager.addNode(3, TestSuite.NODE_SIZE, position); - manager.addNode(4, TestSuite.NODE_SIZE, position); - manager.addNode(5, TestSuite.NODE_SIZE, position); - manager.addNode(6, TestSuite.NODE_SIZE, position); - manager.addNode(7, TestSuite.NODE_SIZE, position); - manager.addNode(8, TestSuite.NODE_SIZE, position); - manager.addNode(9, TestSuite.NODE_SIZE, position); - manager.addNode(10, TestSuite.NODE_SIZE, position); - manager.addNode(11, TestSuite.NODE_SIZE, position); - manager.addNode(12, TestSuite.NODE_SIZE, position); - manager.addNode(13, TestSuite.NODE_SIZE, position); - manager.addNode(14, TestSuite.NODE_SIZE, position); - manager.addNode(15, TestSuite.NODE_SIZE, position); - manager.addNode(16, TestSuite.NODE_SIZE, position); - manager.addNode(17, TestSuite.NODE_SIZE, position); - manager.addNode(18, TestSuite.NODE_SIZE, position); - manager.addNode(19, TestSuite.NODE_SIZE, position); - manager.addNode(20, TestSuite.NODE_SIZE, position); - manager.addNode(21, TestSuite.NODE_SIZE, position); - manager.addNode(22, TestSuite.NODE_SIZE, position); - - manager.connectNode(0, 1, 0).connectNode(0, 2, 1).connectNode(0, 3, 2).connectNode(0, 4, 3); - manager.connectNode(4, 21, 0).connectNode(4, 22, 0); - manager.connectNode(1, 5, 0); - manager.connectNode(5, 6, 0).connectNode(6, 8, 0).connectNode(8, 9, 0); - manager.connectNode(5, 7, 1).connectNode(7, 10, 0); - manager - .connectNode(3, 11, 0) - .connectNode(11, 14, 0) - .connectNode(14, 18, 0) - .connectNode(14, 19, 1) - .connectNode(14, 20, 2); - manager - .connectNode(3, 12, 1) - .connectNode(12, 15, 0) - .connectNode(12, 16, 1) - .connectNode(12, 17, 2); - manager.connectNode(3, 13, 2); - - manager.layout(); - manager.plot('testFreePosition1', { width: 1400, height: 600 }); - - console.log('\tmove node 12 to (300,30):'); - manager.moveNode(12, { x: 300, y: 30 }); - manager.layout(true); - manager.plot('testFreePosition2', { width: 1400, height: 600 }); - this._assertFreePosition(manager, 12, { x: 300, y: 30 }); - - console.log('\tmove node 13 to (340,180):'); - const node13Pos = { x: 340, y: 180 }; - manager.moveNode(13, node13Pos); - manager.layout(true); - manager.plot('testFreePosition3', { width: 1400, height: 600 }); - this._assertFreePosition(manager, 13, node13Pos); - - console.log('\tmove node 11 to (250,-50):'); - manager.moveNode(11, { x: 250, y: -50 }); - manager.layout(true); - manager.plot('testFreePosition4', { width: 1400, height: 600 }); - this._assertFreePosition(manager, 11, { x: 250, y: -50 }); - $assert( - manager.find(13).getPosition().x == node13Pos.x - && manager.find(13).getPosition().y == node13Pos.y, - "Node 13 shouldn't have moved", - ); - - console.log('\tmove node 7 to (350,-190):'); - manager.moveNode(7, { x: 350, y: -190 }); - manager.layout(true); - manager.plot('testFreePosition5', { width: 1400, height: 600 }); - this._assertFreePosition(manager, 7, { x: 350, y: -190 }); - - console.log('\tadd node 23 to 12:'); - manager.addNode(23, TestSuite.NODE_SIZE, position); - manager.connectNode(12, 23, 3); - manager.layout(true); - manager.plot('testFreePosition6', { width: 1400, height: 600 }); - this._assertFreePosition(manager, null, null); - - console.log('\tmove node 4 to (-300, 190):'); - manager.moveNode(4, { x: -300, y: 190 }); - manager.layout(true); - manager.plot('testFreePosition7', { width: 1400, height: 600 }); - this._assertFreePosition(manager, 4, { x: -300, y: 190 }); - - console.log('\tadd node 24 to 3:'); - manager.addNode(24, TestSuite.NODE_SIZE, position); - manager.connectNode(3, 24, 3); - manager.layout(true); - manager.plot('testFreePosition8', { width: 1400, height: 600 }); - this._assertFreePosition(manager, null, null); - - console.log('\tadd node 25 to 17:'); - manager.addNode(25, TestSuite.NODE_SIZE, position); - manager.connectNode(17, 25, 0); - manager.layout(true); - manager.plot('testFreePosition9', { width: 1400, height: 600 }); - this._assertFreePosition(manager, null, null); - - console.log('OK!\n\n'); - } - - testFreePredict() { - console.log('testFreePredict:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position); - manager.addNode(2, TestSuite.NODE_SIZE, position); - manager.addNode(3, TestSuite.NODE_SIZE, position); - manager.addNode(4, TestSuite.NODE_SIZE, position); - manager.addNode(5, TestSuite.NODE_SIZE, position); - manager.addNode(6, TestSuite.NODE_SIZE, position); - manager.addNode(7, TestSuite.NODE_SIZE, position); - manager.addNode(8, TestSuite.NODE_SIZE, position); - manager.addNode(9, TestSuite.NODE_SIZE, position); - manager.addNode(10, TestSuite.NODE_SIZE, position); - manager.addNode(11, TestSuite.NODE_SIZE, position); - - manager.connectNode(0, 1, 0); - manager.connectNode(0, 2, 1); - manager.connectNode(0, 3, 2); - manager.connectNode(3, 4, 0); - manager.connectNode(3, 5, 1); - manager.connectNode(3, 6, 2); - manager.connectNode(5, 7, 0); - manager.connectNode(5, 8, 1); - manager.connectNode(5, 11, 2); - manager.connectNode(2, 9, 0); - manager.connectNode(2, 10, 1); - - manager.layout(); - const graph = manager.plot('testFreePredict1', { width: 1000, height: 400 }); - - const pos1 = { x: 370, y: 80 }; - const predict1 = manager.predict(5, 11, pos1, true); - this._plotPrediction(graph, predict1); - $assert( - predict1.position.x == pos1.x && predict1.position.y == pos1.y, - 'free predict should return the same position', - ); - - const pos2 = { x: -200, y: 80 }; - const predict2 = manager.predict(0, 2, pos2, true); - this._plotPrediction(graph, predict2); - $assert( - predict2.position.x == pos2.x && predict2.position.y == pos2.y, - 'free predict should return the same position', - ); - - const pos3 = { x: 200, y: 30 }; - const node5 = manager.find(5); - const predict3 = manager.predict(3, 5, pos3, true); - this._plotPrediction(graph, predict3); - $assert( - predict3.position.x == node5.getPosition().x && predict3.position.y == pos3.y, - 'free predict should return the x-coordinate of the node', - ); - - const pos4 = { x: -100, y: 45 }; - const node10 = manager.find(10); - const predict4 = manager.predict(2, 10, pos4, true); - this._plotPrediction(graph, predict4); - $assert( - predict4.position.x == node10.getPosition().x && predict4.position.y == pos4.y, - 'free predict should return the x-coordinate of the node', - ); - - console.log('OK!\n\n'); - } - - testReconnectFreeNode() { - console.log('testReconnectFreeNode:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position); - manager.addNode(2, TestSuite.NODE_SIZE, position); - manager.addNode(3, TestSuite.NODE_SIZE, position); - manager.addNode(4, TestSuite.NODE_SIZE, position); - manager.addNode(5, TestSuite.NODE_SIZE, position); - manager.addNode(6, TestSuite.NODE_SIZE, position); - manager.addNode(7, TestSuite.NODE_SIZE, position); - manager.addNode(8, TestSuite.NODE_SIZE, position); - manager.addNode(9, TestSuite.NODE_SIZE, position); - manager.addNode(10, TestSuite.NODE_SIZE, position); - manager.addNode(11, TestSuite.NODE_SIZE, position); - - manager.connectNode(0, 1, 0); - manager.connectNode(0, 2, 1); - manager.connectNode(0, 3, 2); - manager.connectNode(3, 4, 0); - manager.connectNode(3, 5, 1); - manager.connectNode(3, 6, 2); - manager.connectNode(5, 7, 0); - manager.connectNode(5, 8, 1); - manager.connectNode(5, 11, 2); - manager.connectNode(2, 9, 0); - manager.connectNode(2, 10, 1); - - manager.layout(); - manager.plot('testReconnectFreeNode1', { width: 1000, height: 400 }); - - console.log('\tmove node 5'); - manager.moveNode(5, { x: 250, y: 30 }); - manager.layout(); - manager.plot('testReconnectFreeNode2', { width: 1000, height: 400 }); - this._assertFreePosition(manager, 5, { x: 250, y: 30 }); - - console.log('\treconnect node 5 to node 2'); - manager.disconnectNode(5); - manager.connectNode(2, 5, 2); - manager.layout(); - manager.plot('testReconnectFreeNode3', { width: 1000, height: 400 }); - $assert( - manager.find(5).getPosition().y > manager.find(10).getPosition().y - && manager.find(5).getPosition().x == manager.find(10).getPosition().x, - 'Node 5 is incorrectly positioned', - ); - $assert(manager.find(5).getOrder() == 2, 'Node 5 should have order 2'); - - console.log('\tmove node 8'); - manager.moveNode(8, { x: -370, y: 60 }); - manager.layout(); - manager.plot('testReconnectFreeNode4', { width: 1000, height: 400 }); - this._assertFreePosition(manager, 8, { x: -370, y: 60 }); - - console.log('\treconnect node 5 to node 10'); - manager.disconnectNode(5); - manager.connectNode(10, 5, 0); - manager.layout(); - manager.plot('testReconnectFreeNode5', { width: 1000, height: 400 }); - $assert( - manager.find(5).getPosition().y == manager.find(10).getPosition().y - && manager.find(5).getPosition().x < manager.find(10).getPosition().x, - 'Node 5 is incorrectly positioned', - ); - $assert(manager.find(5).getOrder() == 0, 'Node 5 should have order 0'); - - console.log('reconnect node 5 to node 3'); - manager.disconnectNode(5); - manager.connectNode(3, 5, 2); - manager.layout(); - manager.plot('testReconnectFreeNode6', { width: 1000, height: 400 }); - $assert( - manager.find(5).getPosition().y > manager.find(6).getPosition().y - && manager.find(5).getPosition().x == manager.find(6).getPosition().x, - 'Node 5 is incorrectly positioned', - ); - $assert(manager.find(5).getOrder() == 2, 'Node 5 should have order 2'); - - console.log('\tmove node 8'); - manager.moveNode(8, { x: 370, y: 30 }); - manager.layout(); - manager.plot('testReconnectFreeNode7', { width: 1000, height: 400 }); - this._assertFreePosition(manager, 8, { x: 370, y: 30 }); - - console.log('OK!\n\n'); - } - - testSiblingOverlapping() { - console.log('testSiblingOverlapping:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(1, 2, 0); - manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(1, 3, 1); - manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(1, 4, 2); - manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(1, 5, 3); - manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(1, 6, 4); - manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(1, 7, 5); - manager.addNode(8, TestSuite.NODE_SIZE, position).connectNode(1, 8, 6); - manager.addNode(9, TestSuite.NODE_SIZE, position).connectNode(0, 9, 4); - manager.layout(); - manager.plot('testSiblingOverlapping1', { width: 800, height: 600 }); - - console.log('\tmove node 2'); - manager.moveNode(2, { x: 250, y: -30 }); - manager.layout(); - manager.plot('testSiblingOverlapping2', { width: 800, height: 600 }); - this._assertFreePosition(manager, 2, { x: 250, y: -30 }); - - console.log('\tmove node 7'); - manager.moveNode(7, { x: 250, y: 100 }); - manager.layout(); - manager.plot('testSiblingOverlapping3', { width: 800, height: 600 }); - this._assertFreePosition(manager, 7, { x: 250, y: 100 }); - - console.log('OK!\n\n'); - } - - testRootNodeChildrenPositioning() { - console.log('testRootNodeChildrenPositioning:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 1); - manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(0, 3, 2); - manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(0, 4, 3); - manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(0, 5, 4); - manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(0, 6, 5); - manager.layout(); - manager.plot('testRootNodeChildrenPositioning1', { width: 800, height: 600 }); - - console.log('\tmove node 1'); - manager.moveNode(1, { x: 150, y: 0 }); - manager.layout(); - manager.plot('testRootNodeChildrenPositioning2', { width: 800, height: 600 }); - this._assertFreePosition(manager, 1, { x: 150, y: 0 }); - - console.log('\tmove node 4'); - manager.moveNode(4, { x: -140, y: 30 }); - manager.layout(); - manager.plot('testRootNodeChildrenPositioning3', { width: 800, height: 600 }); - this._assertFreePosition(manager, 4, { x: -140, y: 30 }); - - console.log('\tmove node 2'); - manager.moveNode(2, { x: -150, y: -50 }); - manager.layout(); - manager.plot('testRootNodeChildrenPositioning4', { width: 800, height: 600 }); - this._assertFreePosition(manager, 2, { x: -150, y: -50 }); - - // TODO(gb): fix this. It's not working - // console.log("\tmove node 6"); - // manager.moveNode(6, {x:-150, y:-50}); - // manager.layout(); - // manager.plot("testRootNodeChildrenPositioning5", {width:800, height:600}); - // this._assertFreePosition(manager, 6, {x:-150, y:-50}); - - console.log('OK!\n\n'); - } - - testBalancedFreePredict() { - console.log('testBalancedFreePredict:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.layout(); - const graph1 = manager.plot('testBalancedFreePredict1', { width: 800, height: 400 }); - - const predict1 = manager.predict(0, 1, { x: 70, y: 0 }, true); - this._plotPrediction(graph1, predict1); - $assert( - predict1.position.x == manager.find(1).getPosition().x, - 'Prediction x pos should be the same as node 1', - ); - - console.log('OK!\n\n'); - } - - testFreeReorder() { - console.log('testFreeReorder:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(1, 4, 0); - manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(1, 5, 1); - manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(1, 6, 2); - - manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 2); - manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(2, 7, 0); - manager.addNode(8, TestSuite.NODE_SIZE, position).connectNode(2, 8, 1); - manager.addNode(9, TestSuite.NODE_SIZE, position).connectNode(2, 9, 2); - manager.addNode(10, TestSuite.NODE_SIZE, position).connectNode(2, 10, 3); - - manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(0, 3, 4); - manager.addNode(11, TestSuite.NODE_SIZE, position).connectNode(3, 11, 0); - manager.addNode(12, TestSuite.NODE_SIZE, position).connectNode(3, 12, 1); - manager.addNode(13, TestSuite.NODE_SIZE, position).connectNode(3, 13, 2); - manager.addNode(14, TestSuite.NODE_SIZE, position).connectNode(3, 14, 3); - manager.addNode(15, TestSuite.NODE_SIZE, position).connectNode(3, 15, 4); - manager.addNode(16, TestSuite.NODE_SIZE, position).connectNode(3, 16, 5); - - manager.layout(); - manager.moveNode(14, { x: 270, y: -160 }); - manager.layout(); - manager.plot('testFreeReorder1', { width: 800, height: 1200 }); - $assert( - manager.find(14).getPosition().y > manager.find(10).getPosition().y, - 'Node 14 should be below branch 2', - ); - - console.log('OK!\n\n'); - } - - testFreeOverlap() { - console.log('testFreeOverlap:'); - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, TestSuite.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, TestSuite.NODE_SIZE, position).connectNode(0, 1, 0); - manager.addNode(4, TestSuite.NODE_SIZE, position).connectNode(1, 4, 0); - manager.addNode(5, TestSuite.NODE_SIZE, position).connectNode(1, 5, 1); - manager.addNode(6, TestSuite.NODE_SIZE, position).connectNode(1, 6, 2); - - manager.addNode(2, TestSuite.NODE_SIZE, position).connectNode(0, 2, 2); - manager.addNode(7, TestSuite.NODE_SIZE, position).connectNode(2, 7, 0); - manager.addNode(8, TestSuite.NODE_SIZE, position).connectNode(2, 8, 1); - manager.addNode(9, TestSuite.NODE_SIZE, position).connectNode(2, 9, 2); - manager.addNode(10, TestSuite.NODE_SIZE, position).connectNode(2, 10, 3); - - manager.addNode(3, TestSuite.NODE_SIZE, position).connectNode(0, 3, 4); - manager.addNode(11, TestSuite.NODE_SIZE, position).connectNode(3, 11, 0); - manager.addNode(12, TestSuite.NODE_SIZE, position).connectNode(3, 12, 1); - manager.addNode(13, TestSuite.NODE_SIZE, position).connectNode(3, 13, 2); - manager.addNode(14, TestSuite.NODE_SIZE, position).connectNode(3, 14, 3); - manager.addNode(15, TestSuite.NODE_SIZE, position).connectNode(3, 15, 4); - manager.addNode(16, TestSuite.NODE_SIZE, position).connectNode(3, 16, 5); - - manager.layout(); - manager.plot('testFreeOverlap1', { width: 800, height: 1200 }); - - manager.moveNode(14, { x: 270, y: 7 }); - manager.layout(); - manager.plot('testFreeOverlap2', { width: 800, height: 1200 }); - $assert( - manager.find(2).getPosition().y > manager.find(1).getPosition().y, - 'Branches 1 and 2 are overlapping', - ); - - console.log('OK!\n\n'); - } - - _assertFreePosition(manager, id, position) { - if (id != null && position.x != null && position.y != null) { - const node = manager.find(id); - $assert( - node.getPosition().x == position.x && node.getPosition().y == position.y, - `Freely moved node ${id - } is not left at free position (${position.x - },${position.y - }). ` - + `Actual position: (${node.getPosition().x - },${node.getPosition().y - })`, - ); - } - - const treeSet = manager._treeSet; - treeSet._rootNodes.forEach(((rootNode) => { - const heightById = rootNode.getSorter().computeChildrenIdByHeights(treeSet, rootNode); - this._assertBranchCollision(treeSet, rootNode, heightById); - })); - } - - _assertBranchCollision(treeSet, node, heightById) { - const children = treeSet.getChildren(node); - const childOfRootNode = treeSet._rootNodes.includes(node); - - children.forEach((child) => { - const height = heightById[child.getId()]; - let siblings = treeSet.getSiblings(child); - if (childOfRootNode) { - siblings = siblings.filter((sibling) => child.getOrder() % 2 === sibling.getOrder() % 2); - } - - siblings.forEach((sibling) => { - this._branchesOverlap(child, sibling, heightById); - }); - }); - - children.forEach(((child) => { - OriginalLayout._assertBranchCollision(treeSet, child, heightById); - })); - } - - static _branchesOverlap(branchA, branchB, heightById) { - const topA = branchA.getPosition().y - heightById[branchA.getId()] / 2; - const bottomA = branchA.getPosition().y + heightById[branchA.getId()] / 2; - const topB = branchB.getPosition().y - heightById[branchB.getId()] / 2; - const bottomB = branchB.getPosition().y + heightById[branchB.getId()] / 2; - - $assert( - topA >= bottomB || bottomA <= topB, - `Branches ${branchA.getId()} and ${branchB.getId()} overlap`, - ); - } -} - -export default FreeTestSuite; diff --git a/packages/mindplot/test/unit/layout/EventsTestSuite.test.js b/packages/mindplot/test/unit/layout/EventsTestSuite.test.js index 59215eb5..60f20446 100644 --- a/packages/mindplot/test/unit/layout/EventsTestSuite.test.js +++ b/packages/mindplot/test/unit/layout/EventsTestSuite.test.js @@ -3,11 +3,11 @@ import Events from '../../../src/components/Events'; describe('Events class suite', () => { class TestClass extends Events { getEvents() { - return this.$events; + return this._handlerByType; } removeEvents() { - this.$events = {}; + this._handlerByType = {}; } } diff --git a/packages/mindplot/test/unit/layout/FreeTestSuite.test.js b/packages/mindplot/test/unit/layout/FreeTestSuite.test.js deleted file mode 100644 index 5160de23..00000000 --- a/packages/mindplot/test/unit/layout/FreeTestSuite.test.js +++ /dev/null @@ -1,275 +0,0 @@ -import Constants from './Constants'; -import LayoutManager from '../../../src/components/layout/LayoutManager'; - -expect.extend({ - toNotBeBranchesOverlap(received, expected) { - const a = received; - const b = expected; - if (a[0] <= b[1] || a[1] >= b[0]) { - return { - message: 'Success', - pass: true, - }; - } - return { - message: 'Error', - pass: false, - }; - }, -}); - -describe('Free Test Suite', () => { - function branchesOverlap(branchA, branchB, heightById) { - const topA = branchA.getPosition().y - heightById[branchA.getId()] / 2; - const bottomA = branchA.getPosition().y + heightById[branchA.getId()] / 2; - const topB = branchB.getPosition().y - heightById[branchB.getId()] / 2; - const bottomB = branchB.getPosition().y + heightById[branchB.getId()] / 2; - - test('Not be Branches Overlap', () => { - expect([bottomA, topA]).toNotBeBranchesOverlap([bottomB, topB]); - }); - } - - function branchCollision(treeSet, node, heightById) { - const children = treeSet.getChildren(node); - const childOfRootNode = treeSet._rootNodes.includes(node); - - children.forEach(((child) => { - let siblings = treeSet.getSiblings(child); - if (childOfRootNode) { - siblings = siblings - .filter((sibling) => (child.getOrder() % 2) === (sibling.getOrder() % 2)); - } - - siblings.forEach(((sibling) => { - branchesOverlap(child, sibling, heightById); - })); - })); - - children.forEach((child) => { - branchCollision(treeSet, child, heightById); - }, this); - } - - describe('avoidCollisionTree1Test', () => { - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, Constants.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, Constants.NODE_SIZE, position); - manager.addNode(2, Constants.NODE_SIZE, position); - manager.addNode(3, Constants.NODE_SIZE, position); - manager.addNode(4, Constants.NODE_SIZE, position); - manager.addNode(5, Constants.NODE_SIZE, position); - manager.addNode(6, Constants.NODE_SIZE, position); - manager.addNode(7, Constants.NODE_SIZE, position); - manager.addNode(8, Constants.NODE_SIZE, position); - manager.addNode(9, Constants.NODE_SIZE, position); - manager.addNode(10, Constants.NODE_SIZE, position); - manager.addNode(11, Constants.NODE_SIZE, position); - manager.addNode(12, Constants.NODE_SIZE, position); - manager.addNode(13, Constants.NODE_SIZE, position); - manager.addNode(14, Constants.NODE_SIZE, position); - manager.addNode(15, Constants.NODE_SIZE, position); - manager.addNode(16, Constants.NODE_SIZE, position); - manager.addNode(17, Constants.NODE_SIZE, position); - manager.addNode(18, Constants.NODE_SIZE, position); - manager.addNode(19, Constants.NODE_SIZE, position); - manager.addNode(20, Constants.NODE_SIZE, position); - manager.addNode(21, Constants.NODE_SIZE, position); - manager.addNode(22, Constants.NODE_SIZE, position); - manager.addNode(23, Constants.NODE_SIZE, position); - manager.addNode(24, Constants.NODE_SIZE, position); - manager.addNode(25, Constants.NODE_SIZE, position); - manager.addNode(26, Constants.NODE_SIZE, position); - - manager.connectNode(0, 1, 0).connectNode(0, 2, 1).connectNode(0, 3, 2).connectNode(0, 4, 3); - manager.connectNode(4, 21, 0).connectNode(4, 22, 0); - manager.connectNode(1, 5, 0).connectNode(1, 23, 0).connectNode(23, 24, 0).connectNode(24, 25, 0) - .connectNode(24, 26, 0); - manager.connectNode(5, 6, 0).connectNode(6, 8, 0).connectNode(8, 9, 0); - manager.connectNode(5, 7, 1).connectNode(7, 10, 0); - manager.connectNode(3, 11, 0).connectNode(11, 14, 0) - .connectNode(14, 18, 0).connectNode(14, 19, 1) - .connectNode(14, 20, 2); - manager.connectNode(3, 12, 1).connectNode(12, 15, 0) - .connectNode(12, 16, 1).connectNode(12, 17, 2); - manager.connectNode(3, 13, 2); - - manager.layout(true); - - const treeSet = manager._treeSet; - treeSet._rootNodes.forEach(((rootNode) => { - const heightById = rootNode.getSorter().computeChildrenIdByHeights(treeSet, rootNode); - branchCollision(treeSet, rootNode, heightById); - })); - }); - - describe('avoidCollisionTree2Test - FAILING, commented test', () => { - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, Constants.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, Constants.NODE_SIZE, position); - manager.addNode(2, Constants.NODE_SIZE, position); - manager.addNode(3, Constants.NODE_SIZE, position); - manager.addNode(4, Constants.NODE_SIZE, position); - manager.addNode(5, Constants.NODE_SIZE, position); - manager.addNode(6, Constants.NODE_SIZE, position); - manager.addNode(7, Constants.NODE_SIZE, position); - manager.addNode(8, Constants.NODE_SIZE, position); - manager.addNode(9, Constants.NODE_SIZE, position); - manager.addNode(10, Constants.NODE_SIZE, position); - manager.addNode(11, Constants.NODE_SIZE, position); - manager.addNode(12, Constants.NODE_SIZE, position); - manager.addNode(13, Constants.NODE_SIZE, position); - manager.addNode(14, Constants.NODE_SIZE, position); - manager.addNode(15, Constants.NODE_SIZE, position); - manager.addNode(16, Constants.NODE_SIZE, position); - manager.addNode(17, Constants.NODE_SIZE, position); - manager.addNode(18, Constants.NODE_SIZE, position); - manager.addNode(19, Constants.NODE_SIZE, position); - manager.addNode(20, Constants.NODE_SIZE, position); - manager.addNode(21, Constants.NODE_SIZE, position); - manager.addNode(22, Constants.NODE_SIZE, position); - - manager.connectNode(0, 1, 0).connectNode(0, 2, 1).connectNode(0, 3, 2).connectNode(0, 4, 3); - manager.connectNode(4, 21, 0).connectNode(4, 22, 0); - manager.connectNode(1, 5, 0); - manager.connectNode(5, 6, 0).connectNode(6, 8, 0).connectNode(8, 9, 0); - manager.connectNode(5, 7, 1).connectNode(7, 10, 0); - manager.connectNode(3, 11, 0).connectNode(11, 14, 0) - .connectNode(14, 18, 0).connectNode(14, 19, 1) - .connectNode(14, 20, 2); - manager.connectNode(3, 12, 1).connectNode(12, 15, 0) - .connectNode(12, 16, 1).connectNode(12, 17, 2); - manager.connectNode(3, 13, 2); - - manager.layout(true); - - const treeSet = manager._treeSet; - treeSet._rootNodes.forEach(((rootNode) => { - const heightById = rootNode.getSorter().computeChildrenIdByHeights(treeSet, rootNode); - // FIXME: uncoment this line when bug is fixed, branchCollision(treeSet, rootNode, heightById); - })); - }); - - describe('predict test', () => { - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, Constants.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, Constants.NODE_SIZE, position); - manager.addNode(2, Constants.NODE_SIZE, position); - manager.addNode(3, Constants.NODE_SIZE, position); - manager.addNode(4, Constants.NODE_SIZE, position); - manager.addNode(5, Constants.NODE_SIZE, position); - manager.addNode(6, Constants.NODE_SIZE, position); - manager.addNode(7, Constants.NODE_SIZE, position); - manager.addNode(8, Constants.NODE_SIZE, position); - manager.addNode(9, Constants.NODE_SIZE, position); - manager.addNode(10, Constants.NODE_SIZE, position); - manager.addNode(11, Constants.NODE_SIZE, position); - - manager.connectNode(0, 1, 0); - manager.connectNode(0, 2, 1); - manager.connectNode(0, 3, 2); - manager.connectNode(3, 4, 0); - manager.connectNode(3, 5, 1); - manager.connectNode(3, 6, 2); - manager.connectNode(5, 7, 0); - manager.connectNode(5, 8, 1); - manager.connectNode(5, 11, 2); - manager.connectNode(2, 9, 0); - manager.connectNode(2, 10, 1); - - manager.layout(); - - test('Predict 1', () => { - const pos1 = { x: 370, y: 80 }; - const predict1 = manager.predict(5, 11, pos1, true); - expect(predict1.position.x).toEqual(pos1.x); - expect(predict1.position.y).toEqual(pos1.y); - }); - - test('Predict 2', () => { - const pos2 = { x: -200, y: 80 }; - const predict2 = manager.predict(0, 2, pos2, true); - expect(predict2.position.x).toEqual(pos2.x); - expect(predict2.position.y).toEqual(pos2.y); - }); - - test('Predict 3', () => { - const pos3 = { x: 200, y: 30 }; - const node5 = manager.find(5); - const predict3 = manager.predict(3, 5, pos3, true); - expect(predict3.position.x).toEqual(node5.getPosition().x); - expect(predict3.position.y).toEqual(pos3.y); - }); - - test('Predict 4', () => { - const pos4 = { x: -100, y: 45 }; - const node10 = manager.find(10); - const predict4 = manager.predict(2, 10, pos4, true); - expect(predict4.position.x).toEqual(node10.getPosition().x); - expect(predict4.position.y).toEqual(pos4.y); - }); - }); - - describe('reconnect node test', () => { - const position = { x: 0, y: 0 }; - const manager = new LayoutManager(0, Constants.ROOT_NODE_SIZE); - - // Prepare a sample graph ... - manager.addNode(1, Constants.NODE_SIZE, position); - manager.addNode(2, Constants.NODE_SIZE, position); - manager.addNode(3, Constants.NODE_SIZE, position); - manager.addNode(4, Constants.NODE_SIZE, position); - manager.addNode(5, Constants.NODE_SIZE, position); - manager.addNode(6, Constants.NODE_SIZE, position); - manager.addNode(7, Constants.NODE_SIZE, position); - manager.addNode(8, Constants.NODE_SIZE, position); - manager.addNode(9, Constants.NODE_SIZE, position); - manager.addNode(10, Constants.NODE_SIZE, position); - manager.addNode(11, Constants.NODE_SIZE, position); - - manager.connectNode(0, 1, 0); - manager.connectNode(0, 2, 1); - manager.connectNode(0, 3, 2); - manager.connectNode(3, 4, 0); - manager.connectNode(3, 5, 1); - manager.connectNode(3, 6, 2); - manager.connectNode(5, 7, 0); - manager.connectNode(5, 8, 1); - manager.connectNode(5, 11, 2); - manager.connectNode(2, 9, 0); - manager.connectNode(2, 10, 1); - manager.layout(); - - test('Reconnect Node', () => { - manager.disconnectNode(5); - manager.connectNode(2, 5, 2); - manager.layout(); - - expect(manager.find(5).getPosition().y).toBeGreaterThan(manager.find(10).getPosition().y); - expect(manager.find(5).getPosition().x).toEqual(manager.find(10).getPosition().x); - expect(manager.find(5).getOrder()).toEqual(2); - - manager.disconnectNode(5); - manager.connectNode(10, 5, 0); - manager.layout(); - - expect(manager.find(5).getPosition().y).toEqual(manager.find(10).getPosition().y); - expect(manager.find(5).getPosition().x).toBeLessThan(manager.find(10).getPosition().x); - expect(manager.find(5).getOrder()).toEqual(0); - - manager.disconnectNode(5); - manager.connectNode(3, 5, 2); - manager.layout(); - - expect(manager.find(5).getPosition().y).toBeGreaterThan(manager.find(6).getPosition().y); - expect(manager.find(5).getPosition().x).toEqual(manager.find(6).getPosition().x); - expect(manager.find(5).getOrder()).toEqual(2); - }); - }); -}); From 9da8b3634834e15833d1929708bdb9ecaf66272d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 12 Apr 2022 09:15:57 -0300 Subject: [PATCH 03/51] Improve German translation --- packages/webapp/lang/de.json | 152 +++++++++++----------- packages/webapp/src/compiled-lang/de.json | 152 +++++++++++----------- 2 files changed, 152 insertions(+), 152 deletions(-) diff --git a/packages/webapp/lang/de.json b/packages/webapp/lang/de.json index ef0081fd..1f4f9946 100644 --- a/packages/webapp/lang/de.json +++ b/packages/webapp/lang/de.json @@ -1,12 +1,12 @@ { "account.delete-warning": { - "defaultMessage": "Denken Sie daran, dass Sie keine von Ihnen erstellte Mindmap abrufen können. Alle Ihre Informationen werden gelöscht und können nicht wiederhergestellt werden." + "defaultMessage": "Denke daran, dass du keine von dir erstellten Mindmap mehr aufrufen kannst. Alle deine Informationen werden gelöscht und können nicht wiederhergestellt werden." }, "accountinfo.button": { "defaultMessage": "Akzeptieren" }, "accountinfo.email": { - "defaultMessage": "Email" + "defaultMessage": "E-Mail" }, "accountinfo.firstname": { "defaultMessage": "Vorname" @@ -21,13 +21,13 @@ "defaultMessage": "Abbrechen" }, "action.close-button": { - "defaultMessage": "Nah dran" + "defaultMessage": "Schließen" }, "action.delete": { "defaultMessage": "Löschen" }, "action.delete-description": { - "defaultMessage": "Gelöschte Mindmaps können nicht wiederhergestellt werden. Möchtest du fortfahren ?." + "defaultMessage": "Gelöschte Mindmaps können nicht wiederhergestellt werden. Möchtest du fortfahren?" }, "action.delete-title": { "defaultMessage": "Löschen" @@ -39,7 +39,7 @@ "defaultMessage": "Export" }, "action.history": { - "defaultMessage": "Geschichte" + "defaultMessage": "Historie" }, "action.history-description": { "defaultMessage": "Liste der in den letzten 90 Tagen eingeführten Änderungen." @@ -54,10 +54,10 @@ "defaultMessage": "Die Info" }, "action.label": { - "defaultMessage": "Etikett hinzufügen" + "defaultMessage": "Label hinzufügen" }, "action.new": { - "defaultMessage": "Neue Karte" + "defaultMessage": "Neue Mindmap" }, "action.open": { "defaultMessage": "Offen" @@ -87,7 +87,7 @@ "defaultMessage": "Kennwort bestätigen" }, "changepwd.description": { - "defaultMessage": "Bitte geben Sie das neue Passwort für Ihr Konto ein." + "defaultMessage": "Bitte gebe das neue Passwort für dein Konto ein." }, "changepwd.password": { "defaultMessage": "Passwort" @@ -99,40 +99,40 @@ "defaultMessage": "Kennwort ändern" }, "common.wait": { - "defaultMessage": "Warten Sie mal ..." + "defaultMessage": "Bitte warten ..." }, "create.button": { "defaultMessage": "Erstellen" }, "create.description": { - "defaultMessage": "Bitte geben Sie den neuen Kartennamen und die Beschreibung ein." + "defaultMessage": "Bitte gebe den Namen und die Beschreibung der neuen Mindmap ein." }, "create.title": { - "defaultMessage": "Erstellen Sie eine neue Mindmap." + "defaultMessage": "Erstelle eine neue Mindmap." }, "deletem.title": { - "defaultMessage": "Alle ausgewählten Karten werden gelöscht" + "defaultMessage": "Alle ausgewählten Mindmaps werden gelöscht" }, "duplicate.title": { - "defaultMessage": "Duplikat" + "defaultMessage": "Kopie" }, "expired.description": { - "defaultMessage": "Ihre aktuelle Sitzung ist abgelaufen. Bitte melden Sie sich an und versuchen Sie es erneut." + "defaultMessage": "Deine aktuelle Sitzung ist abgelaufen. Bitte melde dich an und versuche es erneut." }, "expired.title": { "defaultMessage": "Deine Sitzung ist abgelaufen" }, "export.desc": { - "defaultMessage": "Exportieren Sie diese Karte im gewünschten Format und verwenden Sie sie in Ihren Präsentationen oder teilen Sie sie per E-Mail" + "defaultMessage": "Exportiere diese Mindmap im gewünschten Format und verwende sie in deinen Präsentationen oder teile sie per E-Mail" }, "export.document": { - "defaultMessage": "Mindmap-Tools: Exportieren Sie Ihre Mindmap in Mindmap-Tool-Formate von Drittanbietern" + "defaultMessage": "Mindmap-Tools: Exportiere deine Mindmap in Mindmap-Tool-Formate von Drittanbietern" }, "export.document-label": { - "defaultMessage": "Dokument: Exportieren Sie Ihre Mindmap in ein eigenständiges Dokument, das Sie teilen können" + "defaultMessage": "Dokument: Exportiere deine Mindmap in ein eigenständiges Dokument, das du teilen kannst" }, "export.image": { - "defaultMessage": "Bild: Erhalten Sie eine grafische Darstellung Ihrer Karte mit allen Farben und Formen." + "defaultMessage": "Bild: Erhalte eine grafische Darstellung deiner Mindmap mit allen Farben und Formen." }, "export.title": { "defaultMessage": "Export" @@ -147,7 +147,7 @@ "defaultMessage": "Kontaktiere uns" }, "footer.faq": { - "defaultMessage": "FAQ." + "defaultMessage": "FAQ" }, "footer.faqandhelp": { "defaultMessage": "Hilfe & FAQ" @@ -165,10 +165,10 @@ "defaultMessage": "Allgemeine Geschäftsbedingungen" }, "forgot.desc": { - "defaultMessage": "Wir senden Ihnen eine E-Mail, um Ihr Passwort zurückzusetzen." + "defaultMessage": "Wir senden dir eine E-Mail, um dein Passwort zurückzusetzen." }, "forgot.email": { - "defaultMessage": "Email" + "defaultMessage": "E-Mail" }, "forgot.page-title": { "defaultMessage": "Passwort vergessen | WiseMapping" @@ -177,10 +177,10 @@ "defaultMessage": "Wiederherstellungslink senden" }, "forgot.success.desc": { - "defaultMessage": "Wir haben Ihnen eine E-Mail gesendet, mit der Sie Ihr Passwort zurücksetzen können. Sie sollten es in den nächsten Minuten erhalten." + "defaultMessage": "Wir haben dir eine E-Mail gesendet, mit der du dein Passwort zurücksetzen kannst. Du solltest sie in den nächsten Minuten erhalten." }, "forgot.success.title": { - "defaultMessage": "Ihr temporäres Passwort wurde gesendet." + "defaultMessage": "Dein temporäres Passwort wurde gesendet." }, "forgot.title": { "defaultMessage": "Setze dein Passwort zurück" @@ -189,10 +189,10 @@ "defaultMessage": "Passwort wiederhergestellt | WiseMapping" }, "header.donthaveaccount": { - "defaultMessage": "Sie haben kein Konto?" + "defaultMessage": "Du hast noch kein Konto?" }, "header.haveaccount": { - "defaultMessage": "Sie haben bereits ein Konto?" + "defaultMessage": "Du hast bereits ein Konto?" }, "help.support": { "defaultMessage": "Unterstützung" @@ -204,16 +204,16 @@ "defaultMessage": "Erstellen" }, "import.description": { - "defaultMessage": "Sie können Karten von WiseMapping oder Freemind in Ihre Kartenliste importieren. Wählen Sie die Datei aus, die Sie importieren möchten." + "defaultMessage": "Du kannst Mindmaps von WiseMapping oder Freemind importieren. Wähle die Datei aus, die du importieren möchtest." }, "import.title": { - "defaultMessage": "Importieren Sie vorhandene Mindmaps" + "defaultMessage": "Importiere vorhandene Mindmaps" }, "import.error-file": { "defaultMessage": "Import fehlgeschlagen: {error}" }, "info.basic-info": { - "defaultMessage": "Basisinformation" + "defaultMessage": "Allgemeine Informationen" }, "info.button": { "defaultMessage": "Akzeptieren" @@ -222,13 +222,13 @@ "defaultMessage": "Erstellungsdatum" }, "info.creator": { - "defaultMessage": "Schöpfer" + "defaultMessage": "Besitzer" }, "info.description": { "defaultMessage": "Beschreibung" }, "info.description-msg": { - "defaultMessage": "Indem Sie die Karte veröffentlichen, machen Sie sie für jeden im Internet sichtbar." + "defaultMessage": "Indem du die Mindmap veröffentlichen, machst du sie für jeden im Internet sichtbar." }, "info.modified-time": { "defaultMessage": "Zuletzt geändertes Datum" @@ -246,10 +246,10 @@ "defaultMessage": "Teilen" }, "info.starred": { - "defaultMessage": "Markiert" + "defaultMessage": "Favoriten" }, "info.title": { - "defaultMessage": "Die Info" + "defaultMessage": "Informationen" }, "language.change": { "defaultMessage": "Sprache ändern" @@ -258,19 +258,19 @@ "defaultMessage": "Hilfe beim Übersetzen" }, "login.desc": { - "defaultMessage": "Melde dich in deinem Konto an" + "defaultMessage": "Melde dich mit deinem Konto an" }, "login.email": { - "defaultMessage": "Email" + "defaultMessage": "E-Mail" }, "login.error": { "defaultMessage": "Die eingegebene E-Mail-Adresse oder das eingegebene Passwort ist ungültig." }, "login.forgotpwd": { - "defaultMessage": "Passwort vergessen ?" + "defaultMessage": "Passwort vergessen?" }, "login.hsqldbcofig": { - "defaultMessage": "Obwohl HSQLDB während der Installation standardmäßig mit WiseMapping gebündelt wird, empfehlen wir diese Datenbank nicht für den Produktionseinsatz. Bitte erwägen Sie stattdessen die Verwendung von MySQL 5.7. Weitere Informationen zur Konfiguration von MySQL finden Sie hier", + "defaultMessage": "Obwohl HSQLDB während der Installation standardmäßig mit WiseMapping installiert wird, empfehlen wir diese Datenbank nicht für den Produktionseinsatz. Bitte erwäge stattdessen die Verwendung von MySQL 5.7. Weitere Informationen zur Konfiguration von MySQL findest du hier", "description": "Fehlende Produktionsdatenbank konfiguriert" }, "login.page-title": { @@ -280,7 +280,7 @@ "defaultMessage": "Passwort" }, "login.remberme": { - "defaultMessage": "Behalte mich in Erinnerung" + "defaultMessage": "Angemeldet bleiben?" }, "login.signin": { "defaultMessage": "Anmelden" @@ -292,13 +292,13 @@ "defaultMessage": "Herzlich willkommen" }, "login.userinactive": { - "defaultMessage": "Entschuldigung, Ihr Konto wurde noch nicht aktiviert. Sie erhalten eine Benachrichtigungs-E-Mail, wenn es aktiv wird. Bleiben Sie dran!." + "defaultMessage": "Entschuldigung, dein Konto wurde noch nicht aktiviert. Du erhältst eine Benachrichtigungs-E-Mail, wenn es aktiv wird." }, "map.creator": { - "defaultMessage": "Schöpfer" + "defaultMessage": "Besitzer" }, "map.delete-selected": { - "defaultMessage": "Ausgewählte löschen" + "defaultMessage": "Auswahl löschen" }, "map.last-update": { "defaultMessage": "Letztes Update" @@ -310,13 +310,13 @@ "defaultMessage": "Name" }, "map.tooltip-add": { - "defaultMessage": "Label zu Ausgewähltem hinzufügen" + "defaultMessage": "Label zur Auswahl hinzufügen" }, "maps.choose-file": { - "defaultMessage": "Wählen Sie eine Datei" + "defaultMessage": "Wähle eine Datei" }, "maps.create-tooltip": { - "defaultMessage": "Erstellen Sie eine neue Mindmap" + "defaultMessage": "Erstelle eine neue Mindmap" }, "maps.empty-result": { "defaultMessage": "Kein passender Datensatz mit den aktuellen Filterkriterien gefunden." @@ -337,19 +337,19 @@ "defaultMessage": "Alle" }, "maps.nav-onwned": { - "defaultMessage": "Besitz" + "defaultMessage": "Eigene" }, "maps.nav-public": { - "defaultMessage": "Allgemein" + "defaultMessage": "Freigegeben" }, "maps.nav-shared": { - "defaultMessage": "Mit mir geteilt" + "defaultMessage": "Geteilt" }, "maps.nav-starred": { - "defaultMessage": "Markiert" + "defaultMessage": "Favoriten" }, "maps.page-title": { - "defaultMessage": "Meine Karten | WiseMapping" + "defaultMessage": "Meine Mindmaps | WiseMapping" }, "maps.revert": { "defaultMessage": "Zurückkehren" @@ -361,10 +361,10 @@ "defaultMessage": "Zur Ausgabe geöffnet" }, "maps.tooltip-starred": { - "defaultMessage": "Markiert" + "defaultMessage": "Favoriten" }, "maps.view": { - "defaultMessage": "Aussicht" + "defaultMessage": "Ansicht" }, "menu.account": { "defaultMessage": "Konto" @@ -373,28 +373,28 @@ "defaultMessage": "Kennwort ändern" }, "menu.signout": { - "defaultMessage": "Austragen" + "defaultMessage": "Abmelden" }, "publish.button": { "defaultMessage": "Akzeptieren" }, "publish.checkbox": { - "defaultMessage": "Aktivieren Sie die öffentliche Freigabe" + "defaultMessage": "Aktiviere die öffentliche Freigabe" }, "publish.description": { - "defaultMessage": "Indem Sie die Karte veröffentlichen, machen Sie sie für jeden im Internet sichtbar." + "defaultMessage": "Indem du die Mindmap veröffentlichst, machst du sie für jeden im Internet sichtbar." }, "publish.embedded": { "defaultMessage": "Eingebettet" }, "publish.embedded-msg": { - "defaultMessage": "Kopieren Sie dieses Code-Snippet, um es in Ihren Blog oder Ihre Seite einzubetten:" + "defaultMessage": "Kopiere dieses Code-Snippet, um es in deinem Blog oder deiner Webseite einzubetten:" }, "publish.public-url": { "defaultMessage": "Öffentliche URL" }, "publish.public-url-msg": { - "defaultMessage": "Kopieren Sie den folgenden Link und fügen Sie ihn ein, um Ihre Karte mit Kollegen zu teilen:" + "defaultMessage": "Kopiere den folgenden Link und gebe ihn weiter, um deine Mindmap mit Kollegen zu teilen:" }, "publish.title": { "defaultMessage": "Veröffentlichen" @@ -403,10 +403,10 @@ "defaultMessage": "Registrierung erfolgreich | WiseMapping" }, "registration.desc": { - "defaultMessage": "Die Anmeldung ist kostenlos und nehmen Sie sich einen Moment Zeit" + "defaultMessage": "Nimm dir einen Moment Zeit. Die Anmeldung ist kostenlos." }, "registration.email": { - "defaultMessage": "Email" + "defaultMessage": "E-Mail" }, "registration.firstname": { "defaultMessage": "Vorname" @@ -421,31 +421,31 @@ "defaultMessage": "Registrieren" }, "registration.success.desc": { - "defaultMessage": "Klicken Sie unten auf die Schaltfläche „Anmelden“ und beginnen Sie mit der Erstellung von Mindmaps." + "defaultMessage": "Klicke unten auf die Schaltfläche „Anmelden“ und beginne mit der Erstellung von Mindmaps." }, "registration.termandconditions": { - "defaultMessage": "Kundenbedingungen: Bitte überprüfen Sie die WiseMapping-Kontoinformationen, die Sie oben eingegeben haben, und sehen Sie sich die Kundenbedingungen hier an. Indem Sie unten auf „Registrieren“ klicken, stimmen Sie den obigen Kundenbedingungen und der Datenschutzrichtlinie zu" + "defaultMessage": "Kundenbedingungen: Bitte überprüfe die WiseMapping-Kontoinformationen, die du oben eingegeben hast und lese dir die Kundenbedingungen hier durch. Indem du unten auf „Registrieren“ klickst, stimmst du den obigen Kundenbedingungen und der Datenschutzrichtlinie zu." }, "registration.title": { "defaultMessage": "Mitglied werden" }, "rename.description": { - "defaultMessage": "Bitte geben Sie den neuen Kartennamen und die Beschreibung ein." + "defaultMessage": "Bitte gebe den Namen und die Beschreibung der Mindmap ein." }, "rename.title": { "defaultMessage": "Umbenennen" }, "resetpassword.success.title": { - "defaultMessage": "Ihr Konto wurde erfolgreich erstellt" + "defaultMessage": "Dein Konto wurde erfolgreich erstellt" }, "role.editor": { - "defaultMessage": "Editor" + "defaultMessage": "Bearbeiter" }, "role.owner": { "defaultMessage": "Besitzer" }, "role.viewer": { - "defaultMessage": "Zuschauer" + "defaultMessage": "Betrachter" }, "share.add-button": { "defaultMessage": "Hinzufügen" @@ -460,13 +460,13 @@ "defaultMessage": "Kann ansehen" }, "share.delete": { - "defaultMessage": "Mitbearbeiter löschen" + "defaultMessage": "Bearbeiter entfernen" }, "share.delete-description": { - "defaultMessage": "Laden Sie Personen ein, mit Ihnen bei der Erstellung Ihrer Midnmap zusammenzuarbeiten. Sie werden per E-Mail benachrichtigt." + "defaultMessage": "Lade Personen ein, die bei der Erstellung deiner Midnmap mitarbeiten. Sie werden per E-Mail benachrichtigt." }, "share.delete-title": { - "defaultMessage": "Teilen Sie mit Menschen" + "defaultMessage": "Teile deine Mindmap" }, "share.message": { "defaultMessage": "Nachricht" @@ -475,42 +475,42 @@ "defaultMessage": "Dieser Ausgabebereich zeigt einige der Mindmap-Editor-Funktionen!" }, "editor.try-welcome-description": { - "defaultMessage": "Melden Sie sich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen." + "defaultMessage": "Melde dich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen." }, "accountinfo.deleteaccount": { "defaultMessage": "Konto löschen" }, "label.add-button": { - "defaultMessage": "Etikett hinzufügen" + "defaultMessage": "Label hinzufügen" }, "label.add-for": { - "defaultMessage": "Beschriftungen für Karten bearbeiten:" + "defaultMessage": "Labels für Mindmap bearbeiten:" }, "label.add-placeholder": { "defaultMessage": "Titel des Labels" }, "label.change-color": { - "defaultMessage": "Etikettenfarbe ändern" + "defaultMessage": "Labelfarbe ändern" }, "label.delete-description": { - "defaultMessage": "gelöscht, einschließlich der Zuordnungen zu allen vorhandenen Karten. Möchtest du fortfahren?" + "defaultMessage": "Löschen des Labels, einschließlich der Zuordnungen zu allen vorhandenen Mindmaps. Möchtest du fortfahren?" }, "label.delete-title": { - "defaultMessage": "Bestätigen Sie das Löschen des Labels" + "defaultMessage": "Bestätige das Löschen des Labels" }, "label.description": { - "defaultMessage": "Verwenden Sie Labels, um Ihre Karten zu organisieren." + "defaultMessage": "Verwende Labels, um deine Mindmaps zu organisieren." }, "label.title": { - "defaultMessage": "Etikett hinzufügen" + "defaultMessage": "Label hinzufügen" }, "footer.donations": { "defaultMessage": "Spenden" }, "footer.support": { - "defaultMessage": "Unterstützt" + "defaultMessage": "Support" }, "footer.team": { - "defaultMessage": "Ausrüstung" + "defaultMessage": "Team" } } \ No newline at end of file diff --git a/packages/webapp/src/compiled-lang/de.json b/packages/webapp/src/compiled-lang/de.json index b49b10a8..250a88ea 100644 --- a/packages/webapp/src/compiled-lang/de.json +++ b/packages/webapp/src/compiled-lang/de.json @@ -2,7 +2,7 @@ "account.delete-warning": [ { "type": 0, - "value": "Denken Sie daran, dass Sie keine von Ihnen erstellte Mindmap abrufen können. Alle Ihre Informationen werden gelöscht und können nicht wiederhergestellt werden." + "value": "Denke daran, dass du keine von dir erstellten Mindmap mehr aufrufen kannst. Alle deine Informationen werden gelöscht und können nicht wiederhergestellt werden." } ], "accountinfo.button": [ @@ -20,7 +20,7 @@ "accountinfo.email": [ { "type": 0, - "value": "Email" + "value": "E-Mail" } ], "accountinfo.firstname": [ @@ -50,7 +50,7 @@ "action.close-button": [ { "type": 0, - "value": "Nah dran" + "value": "Schließen" } ], "action.delete": [ @@ -62,7 +62,7 @@ "action.delete-description": [ { "type": 0, - "value": "Gelöschte Mindmaps können nicht wiederhergestellt werden. Möchtest du fortfahren ?." + "value": "Gelöschte Mindmaps können nicht wiederhergestellt werden. Möchtest du fortfahren?" } ], "action.delete-title": [ @@ -86,7 +86,7 @@ "action.history": [ { "type": 0, - "value": "Geschichte" + "value": "Historie" } ], "action.history-description": [ @@ -116,13 +116,13 @@ "action.label": [ { "type": 0, - "value": "Etikett hinzufügen" + "value": "Label hinzufügen" } ], "action.new": [ { "type": 0, - "value": "Neue Karte" + "value": "Neue Mindmap" } ], "action.open": [ @@ -182,7 +182,7 @@ "changepwd.description": [ { "type": 0, - "value": "Bitte geben Sie das neue Passwort für Ihr Konto ein." + "value": "Bitte gebe das neue Passwort für dein Konto ein." } ], "changepwd.password": [ @@ -206,7 +206,7 @@ "common.wait": [ { "type": 0, - "value": "Warten Sie mal ..." + "value": "Bitte warten ..." } ], "create.button": [ @@ -218,25 +218,25 @@ "create.description": [ { "type": 0, - "value": "Bitte geben Sie den neuen Kartennamen und die Beschreibung ein." + "value": "Bitte gebe den Namen und die Beschreibung der neuen Mindmap ein." } ], "create.title": [ { "type": 0, - "value": "Erstellen Sie eine neue Mindmap." + "value": "Erstelle eine neue Mindmap." } ], "deletem.title": [ { "type": 0, - "value": "Alle ausgewählten Karten werden gelöscht" + "value": "Alle ausgewählten Mindmaps werden gelöscht" } ], "duplicate.title": [ { "type": 0, - "value": "Duplikat" + "value": "Kopie" } ], "editor.try-welcome": [ @@ -248,13 +248,13 @@ "editor.try-welcome-description": [ { "type": 0, - "value": "Melden Sie sich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen." + "value": "Melde dich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen." } ], "expired.description": [ { "type": 0, - "value": "Ihre aktuelle Sitzung ist abgelaufen. Bitte melden Sie sich an und versuchen Sie es erneut." + "value": "Deine aktuelle Sitzung ist abgelaufen. Bitte melde dich an und versuche es erneut." } ], "expired.title": [ @@ -266,25 +266,25 @@ "export.desc": [ { "type": 0, - "value": "Exportieren Sie diese Karte im gewünschten Format und verwenden Sie sie in Ihren Präsentationen oder teilen Sie sie per E-Mail" + "value": "Exportiere diese Mindmap im gewünschten Format und verwende sie in deinen Präsentationen oder teile sie per E-Mail" } ], "export.document": [ { "type": 0, - "value": "Mindmap-Tools: Exportieren Sie Ihre Mindmap in Mindmap-Tool-Formate von Drittanbietern" + "value": "Mindmap-Tools: Exportiere deine Mindmap in Mindmap-Tool-Formate von Drittanbietern" } ], "export.document-label": [ { "type": 0, - "value": "Dokument: Exportieren Sie Ihre Mindmap in ein eigenständiges Dokument, das Sie teilen können" + "value": "Dokument: Exportiere deine Mindmap in ein eigenständiges Dokument, das du teilen kannst" } ], "export.image": [ { "type": 0, - "value": "Bild: Erhalten Sie eine grafische Darstellung Ihrer Karte mit allen Farben und Formen." + "value": "Bild: Erhalte eine grafische Darstellung deiner Mindmap mit allen Farben und Formen." } ], "export.title": [ @@ -320,7 +320,7 @@ "footer.faq": [ { "type": 0, - "value": "FAQ." + "value": "FAQ" } ], "footer.faqandhelp": [ @@ -350,13 +350,13 @@ "footer.support": [ { "type": 0, - "value": "Unterstützt" + "value": "Support" } ], "footer.team": [ { "type": 0, - "value": "Ausrüstung" + "value": "Team" } ], "footer.termsandconditions": [ @@ -368,13 +368,13 @@ "forgot.desc": [ { "type": 0, - "value": "Wir senden Ihnen eine E-Mail, um Ihr Passwort zurückzusetzen." + "value": "Wir senden dir eine E-Mail, um dein Passwort zurückzusetzen." } ], "forgot.email": [ { "type": 0, - "value": "Email" + "value": "E-Mail" } ], "forgot.page-title": [ @@ -392,13 +392,13 @@ "forgot.success.desc": [ { "type": 0, - "value": "Wir haben Ihnen eine E-Mail gesendet, mit der Sie Ihr Passwort zurücksetzen können. Sie sollten es in den nächsten Minuten erhalten." + "value": "Wir haben dir eine E-Mail gesendet, mit der du dein Passwort zurücksetzen kannst. Du solltest sie in den nächsten Minuten erhalten." } ], "forgot.success.title": [ { "type": 0, - "value": "Ihr temporäres Passwort wurde gesendet." + "value": "Dein temporäres Passwort wurde gesendet." } ], "forgot.title": [ @@ -416,13 +416,13 @@ "header.donthaveaccount": [ { "type": 0, - "value": "Sie haben kein Konto?" + "value": "Du hast noch kein Konto?" } ], "header.haveaccount": [ { "type": 0, - "value": "Sie haben bereits ein Konto?" + "value": "Du hast bereits ein Konto?" } ], "help.support": [ @@ -446,7 +446,7 @@ "import.description": [ { "type": 0, - "value": "Sie können Karten von WiseMapping oder Freemind in Ihre Kartenliste importieren. Wählen Sie die Datei aus, die Sie importieren möchten." + "value": "Du kannst Mindmaps von WiseMapping oder Freemind importieren. Wähle die Datei aus, die du importieren möchtest." } ], "import.error-file": [ @@ -462,13 +462,13 @@ "import.title": [ { "type": 0, - "value": "Importieren Sie vorhandene Mindmaps" + "value": "Importiere vorhandene Mindmaps" } ], "info.basic-info": [ { "type": 0, - "value": "Basisinformation" + "value": "Allgemeine Informationen" } ], "info.button": [ @@ -486,7 +486,7 @@ "info.creator": [ { "type": 0, - "value": "Schöpfer" + "value": "Besitzer" } ], "info.description": [ @@ -498,7 +498,7 @@ "info.description-msg": [ { "type": 0, - "value": "Indem Sie die Karte veröffentlichen, machen Sie sie für jeden im Internet sichtbar." + "value": "Indem du die Mindmap veröffentlichen, machst du sie für jeden im Internet sichtbar." } ], "info.modified-time": [ @@ -534,25 +534,25 @@ "info.starred": [ { "type": 0, - "value": "Markiert" + "value": "Favoriten" } ], "info.title": [ { "type": 0, - "value": "Die Info" + "value": "Informationen" } ], "label.add-button": [ { "type": 0, - "value": "Etikett hinzufügen" + "value": "Label hinzufügen" } ], "label.add-for": [ { "type": 0, - "value": "Beschriftungen für Karten bearbeiten:" + "value": "Labels für Mindmap bearbeiten:" } ], "label.add-placeholder": [ @@ -564,31 +564,31 @@ "label.change-color": [ { "type": 0, - "value": "Etikettenfarbe ändern" + "value": "Labelfarbe ändern" } ], "label.delete-description": [ { "type": 0, - "value": "gelöscht, einschließlich der Zuordnungen zu allen vorhandenen Karten. Möchtest du fortfahren?" + "value": "Löschen des Labels, einschließlich der Zuordnungen zu allen vorhandenen Mindmaps. Möchtest du fortfahren?" } ], "label.delete-title": [ { "type": 0, - "value": "Bestätigen Sie das Löschen des Labels" + "value": "Bestätige das Löschen des Labels" } ], "label.description": [ { "type": 0, - "value": "Verwenden Sie Labels, um Ihre Karten zu organisieren." + "value": "Verwende Labels, um deine Mindmaps zu organisieren." } ], "label.title": [ { "type": 0, - "value": "Etikett hinzufügen" + "value": "Label hinzufügen" } ], "language.change": [ @@ -606,13 +606,13 @@ "login.desc": [ { "type": 0, - "value": "Melde dich in deinem Konto an" + "value": "Melde dich mit deinem Konto an" } ], "login.email": [ { "type": 0, - "value": "Email" + "value": "E-Mail" } ], "login.error": [ @@ -624,13 +624,13 @@ "login.forgotpwd": [ { "type": 0, - "value": "Passwort vergessen ?" + "value": "Passwort vergessen?" } ], "login.hsqldbcofig": [ { "type": 0, - "value": "Obwohl HSQLDB während der Installation standardmäßig mit WiseMapping gebündelt wird, empfehlen wir diese Datenbank nicht für den Produktionseinsatz. Bitte erwägen Sie stattdessen die Verwendung von MySQL 5.7. Weitere Informationen zur Konfiguration von MySQL finden Sie hier" + "value": "Obwohl HSQLDB während der Installation standardmäßig mit WiseMapping installiert wird, empfehlen wir diese Datenbank nicht für den Produktionseinsatz. Bitte erwäge stattdessen die Verwendung von MySQL 5.7. Weitere Informationen zur Konfiguration von MySQL findest du hier" } ], "login.page-title": [ @@ -648,7 +648,7 @@ "login.remberme": [ { "type": 0, - "value": "Behalte mich in Erinnerung" + "value": "Angemeldet bleiben?" } ], "login.signin": [ @@ -672,19 +672,19 @@ "login.userinactive": [ { "type": 0, - "value": "Entschuldigung, Ihr Konto wurde noch nicht aktiviert. Sie erhalten eine Benachrichtigungs-E-Mail, wenn es aktiv wird. Bleiben Sie dran!." + "value": "Entschuldigung, dein Konto wurde noch nicht aktiviert. Du erhältst eine Benachrichtigungs-E-Mail, wenn es aktiv wird." } ], "map.creator": [ { "type": 0, - "value": "Schöpfer" + "value": "Besitzer" } ], "map.delete-selected": [ { "type": 0, - "value": "Ausgewählte löschen" + "value": "Auswahl löschen" } ], "map.last-update": [ @@ -708,19 +708,19 @@ "map.tooltip-add": [ { "type": 0, - "value": "Label zu Ausgewähltem hinzufügen" + "value": "Label zur Auswahl hinzufügen" } ], "maps.choose-file": [ { "type": 0, - "value": "Wählen Sie eine Datei" + "value": "Wähle eine Datei" } ], "maps.create-tooltip": [ { "type": 0, - "value": "Erstellen Sie eine neue Mindmap" + "value": "Erstelle eine neue Mindmap" } ], "maps.empty-result": [ @@ -774,31 +774,31 @@ "maps.nav-onwned": [ { "type": 0, - "value": "Besitz" + "value": "Eigene" } ], "maps.nav-public": [ { "type": 0, - "value": "Allgemein" + "value": "Freigegeben" } ], "maps.nav-shared": [ { "type": 0, - "value": "Mit mir geteilt" + "value": "Geteilt" } ], "maps.nav-starred": [ { "type": 0, - "value": "Markiert" + "value": "Favoriten" } ], "maps.page-title": [ { "type": 0, - "value": "Meine Karten | WiseMapping" + "value": "Meine Mindmaps | WiseMapping" } ], "maps.revert": [ @@ -822,13 +822,13 @@ "maps.tooltip-starred": [ { "type": 0, - "value": "Markiert" + "value": "Favoriten" } ], "maps.view": [ { "type": 0, - "value": "Aussicht" + "value": "Ansicht" } ], "menu.account": [ @@ -846,7 +846,7 @@ "menu.signout": [ { "type": 0, - "value": "Austragen" + "value": "Abmelden" } ], "publish.button": [ @@ -858,13 +858,13 @@ "publish.checkbox": [ { "type": 0, - "value": "Aktivieren Sie die öffentliche Freigabe" + "value": "Aktiviere die öffentliche Freigabe" } ], "publish.description": [ { "type": 0, - "value": "Indem Sie die Karte veröffentlichen, machen Sie sie für jeden im Internet sichtbar." + "value": "Indem du die Mindmap veröffentlichst, machst du sie für jeden im Internet sichtbar." } ], "publish.embedded": [ @@ -876,7 +876,7 @@ "publish.embedded-msg": [ { "type": 0, - "value": "Kopieren Sie dieses Code-Snippet, um es in Ihren Blog oder Ihre Seite einzubetten:" + "value": "Kopiere dieses Code-Snippet, um es in deinem Blog oder deiner Webseite einzubetten:" } ], "publish.public-url": [ @@ -888,7 +888,7 @@ "publish.public-url-msg": [ { "type": 0, - "value": "Kopieren Sie den folgenden Link und fügen Sie ihn ein, um Ihre Karte mit Kollegen zu teilen:" + "value": "Kopiere den folgenden Link und gebe ihn weiter, um deine Mindmap mit Kollegen zu teilen:" } ], "publish.title": [ @@ -906,13 +906,13 @@ "registration.desc": [ { "type": 0, - "value": "Die Anmeldung ist kostenlos und nehmen Sie sich einen Moment Zeit" + "value": "Nimm dir einen Moment Zeit. Die Anmeldung ist kostenlos." } ], "registration.email": [ { "type": 0, - "value": "Email" + "value": "E-Mail" } ], "registration.firstname": [ @@ -942,13 +942,13 @@ "registration.success.desc": [ { "type": 0, - "value": "Klicken Sie unten auf die Schaltfläche „Anmelden“ und beginnen Sie mit der Erstellung von Mindmaps." + "value": "Klicke unten auf die Schaltfläche „Anmelden“ und beginne mit der Erstellung von Mindmaps." } ], "registration.termandconditions": [ { "type": 0, - "value": "Kundenbedingungen: Bitte überprüfen Sie die WiseMapping-Kontoinformationen, die Sie oben eingegeben haben, und sehen Sie sich die Kundenbedingungen hier an. Indem Sie unten auf „Registrieren“ klicken, stimmen Sie den obigen Kundenbedingungen und der Datenschutzrichtlinie zu" + "value": "Kundenbedingungen: Bitte überprüfe die WiseMapping-Kontoinformationen, die du oben eingegeben hast und lese dir die Kundenbedingungen hier durch. Indem du unten auf „Registrieren“ klickst, stimmst du den obigen Kundenbedingungen und der Datenschutzrichtlinie zu." } ], "registration.title": [ @@ -960,7 +960,7 @@ "rename.description": [ { "type": 0, - "value": "Bitte geben Sie den neuen Kartennamen und die Beschreibung ein." + "value": "Bitte gebe den Namen und die Beschreibung der Mindmap ein." } ], "rename.title": [ @@ -972,13 +972,13 @@ "resetpassword.success.title": [ { "type": 0, - "value": "Ihr Konto wurde erfolgreich erstellt" + "value": "Dein Konto wurde erfolgreich erstellt" } ], "role.editor": [ { "type": 0, - "value": "Editor" + "value": "Bearbeiter" } ], "role.owner": [ @@ -990,7 +990,7 @@ "role.viewer": [ { "type": 0, - "value": "Zuschauer" + "value": "Betrachter" } ], "share.add-button": [ @@ -1020,19 +1020,19 @@ "share.delete": [ { "type": 0, - "value": "Mitbearbeiter löschen" + "value": "Bearbeiter entfernen" } ], "share.delete-description": [ { "type": 0, - "value": "Laden Sie Personen ein, mit Ihnen bei der Erstellung Ihrer Midnmap zusammenzuarbeiten. Sie werden per E-Mail benachrichtigt." + "value": "Lade Personen ein, die bei der Erstellung deiner Midnmap mitarbeiten. Sie werden per E-Mail benachrichtigt." } ], "share.delete-title": [ { "type": 0, - "value": "Teilen Sie mit Menschen" + "value": "Teile deine Mindmap" } ], "share.message": [ From 4c71ccd25a729b50ed7a5159f977e0d1d8bfed84 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 12 Apr 2022 12:40:14 -0300 Subject: [PATCH 04/51] Improve german translation --- .../classes/menu/KeyboardShortcutDialog.js | 54 +++++++------- packages/editor/src/classes/menu/Menu.ts | 12 +-- packages/mindplot/src/components/lang/de.js | 74 ++++++++++--------- packages/mindplot/src/components/lang/en.js | 6 ++ packages/mindplot/src/components/lang/es.js | 6 ++ packages/mindplot/src/components/lang/fr.js | 6 ++ packages/mindplot/src/components/lang/ru.js | 6 ++ packages/mindplot/src/components/lang/zh.js | 7 +- 8 files changed, 103 insertions(+), 68 deletions(-) diff --git a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js index dda05336..4bb4acb4 100644 --- a/packages/editor/src/classes/menu/KeyboardShortcutDialog.js +++ b/packages/editor/src/classes/menu/KeyboardShortcutDialog.js @@ -42,8 +42,8 @@ class KeyboardShortcutDialog extends BootstrapDialog { ${$msg('SAVE_CHANGES')} - Ctrl + s - ⌘ + s + ${$msg('CTRL')} + S + ⌘ + S ${$msg('CREATE_SIBLING_TOPIC')} @@ -52,12 +52,12 @@ class KeyboardShortcutDialog extends BootstrapDialog { ${$msg('CREATE_CHILD_TOPIC')} - Insert / Tab + ${$msg('K_INSERT')} / Tab ⌘ + Enter / Tab ${$msg('DELETE_TOPIC')} - Delete + ${$msg('K_DELETE')} Delete @@ -67,19 +67,19 @@ class KeyboardShortcutDialog extends BootstrapDialog { ${$msg('MULTIPLE_LINES')} - Ctrl + Enter + ${$msg('CTRL')} + Enter ⌘ + Enter ${$msg('COPY_AND_PASTE_TOPICS')} - Ctrl + c/Ctrl + v - ⌘ + c/⌘ + v + ${$msg('CTRL')} + C / ${$msg('CTRL')} + V + ⌘ + C / ⌘ + V ${$msg('COLLAPSE_CHILDREN')} - Space bar - Space bar + ${$msg('SPACE_BAR')} + ${$msg('SPACE_BAR')} ${$msg('TOPIC_NAVIGATION')} @@ -88,23 +88,23 @@ class KeyboardShortcutDialog extends BootstrapDialog { ${$msg('SELECT_MULTIPLE_NODES')} - Ctrl + Mouse Click - Ctrl + Mouse Click + ${$msg('CTRL')} + ${$msg('MOUSE_CLICK')} + ${$msg('CTRL')} + ${$msg('MOUSE_CLICK')} ${$msg('UNDO_EDITION')} - Ctrl + z - ⌘ + z + ${$msg('CTRL')} + Z + ⌘ + Z ${$msg('REDO_EDITION')} - Ctrl + Shift + z - ⌘ + Shift + z + ${$msg('CTRL')} + Shift + Z + ⌘ + Shift + Z ${$msg('SELECT_ALL_TOPIC')} - Ctrl + a - ⌘ + a + ${$msg('CTRL')} + A + ⌘ + A ${$msg('CANCEL_TEXT_CHANGES')} @@ -113,28 +113,28 @@ class KeyboardShortcutDialog extends BootstrapDialog { ${$msg('DESELECT_ALL_TOPIC')} - Ctrl + Shift + a - ⌘ + Shift + a + ${$msg('CTRL')} + Shift + A + ⌘ + Shift + A ${$msg('CHANGE_TEXT_ITALIC')} - Ctrl + i - ⌘ + i + ${$msg('CTRL')} + I + ⌘ + I ${$msg('CHANGE_TEXT_BOLD')} - Ctrl + b - ⌘ + b + ${$msg('CTRL')} + B + ⌘ + B ${$msg('TOPIC_NOTE')} - Ctrl + k - ⌘ + k + ${$msg('CTRL')} + K + ⌘ + K ${$msg('TOPIC_LINK')} - Ctrl + l - ⌘ + l + ${$msg('CTRL')} + L + ⌘ + L diff --git a/packages/editor/src/classes/menu/Menu.ts b/packages/editor/src/classes/menu/Menu.ts index 57b7a035..40d20db3 100644 --- a/packages/editor/src/classes/menu/Menu.ts +++ b/packages/editor/src/classes/menu/Menu.ts @@ -211,7 +211,7 @@ class Menu extends IMenu { if (undoButton) { undoButton.disable(); } - Menu._registerTooltip('undoEdition', $msg('UNDO')); + Menu._registerTooltip('undoEdition', $msg('UNDO'), $msg('CTRL') + ' + Z'); const redoButton = this._addButton('redoEdition', false, false, () => { designer.redo(); @@ -219,7 +219,7 @@ class Menu extends IMenu { if (redoButton) { redoButton.disable(); } - Menu._registerTooltip('redoEdition', $msg('REDO')); + Menu._registerTooltip('redoEdition', $msg('REDO'), $msg('CTRL') + ' + Shift + Z'); if (redoButton && undoButton) { designer.addEvent('modelUpdate', (event) => { @@ -244,7 +244,7 @@ class Menu extends IMenu { this._addButton('deleteTopic', true, true, () => { designer.deleteSelectedEntities(); }); - Menu._registerTooltip('deleteTopic', $msg('TOPIC_DELETE')); + Menu._registerTooltip('deleteTopic', $msg('TOPIC_DELETE'), $msg('K_DELETE')); this._addButton('topicLink', true, false, () => { designer.addLink(); @@ -264,12 +264,12 @@ class Menu extends IMenu { this._addButton('fontBold', true, false, () => { designer.changeFontWeight(); }); - Menu._registerTooltip('fontBold', $msg('FONT_BOLD'), 'meta+B'); + Menu._registerTooltip('fontBold', $msg('FONT_BOLD'), $msg('CTRL') + ' + B'); this._addButton('fontItalic', true, false, () => { designer.changeFontStyle(); }); - Menu._registerTooltip('fontItalic', $msg('FONT_ITALIC'), 'meta+I'); + Menu._registerTooltip('fontItalic', $msg('FONT_ITALIC'), $msg('CTRL') + ' + I'); if (!readOnly) { @@ -279,7 +279,7 @@ class Menu extends IMenu { () => { this.save(saveElem, designer, true); }); - Menu._registerTooltip('save', $msg('SAVE')); + Menu._registerTooltip('save', $msg('SAVE'), $msg('CTRL') + ' + S'); // Register unload save ... window.addEventListener('beforeunload', () => { diff --git a/packages/mindplot/src/components/lang/de.js b/packages/mindplot/src/components/lang/de.js index c2cb2111..535e673c 100644 --- a/packages/mindplot/src/components/lang/de.js +++ b/packages/mindplot/src/components/lang/de.js @@ -10,28 +10,28 @@ const DE = { TOPIC_COLOR: 'Themenfarbe', TOPIC_BORDER_COLOR: 'Thema Randfarbe', TOPIC_NOTE: 'Notiz hinzufügen', - FONT_FAMILY: 'Schrifttyp', + FONT_FAMILY: 'Schriftart', FONT_SIZE: 'Schriftgröße', - FONT_BOLD: 'Fette Schrift', - FONT_ITALIC: 'Kursive Schrift', - UNDO: 'Rückgängig machen', + FONT_BOLD: 'Fett', + FONT_ITALIC: 'Kursiv', + UNDO: 'Rückgängig', REDO: 'Wiederholen', INSERT: 'Einfügen', - SAVE: 'Sichern', + SAVE: 'Speichern', NOTE: 'Notiz', ADD_TOPIC: 'Thema hinzufügen', - LOADING: 'Laden ...', + LOADING: 'Lädt ...', EXPORT: 'Exportieren', PRINT: 'Drucken', - PUBLISH: 'Publizieren', + PUBLISH: 'Veröffentlichen', COLLABORATE: 'Mitbenutzen', HISTORY: 'Historie', DISCARD_CHANGES: 'Änderungen verwerfen', FONT_COLOR: 'Textfarbe', - SAVING: 'Sichern ...', - SAVE_COMPLETE: 'Sichern abgeschlossen', + SAVING: 'Speichern ...', + SAVE_COMPLETE: 'Speichern abgeschlossen', ZOOM_IN_ERROR: 'Zoom zu hoch.', - ZOOM_ERROR: 'Es kann nicht weiter vergrößert bzw. verkelinert werden.', + ZOOM_ERROR: 'Es kann nicht weiter vergrößert bzw. verkleinert werden.', ONLY_ONE_TOPIC_MUST_BE_SELECTED: 'Thema konnte nicht angelegt werden. Bitte wählen Sie nur ein Thema aus.', ONE_TOPIC_MUST_BE_SELECTED: 'Thema konnte nicht angelegt werden. Es muss ein Thema ausgewählt werden.', ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE: 'Kinderknoten können nicht eingefaltet werden. Es muss ein Thema ausgewäht werden.', @@ -41,45 +41,51 @@ const DE = { SUB_TOPIC: 'Unterthema', ISOLATED_TOPIC: 'Isoliertes Thema', CENTRAL_TOPIC: 'Zentrales Thema', - SHORTCUTS: 'Tastaturkürzel', + SHORTCUTS: 'Tastenkombinationen', ENTITIES_COULD_NOT_BE_DELETED: 'Konnte das Thema oder die Beziehung nicht löschen. Es muss mindest ein Eintrag ausgewählt sein.', AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED: 'Es muss mindestens ein Thema ausgewählt sein.', CLIPBOARD_IS_EMPTY: 'Es gibt nichts zu kopieren. Die Zwischenablage ist leer.', CENTRAL_TOPIC_CAN_NOT_BE_DELETED: 'Das zentrale Thema kann nicht gelöscht werden.', RELATIONSHIP_COULD_NOT_BE_CREATED: 'Die Beziehung konnte nicht angelegt werden. Es muss erst ein Vater-Thema ausgewählt werden, um die Beziehung herzustellen.', SELECTION_COPIED_TO_CLIPBOARD: 'Themen in der Zwischenablage', - WRITE_YOUR_TEXT_HERE: 'Schreiben Sie ihre Notiz hier ...', + WRITE_YOUR_TEXT_HERE: 'Schreibe deine Notiz hier ...', REMOVE: 'Entfernen', ACCEPT: 'Akzeptieren', CANCEL: 'Abbrechen', LINK: 'Verbindung', OPEN_LINK: 'Öffne URL', - SESSION_EXPIRED: 'Ihre Sitzung ist abgelaufen, bitte melden Sie sich erneut an.', + SESSION_EXPIRED: 'Deine Sitzung ist abgelaufen, bitte melde dich erneut an.', URL_ERROR: 'URL nicht gültig', ACTION: 'Aktion', - CREATE_SIBLING_TOPIC: 'Erzeuge ein Schwester Thema', - CREATE_CHILD_TOPIC: 'Eryeuge ein Unterthema', - DELETE_TOPIC: 'Lösche Thema', - EDIT_TOPIC_TEXT: 'Editiere Thematext', - JUST_START_TYPING: 'Einfach mit der Eingabe beginnen', + CREATE_SIBLING_TOPIC: 'Thema hinzufügen', + CREATE_CHILD_TOPIC: 'Unterthema hinzufügen', + DELETE_TOPIC: 'Thema löschen', + EDIT_TOPIC_TEXT: 'Thematext bearbeiten', + JUST_START_TYPING: 'Eingabe beginnen', CANCEL_TEXT_CHANGES: 'Textänderungen abbrechen', - TOPIC_NAVIGATION: 'Themen Navigation', + TOPIC_NAVIGATION: 'Navigieren', ARROW_KEYS: 'Pfeiltasten', - SELECT_MULTIPLE_NODES: 'Wähle mehrfache Knoten aus', - UNDO_EDITION: 'Änderungen rückgängig machen', - REDO_EDITION: 'Änderung nochmal ausführen', - SELECT_ALL_TOPIC: 'Wähle alle Themen aus', - CHANGE_TEXT_BOLD: 'Ändere Text in fette Schrift', - SAVE_CHANGES: 'Änderungen sichern', - CHANGE_TEXT_ITALIC: 'Ändere Text in kursive Schrift', - DESELECT_ALL_TOPIC: 'Deselektiere alle Themen', - COLLAPSE_CHILDREN: 'Kindknoten zusammenklappen', - KEYBOARD_SHORTCUTS_MSG: 'Tastenkürzel helfen Zeit zu sparen und erlauben die Arbeit nur mit der Tatstatur, s.d. Sie niemals die Hand von der Tastatur nehmen müßen, um die Maus zu bedienen.', - COPY_AND_PASTE_TOPICS: 'Kopieren und Einsetzen von Themen', - MULTIPLE_LINES: 'Füge mehrer Textzeilen hinzu', - BACK_TO_MAP_LIST: 'Zurück zur Kartenliste', - KEYBOARD_SHOTCUTS: 'Tastaturkürzel', - PASTE_URL_HERE: 'Fügen Sie hier die gewünschte URL-Adresse ein:', + SELECT_MULTIPLE_NODES: 'Wähle Themen markieren', + UNDO_EDITION: 'Rückgängig', + REDO_EDITION: 'Wiederholen', + SELECT_ALL_TOPIC: 'Alles markieren', + CHANGE_TEXT_BOLD: 'Fett', + SAVE_CHANGES: 'Speichern', + CHANGE_TEXT_ITALIC: 'Kursiv', + DESELECT_ALL_TOPIC: 'Markierung aufheben', + COLLAPSE_CHILDREN: 'Unterthemen einklappen', + KEYBOARD_SHORTCUTS_MSG: 'Tastenkombinationen helfen Zeit zu sparen und erlauben die Arbeit nur mit der Tatstatur, s.d. du niemals die Hand von der Tastatur nehmen musst, um die Maus zu bedienen.', + COPY_AND_PASTE_TOPICS: 'Thema kopieren / einfügen', + MULTIPLE_LINES: 'Absatz hinzufügen', + BACK_TO_MAP_LIST: 'Zurück zur Mindmap Liste', + KEYBOARD_SHOTCUTS: 'Tastenkombinationen', + PASTE_URL_HERE: 'Füge hier die gewünschte URL ein:', + CTRL: 'Strg', + SPACE_BAR: 'Leertaste', + K_INSERT: 'Insert', + MOUSE_CLICK: 'Mausklick', + K_DELETE: 'Entf', + BACKSPACE: 'Backspace', }; export default DE; diff --git a/packages/mindplot/src/components/lang/en.js b/packages/mindplot/src/components/lang/en.js index 0ebe385f..cbd11e1b 100644 --- a/packages/mindplot/src/components/lang/en.js +++ b/packages/mindplot/src/components/lang/en.js @@ -80,6 +80,12 @@ const EN = { BACK_TO_MAP_LIST: 'Back to Maps List', KEYBOARD_SHOTCUTS: 'Keyboard Shorcuts', PASTE_URL_HERE: 'Paste your url address here:', + CTRL: 'Ctrl', + SPACE_BAR: 'Space Bar', + K_INSERT: 'Insert', + MOUSE_CLICK: 'Mouse Click', + K_DELETE: 'Delete', + BACKSPACE: 'Backspace', }; export default EN; diff --git a/packages/mindplot/src/components/lang/es.js b/packages/mindplot/src/components/lang/es.js index 87f65188..9121f1c0 100644 --- a/packages/mindplot/src/components/lang/es.js +++ b/packages/mindplot/src/components/lang/es.js @@ -80,6 +80,12 @@ const ES = { BACK_TO_MAP_LIST: 'Volver a la lista de mapas', KEYBOARD_SHOTCUTS: 'Métodos abreviados de teclado', PASTE_URL_HERE: 'Copie la URL que desea aca:', + CTRL: 'Ctrl', + SPACE_BAR: 'Space Bar', + K_INSERT: 'Insert', + MOUSE_CLICK: 'Mouse Click', + K_DELETE: 'Delete', + BACKSPACE: 'Backspace', }; export default ES; diff --git a/packages/mindplot/src/components/lang/fr.js b/packages/mindplot/src/components/lang/fr.js index f8a90848..eec4972e 100644 --- a/packages/mindplot/src/components/lang/fr.js +++ b/packages/mindplot/src/components/lang/fr.js @@ -80,6 +80,12 @@ const FR = { BACK_TO_MAP_LIST: 'Retour à la liste des cartes', KEYBOARD_SHOTCUTS: 'Raccourcis clavier', PASTE_URL_HERE: 'Collez l\'adresse URL souhaitée ici :', + CTRL: 'Ctrl', + SPACE_BAR: 'Space Bar', + K_INSERT: 'Insert', + MOUSE_CLICK: 'Mouse Click', + K_DELETE: 'Delete', + BACKSPACE: 'Backspace', }; export default FR; diff --git a/packages/mindplot/src/components/lang/ru.js b/packages/mindplot/src/components/lang/ru.js index d962cd26..d1106d33 100644 --- a/packages/mindplot/src/components/lang/ru.js +++ b/packages/mindplot/src/components/lang/ru.js @@ -80,6 +80,12 @@ const EN = { BACK_TO_MAP_LIST: 'Back to Maps List', KEYBOARD_SHOTCUTS: 'Keyboard Shorcuts', PASTE_URL_HERE: 'Вставьте нужный URL-адрес здесь:', + CTRL: 'Ctrl', + SPACE_BAR: 'Space Bar', + K_INSERT: 'Insert', + MOUSE_CLICK: 'Mouse Click', + K_DELETE: 'Delete', + BACKSPACE: 'Backspace', }; export default EN; diff --git a/packages/mindplot/src/components/lang/zh.js b/packages/mindplot/src/components/lang/zh.js index ef262eef..2cc5bb20 100644 --- a/packages/mindplot/src/components/lang/zh.js +++ b/packages/mindplot/src/components/lang/zh.js @@ -80,7 +80,12 @@ const ZH = { BACK_TO_MAP_LIST: '回到脑图列表', KEYBOARD_SHOTCUTS: '键盘快捷键', PASTE_URL_HERE: '在此处粘贴所需的 URL 地址:', - + CTRL: 'Ctrl', + SPACE_BAR: 'Space Bar', + K_INSERT: 'Insert', + MOUSE_CLICK: 'Mouse Click', + K_DELETE: 'Delete', + BACKSPACE: 'Backspace', }; export default ZH; From 5e68914686420bcf4894a2b77bf884879689e2d9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 13 Apr 2022 19:17:37 -0300 Subject: [PATCH 05/51] Add base configuration support for publish dialog --- packages/mindplot/src/components/lang/fr.js | 2 +- packages/webapp/src/classes/app-config/index.ts | 9 +++++++-- .../maps-page/action-dispatcher/publish-dialog/index.tsx | 9 +++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/mindplot/src/components/lang/fr.js b/packages/mindplot/src/components/lang/fr.js index eec4972e..cf9a3e44 100644 --- a/packages/mindplot/src/components/lang/fr.js +++ b/packages/mindplot/src/components/lang/fr.js @@ -83,7 +83,7 @@ const FR = { CTRL: 'Ctrl', SPACE_BAR: 'Space Bar', K_INSERT: 'Insert', - MOUSE_CLICK: 'Mouse Click', + MOUSE_CLICK: 'Clic de Souris', K_DELETE: 'Delete', BACKSPACE: 'Backspace', }; diff --git a/packages/webapp/src/classes/app-config/index.ts b/packages/webapp/src/classes/app-config/index.ts index 9c9be003..19a65d2b 100644 --- a/packages/webapp/src/classes/app-config/index.ts +++ b/packages/webapp/src/classes/app-config/index.ts @@ -15,7 +15,7 @@ interface Config { class _AppConfig { private defaultInstance: Config = { - apiBaseUrl: '/', + apiBaseUrl: `${window.location.protocol}//${window.location.hostname}:${window.location.port}`, clientType: 'mock', recaptcha2Enabled: true, recaptcha2SiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI' @@ -57,7 +57,7 @@ class _AppConfig { const config = this.getInstance(); let result: Client; if (config.clientType == 'rest') { - result = new RestClient(config.apiBaseUrl); + result = new RestClient(this.getBaseUrl()); console.log('Service using rest client. ' + JSON.stringify(config)); } else { console.log('Warning:Service using mockservice client'); @@ -67,6 +67,11 @@ class _AppConfig { // Wrap with a cache decorator ... return new CacheDecoratorClient(result); } + + getBaseUrl(): string { + const config = this.getInstance(); + return config.apiBaseUrl; + } } const AppConfig = new _AppConfig(); diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx index 365ca3d3..6a509d81 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/publish-dialog/index.tsx @@ -18,6 +18,7 @@ import TabPanel from '@mui/lab/TabPanel'; import Typography from '@mui/material/Typography'; import TextareaAutosize from '@mui/material/TextareaAutosize'; import Box from '@mui/system/Box'; +import AppConfig from '../../../../classes/app-config'; const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement => { const { map } = fetchMapById(mapId); @@ -28,7 +29,6 @@ const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen const [activeTab, setActiveTab] = React.useState('1'); const queryClient = useQueryClient(); const intl = useIntl(); - const classes = useStyles(); const mutation = useMutation( (model: boolean) => { @@ -60,10 +60,11 @@ const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen setModel(checked); }; - const handleTabChange = (event, newValue) => { + const handleTabChange = (event: React.ChangeEvent, newValue: string) => { setActiveTab(newValue); }; + const baseUrl = AppConfig.getBaseUrl(); return (
`} + defaultValue={``} /> @@ -145,7 +146,7 @@ const PublishDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElemen readOnly={true} spellCheck={false} maxRows={1} - defaultValue={`https://app.wisemapping.com/c/maps/${mapId}/public`} + defaultValue={`${baseUrl}/c/maps/${mapId}/public`} /> From c0487a3a25fdacd880eabc2ae0eb755734a31119 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 13 Apr 2022 19:20:23 -0300 Subject: [PATCH 06/51] v5.0.13 --- packages/mindplot/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index 30285421..f741ddcc 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/mindplot", - "version": "5.0.12", + "version": "5.0.13", "description": "WiseMapping - Mindplot Canvas Library", "homepage": "http://www.wisemapping.org/", "directories": { From f63e2821f08d61308cd1537a86eae79e888a7a21 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 13 Apr 2022 19:20:46 -0300 Subject: [PATCH 07/51] v5.0.13 --- packages/webapp/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 62013aa5..c69d4be3 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/webapp", - "version": "5.0.12", + "version": "5.0.13", "main": "app.jsx", "scripts": { "start": "webpack serve --config webpack.dev.js ", From e7b617e6560b7f948814b71a4bfb25d62ca44018 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 13 Apr 2022 19:21:19 -0300 Subject: [PATCH 08/51] v5.0.14 --- packages/webapp/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/package.json b/packages/webapp/package.json index c69d4be3..2f4c621a 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/webapp", - "version": "5.0.13", + "version": "5.0.14", "main": "app.jsx", "scripts": { "start": "webpack serve --config webpack.dev.js ", From 6f4827599a81a2c5315cc7c09bd396767134964d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 13 Apr 2022 19:22:50 -0300 Subject: [PATCH 09/51] Complete new release. --- packages/mindplot/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index f741ddcc..216fdb38 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/mindplot", - "version": "5.0.13", + "version": "5.0.14", "description": "WiseMapping - Mindplot Canvas Library", "homepage": "http://www.wisemapping.org/", "directories": { From 4c6a222850858e071de757f39422ffbd2aad5f02 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 24 May 2022 19:14:28 -0700 Subject: [PATCH 10/51] Remove failed import tests --- .../unit/import/TextImporterTestSuite.test.ts | 2 +- .../input/SQLServerTip-version-0.8.0.mm | 20 ---- .../input/anonymity_on_the_edge-invalid.mm | 112 ------------------ .../test/unit/import/input/bug2-invalid.mm | 49 -------- 4 files changed, 1 insertion(+), 182 deletions(-) delete mode 100644 packages/mindplot/test/unit/import/input/SQLServerTip-version-0.8.0.mm delete mode 100644 packages/mindplot/test/unit/import/input/anonymity_on_the_edge-invalid.mm delete mode 100644 packages/mindplot/test/unit/import/input/bug2-invalid.mm diff --git a/packages/mindplot/test/unit/import/TextImporterTestSuite.test.ts b/packages/mindplot/test/unit/import/TextImporterTestSuite.test.ts index 12446a6f..4b2c943c 100644 --- a/packages/mindplot/test/unit/import/TextImporterTestSuite.test.ts +++ b/packages/mindplot/test/unit/import/TextImporterTestSuite.test.ts @@ -10,7 +10,7 @@ const testNames = fs .readdirSync(path.resolve(__dirname, './input/')) .map((filename: string) => filename.split('.')[0]); -describe('MM import test execution', () => { +describe('package/', () => { test.each(testNames)('Importing %p suite', async (testName: string) => { // load freemap... const freemapPath = path.resolve(__dirname, `./input/${testName}.mm`); diff --git a/packages/mindplot/test/unit/import/input/SQLServerTip-version-0.8.0.mm b/packages/mindplot/test/unit/import/input/SQLServerTip-version-0.8.0.mm deleted file mode 100644 index 4ca29e7a..00000000 --- a/packages/mindplot/test/unit/import/input/SQLServerTip-version-0.8.0.mm +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/mindplot/test/unit/import/input/anonymity_on_the_edge-invalid.mm b/packages/mindplot/test/unit/import/input/anonymity_on_the_edge-invalid.mm deleted file mode 100644 index 0efb25b0..00000000 --- a/packages/mindplot/test/unit/import/input/anonymity_on_the_edge-invalid.mm +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/mindplot/test/unit/import/input/bug2-invalid.mm b/packages/mindplot/test/unit/import/input/bug2-invalid.mm deleted file mode 100644 index 13f03161..00000000 --- a/packages/mindplot/test/unit/import/input/bug2-invalid.mm +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Todos los contenidos de los talleres están relacionados con el currículo de la enseñanza básica.

-

A diferencia de la práctica tradicional, pretendemos ahondar en el conocimiento partiendo de lo que realmente interesa al niño o niña,

-

ayudándole a que encuentre respuesta a las preguntas que él o ella se plantea.

-

-

Por ese motivo, SaberMás proyecta estar al lado de los niños que necesitan una motivación extra para entender la escuela y fluir en ella,

-

y también al lado de aquellos a quienes la curiosidad y las ganas de saber les lleva más allá.

- - -
- - - - - - - \ No newline at end of file From a9bcfce52cef15492ab2c769582e6aeaf4582604 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 29 May 2022 10:22:57 -0700 Subject: [PATCH 11/51] Update Google Analytics to GA4 --- docker-compose.snapshots.update.yml | 2 +- docker-compose.snapshots.yml | 2 +- packages/webapp/package.json | 2 +- packages/webapp/src/app.tsx | 2 +- packages/webapp/src/components/editor-page/index.tsx | 2 +- .../webapp/src/components/forgot-password-page/index.tsx | 2 +- packages/webapp/src/components/login-page/index.tsx | 2 +- packages/webapp/src/components/maps-page/index.tsx | 2 +- .../webapp/src/components/registration-page/index.tsx | 2 +- yarn.lock | 8 ++++---- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docker-compose.snapshots.update.yml b/docker-compose.snapshots.update.yml index 8eab2a22..3571ffd9 100644 --- a/docker-compose.snapshots.update.yml +++ b/docker-compose.snapshots.update.yml @@ -1,7 +1,7 @@ version: '3' services: e2e: - image: cypress/included:8.4.1 + image: cypress/included:9.7.0 container_name: wisemapping-integration-tests entrypoint: '/bin/sh -c "yarn install && yarn bootstrap && yarn build && yarn test:integration"' working_dir: /e2e diff --git a/docker-compose.snapshots.yml b/docker-compose.snapshots.yml index 2f498c27..35a8429d 100644 --- a/docker-compose.snapshots.yml +++ b/docker-compose.snapshots.yml @@ -1,7 +1,7 @@ version: '3' services: e2e: - image: cypress/included:8.4.1 + image: cypress/included:9.7.0 container_name: wisemapping-integration-tests entrypoint: '/bin/sh -c "yarn bootstrap && yarn build && yarn test:integration"' working_dir: /e2e diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 2f4c621a..67d2ea05 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -69,8 +69,8 @@ "dayjs": "^1.10.7", "react": "^17.0.2", "react-dom": "^17.0.2", - "react-ga": "^3.3.0", "react-google-recaptcha": "^2.1.0", + "react-ga4": "^1.4.1", "react-intl": "^3.0.0", "react-query": "^3.6.0", "react-redux": "^7.2.2", diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 2cc517fc..27660976 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -14,7 +14,7 @@ import AppI18n, { Locales } from './classes/app-i18n'; import MapsPage from './components/maps-page'; import CssBaseline from '@mui/material/CssBaseline'; import { ThemeProvider, Theme, StyledEngineProvider } from '@mui/material/styles'; -import ReactGA from 'react-ga'; +import ReactGA from 'react-ga4'; import EditorPage from './components/editor-page'; import AppConfig from './classes/app-config'; import withSessionExpirationHandling from './components/HOCs/withSessionExpirationHandling'; diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index ff561203..67c21af0 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -7,7 +7,7 @@ import { IntlProvider } from 'react-intl'; import AppI18n, { Locales } from '../../classes/app-i18n'; import { useSelector } from 'react-redux'; import { hotkeysEnabled } from '../../redux/editorSlice'; -import ReactGA from 'react-ga'; +import ReactGA from 'react-ga4'; import Client from '../../classes/client'; import { activeInstance, fetchAccount, fetchMapById } from '../../redux/clientSlice'; import EditorOptionsBuilder from './EditorOptionsBuilder'; diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index 29b81d98..ab219b09 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -12,7 +12,7 @@ import { activeInstance } from '../../redux/clientSlice'; import Input from '../form/input'; import GlobalError from '../form/global-error'; import SubmitButton from '../form/submit-button'; -import ReactGA from 'react-ga'; +import ReactGA from 'react-ga4'; import Typography from '@mui/material/Typography'; import { getCsrfToken, getCsrfTokenParameter } from '../../utils'; diff --git a/packages/webapp/src/components/login-page/index.tsx b/packages/webapp/src/components/login-page/index.tsx index 102b038b..ce2c83a2 100644 --- a/packages/webapp/src/components/login-page/index.tsx +++ b/packages/webapp/src/components/login-page/index.tsx @@ -10,7 +10,7 @@ import FormContainer from '../layout/form-container'; import Typography from '@mui/material/Typography'; import FormControl from '@mui/material/FormControl'; import Link from '@mui/material/Link'; -import ReactGA from 'react-ga'; +import ReactGA from 'react-ga4'; import { getCsrfToken, getCsrfTokenParameter } from '../../utils'; type ConfigStatusProps = { diff --git a/packages/webapp/src/components/maps-page/index.tsx b/packages/webapp/src/components/maps-page/index.tsx index 3af0eb77..fc931561 100644 --- a/packages/webapp/src/components/maps-page/index.tsx +++ b/packages/webapp/src/components/maps-page/index.tsx @@ -40,7 +40,7 @@ import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction'; import logoIcon from './logo-small.svg'; import poweredByIcon from './pwrdby-white.svg'; import LabelDeleteConfirm from './maps-list/label-delete-confirm'; -import ReactGA from 'react-ga'; +import ReactGA from 'react-ga4'; import { withStyles } from '@mui/styles'; diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index ab737525..86500c00 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -17,7 +17,7 @@ import SubmitButton from '../form/submit-button'; import Typography from '@mui/material/Typography'; import FormControl from '@mui/material/FormControl'; import AppConfig from '../../classes/app-config'; -import ReactGA from 'react-ga'; +import ReactGA from 'react-ga4'; export type Model = { email: string; diff --git a/yarn.lock b/yarn.lock index 98943bf2..337473e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11943,10 +11943,10 @@ react-dom@^17.0.2: object-assign "^4.1.1" scheduler "^0.20.2" -react-ga@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.3.0.tgz#c91f407198adcb3b49e2bc5c12b3fe460039b3ca" - integrity sha512-o8RScHj6Lb8cwy3GMrVH6NJvL+y0zpJvKtc0+wmH7Bt23rszJmnqEQxRbyrqUzk9DTJIHoP42bfO5rswC9SWBQ== +react-ga4@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/react-ga4/-/react-ga4-1.4.1.tgz#6ee2a2db115ed235b2f2092bc746b4eeeca9e206" + integrity sha512-ioBMEIxd4ePw4YtaloTUgqhQGqz5ebDdC4slEpLgy2sLx1LuZBC9iYCwDymTXzcntw6K1dHX183ulP32nNdG7w== react-google-recaptcha@^2.1.0: version "2.1.0" From 7cb4a93387642138bce8493269625ec6058df7a9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 29 May 2022 16:32:51 -0700 Subject: [PATCH 12/51] Change GA deprecated code. --- packages/webapp/src/app.tsx | 6 +++++- packages/webapp/src/components/editor-page/index.tsx | 2 +- .../webapp/src/components/forgot-password-page/index.tsx | 2 +- packages/webapp/src/components/login-page/index.tsx | 2 +- packages/webapp/src/components/maps-page/index.tsx | 2 +- packages/webapp/src/components/registration-page/index.tsx | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 27660976..5902dce0 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -26,7 +26,11 @@ declare module '@mui/styles/defaultTheme' { } // Google Analytics Initialization. -ReactGA.initialize(AppConfig.getGoogleAnalyticsAccount()); +ReactGA.initialize([ + { + trackingId: AppConfig.getGoogleAnalyticsAccount(), + } +]); const queryClient = new QueryClient({ defaultOptions: { diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 67c21af0..40d0eb4a 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -23,7 +23,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const client: Client = useSelector(activeInstance); useEffect(() => { - ReactGA.pageview(window.location.pathname + window.location.search); + ReactGA.send({ hitType: "pageview", page: window.location.pathname}); }, []); const findEditorMode = (isTryMode: boolean, mapId: number): EditorRenderMode | null => { diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index ab219b09..fda9c4d3 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -80,7 +80,7 @@ const ForgotPasswordPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { document.title = intl.formatMessage({ id: 'forgot.page-title', defaultMessage: 'Forgot Password | WiseMapping' }); - ReactGA.pageview(window.location.pathname + window.location.search); + ReactGA.send({ hitType: "pageview", page: window.location.pathname}); },[]); return ( diff --git a/packages/webapp/src/components/login-page/index.tsx b/packages/webapp/src/components/login-page/index.tsx index ce2c83a2..f8d33b61 100644 --- a/packages/webapp/src/components/login-page/index.tsx +++ b/packages/webapp/src/components/login-page/index.tsx @@ -70,7 +70,7 @@ const LoginPage = (): React.ReactElement => { useEffect(() => { document.title = intl.formatMessage({id:'login.page-title',defaultMessage:'Login | WiseMapping'}); - ReactGA.pageview(window.location.pathname + window.location.search); + ReactGA.send({ hitType: "pageview", page: window.location.pathname}); },[]); return ( diff --git a/packages/webapp/src/components/maps-page/index.tsx b/packages/webapp/src/components/maps-page/index.tsx index fc931561..a6a50195 100644 --- a/packages/webapp/src/components/maps-page/index.tsx +++ b/packages/webapp/src/components/maps-page/index.tsx @@ -83,7 +83,7 @@ const MapsPage = (): ReactElement => { id: 'maps.page-title', defaultMessage: 'My Maps | WiseMapping', }); - ReactGA.pageview(window.location.pathname + window.location.search); + ReactGA.send({ hitType: "pageview", page: window.location.pathname}); }, []); const mutation = useMutation((id: number) => client.deleteLabel(id), { diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index 86500c00..178ce109 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -165,7 +165,7 @@ const RegistationPage = (): React.ReactElement => { id: 'registration.page-title', defaultMessage: 'Registration | WiseMapping', }); - ReactGA.pageview(window.location.pathname + window.location.search); + ReactGA.send({ hitType: "pageview", page: window.location.pathname}); },[]); return ( From ff639aab4f2901d6be3f59429ae4325d9485ace3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 29 May 2022 20:41:32 -0700 Subject: [PATCH 13/51] Update page title --- packages/webapp/src/app.tsx | 1 + .../src/components/editor-page/index.tsx | 2 +- .../components/forgot-password-page/index.tsx | 4 +-- .../src/components/login-page/index.tsx | 8 ++--- .../webapp/src/components/maps-page/index.tsx | 30 +++++++++---------- .../components/registration-page/index.tsx | 4 +-- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/packages/webapp/src/app.tsx b/packages/webapp/src/app.tsx index 5902dce0..b1b905f9 100644 --- a/packages/webapp/src/app.tsx +++ b/packages/webapp/src/app.tsx @@ -32,6 +32,7 @@ ReactGA.initialize([ } ]); + const queryClient = new QueryClient({ defaultOptions: { queries: { diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 40d0eb4a..7173e9cb 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -23,7 +23,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const client: Client = useSelector(activeInstance); useEffect(() => { - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: `Editor - ${mapId}` }); }, []); const findEditorMode = (isTryMode: boolean, mapId: number): EditorRenderMode | null => { diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index fda9c4d3..6bbed323 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -80,8 +80,8 @@ const ForgotPasswordPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { document.title = intl.formatMessage({ id: 'forgot.page-title', defaultMessage: 'Forgot Password | WiseMapping' }); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); - },[]); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Forgot password' }); + }, []); return (
diff --git a/packages/webapp/src/components/login-page/index.tsx b/packages/webapp/src/components/login-page/index.tsx index f8d33b61..cc40924c 100644 --- a/packages/webapp/src/components/login-page/index.tsx +++ b/packages/webapp/src/components/login-page/index.tsx @@ -69,9 +69,9 @@ const LoginPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { - document.title = intl.formatMessage({id:'login.page-title',defaultMessage:'Login | WiseMapping'}); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); - },[]); + document.title = intl.formatMessage({ id: 'login.page-title', defaultMessage: 'Login | WiseMapping' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Login' }); + }, []); return (
@@ -90,7 +90,7 @@ const LoginPage = (): React.ReactElement => {
- + { id: 'maps.page-title', defaultMessage: 'My Maps | WiseMapping', }); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Maps list' }); }, []); const mutation = useMutation((id: number) => client.deleteLabel(id), { @@ -287,20 +287,20 @@ interface ListItemProps { // https://stackoverflow.com/questions/61486061/how-to-set-selected-and-hover-color-of-listitem-in-mui const CustomListItem = withStyles({ root: { - "&$selected": { - backgroundColor: "rgb(210, 140, 5)", - color: "white", - "& .MuiListItemIcon-root": { - color: "white" - } - }, - "&$selected:hover": { - backgroundColor: "rgb(210, 140, 5)", - color: "white", - "& .MuiListItemIcon-root": { - color: "white" - } - }, + "&$selected": { + backgroundColor: "rgb(210, 140, 5)", + color: "white", + "& .MuiListItemIcon-root": { + color: "white" + } + }, + "&$selected:hover": { + backgroundColor: "rgb(210, 140, 5)", + color: "white", + "& .MuiListItemIcon-root": { + color: "white" + } + }, }, selected: {} })(ListItemButton); diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index 178ce109..3191cf25 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -165,8 +165,8 @@ const RegistationPage = (): React.ReactElement => { id: 'registration.page-title', defaultMessage: 'Registration | WiseMapping', }); - ReactGA.send({ hitType: "pageview", page: window.location.pathname}); - },[]); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Register' }); + }, []); return (
From af33474a1c5ea4b34a01028c62dbec910918b49e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 29 May 2022 20:51:39 -0700 Subject: [PATCH 14/51] Add event for edition actions --- .../maps-page/action-dispatcher/index.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx index 3e21b015..98e3c892 100644 --- a/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx +++ b/packages/webapp/src/components/maps-page/action-dispatcher/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import RenameDialog from './rename-dialog'; import DeleteDialog from './delete-dialog'; import { ActionType } from '../action-chooser'; @@ -13,6 +13,8 @@ import DeleteMultiselectDialog from './delete-multiselect-dialog'; import ExportDialog from './export-dialog'; import ShareDialog from './share-dialog'; import LabelDialog from './label-dialog'; +import ReactGA from 'react-ga4'; + export type BasicMapInfo = { name: string; @@ -27,6 +29,16 @@ type ActionDialogProps = { }; const ActionDispatcher = ({ mapsId, action, onClose, fromEditor }: ActionDialogProps): React.ReactElement => { + + useEffect(() => { + ReactGA.event({ + category: 'map metadata', + action: action, + nonInteraction: true + + }); + }, [action]); + const handleOnClose = (success?: boolean): void => { onClose(success); }; From 5abf9ca06b4aec9fcc58118403fce330c13a5247 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 30 May 2022 08:56:40 -0700 Subject: [PATCH 15/51] Improve page titles to GA --- packages/webapp/src/components/editor-page/index.tsx | 2 +- packages/webapp/src/components/forgot-password-page/index.tsx | 2 +- .../src/components/forgot-password-success-page/index.tsx | 2 ++ packages/webapp/src/components/registration-page/index.tsx | 2 +- .../webapp/src/components/registration-success-page/index.tsx | 3 +++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 7173e9cb..5e8389fa 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -23,7 +23,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { const client: Client = useSelector(activeInstance); useEffect(() => { - ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: `Editor - ${mapId}` }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: `Map Editor` }); }, []); const findEditorMode = (isTryMode: boolean, mapId: number): EditorRenderMode | null => { diff --git a/packages/webapp/src/components/forgot-password-page/index.tsx b/packages/webapp/src/components/forgot-password-page/index.tsx index 6bbed323..499098f0 100644 --- a/packages/webapp/src/components/forgot-password-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-page/index.tsx @@ -80,7 +80,7 @@ const ForgotPasswordPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { document.title = intl.formatMessage({ id: 'forgot.page-title', defaultMessage: 'Forgot Password | WiseMapping' }); - ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Forgot password' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'ForgotPassword:Init' }); }, []); return ( diff --git a/packages/webapp/src/components/forgot-password-success-page/index.tsx b/packages/webapp/src/components/forgot-password-success-page/index.tsx index c73bb196..5e8327c5 100644 --- a/packages/webapp/src/components/forgot-password-success-page/index.tsx +++ b/packages/webapp/src/components/forgot-password-success-page/index.tsx @@ -6,12 +6,14 @@ import Footer from '../layout/footer'; import { Link as RouterLink } from 'react-router-dom'; import Typography from '@mui/material/Typography'; import Button from '@mui/material/Button'; +import ReactGA from 'react-ga4'; const ForgotPasswordSuccessPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { document.title = intl.formatMessage({ id: 'forgotsuccess.page-title', defaultMessage: 'Password Recovered | WiseMapping' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'ForgotPassword:Success' }); }); return ( diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index 3191cf25..f908cd19 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -165,7 +165,7 @@ const RegistationPage = (): React.ReactElement => { id: 'registration.page-title', defaultMessage: 'Registration | WiseMapping', }); - ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Register' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Registration:Init' }); }, []); return ( diff --git a/packages/webapp/src/components/registration-success-page/index.tsx b/packages/webapp/src/components/registration-success-page/index.tsx index 14b171af..4ca6d8ff 100644 --- a/packages/webapp/src/components/registration-success-page/index.tsx +++ b/packages/webapp/src/components/registration-success-page/index.tsx @@ -6,12 +6,15 @@ import Footer from '../layout/footer'; import { Link as RouterLink } from 'react-router-dom'; import Typography from '@mui/material/Typography'; import Button from '@mui/material/Button'; +import ReactGA from 'react-ga4'; + const RegistrationSuccessPage = (): React.ReactElement => { const intl = useIntl(); useEffect(() => { document.title = intl.formatMessage({ id: 'registation.success-title', defaultMessage: 'Registation Success | WiseMapping' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Registration:Success' }); }); return ( From 1ff7f50983078343f71cc941ad524de3db7820ee Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 30 May 2022 09:04:02 -0700 Subject: [PATCH 16/51] Simplify pages title --- packages/webapp/src/components/maps-page/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/src/components/maps-page/index.tsx b/packages/webapp/src/components/maps-page/index.tsx index b7d24242..0d52baf2 100644 --- a/packages/webapp/src/components/maps-page/index.tsx +++ b/packages/webapp/src/components/maps-page/index.tsx @@ -83,7 +83,7 @@ const MapsPage = (): ReactElement => { id: 'maps.page-title', defaultMessage: 'My Maps | WiseMapping', }); - ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Maps list' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'MapsList' }); }, []); const mutation = useMutation((id: number) => client.deleteLabel(id), { From e62ec545d06c2ac485f4a454acfa97c9c5d1db5e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 31 May 2022 16:03:09 -0700 Subject: [PATCH 17/51] Fix typo --- packages/webapp/src/components/maps-page/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webapp/src/components/maps-page/index.tsx b/packages/webapp/src/components/maps-page/index.tsx index 0d52baf2..71d58dca 100644 --- a/packages/webapp/src/components/maps-page/index.tsx +++ b/packages/webapp/src/components/maps-page/index.tsx @@ -83,7 +83,7 @@ const MapsPage = (): ReactElement => { id: 'maps.page-title', defaultMessage: 'My Maps | WiseMapping', }); - ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'MapsList' }); + ReactGA.send({ hitType: 'pageview', page: window.location.pathname, title: 'Maps List' }); }, []); const mutation = useMutation((id: number) => client.deleteLabel(id), { From a27cca027d2bbdae052a7428344558b0fa212bed Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 16 Jun 2022 17:48:42 -0700 Subject: [PATCH 18/51] Remove failing tests --- packages/mindplot/test/playground/layout/context-loader.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/mindplot/test/playground/layout/context-loader.js b/packages/mindplot/test/playground/layout/context-loader.js index e402c775..2575c6bf 100644 --- a/packages/mindplot/test/playground/layout/context-loader.js +++ b/packages/mindplot/test/playground/layout/context-loader.js @@ -1,7 +1,6 @@ import TestSuite from './TestSuite'; import BalancedTestSuite from './BalancedTestSuite'; import SymmetricTestSuite from './SymmetricTestSuite'; -import FreeTestSuite from './FreeTestSuite'; import Raphael from './lib/raphael-min'; import { drawGrid } from './lib/raphael-plugins'; import '../../../src'; // TODO: remove this when removing mootools (hack used to load it as a side effect) @@ -13,5 +12,4 @@ window.addEventListener('DOMContentLoaded', () => { new TestSuite(); new BalancedTestSuite(); new SymmetricTestSuite(); - new FreeTestSuite(); }); From d4fcb859f0a750806ea6a5d23549be733f2c9293 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Jun 2022 19:45:13 -0700 Subject: [PATCH 19/51] Remove screenshot preview on link tooltip. --- .../src/components/widget/LinkIconTooltip.js | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/packages/mindplot/src/components/widget/LinkIconTooltip.js b/packages/mindplot/src/components/widget/LinkIconTooltip.js index a40b56fc..7e079263 100644 --- a/packages/mindplot/src/components/widget/LinkIconTooltip.js +++ b/packages/mindplot/src/components/widget/LinkIconTooltip.js @@ -41,44 +41,20 @@ class LinkIconTooltip extends FloatingTip { static _buildContent(linkIcon) { const url = linkIcon.getModel().getUrl(); const linkText = `${url}`; - const linkPreview = `https://free.pagepeeker.com/v2/thumbs.php?size=m&url=${url}`; const result = $('
').css({ padding: '5px', width: '100%', }); - - const text = $('
').text(linkText) - .css({ - 'white-space': 'pre-wrap', - 'word-wrap': 'break-word', - }); - result.append(text); - - const imgContainer = $('
') - .css({ - width: '100%', - textAlign: 'right', - 'padding-bottom': '5px', - 'padding-top': '5px', - }); - - const img = $('') - .prop('src', linkPreview) - .prop('img', url) - .prop('alt', url); - - img.css('padding', '5px'); - const link = $('').attr({ href: url, alt: 'Open in new window ...', target: '_blank', }); - link.append(img); - imgContainer.append(link); - result.append(imgContainer); + link.append(linkText); + result.append(link); + return result; } } From f3170dd11e8ab63a8966fd1a23a801243873e559 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Jun 2022 20:29:02 -0700 Subject: [PATCH 20/51] Migrate src/components/widget/LinkIconTooltip.js to TS --- .../widget/{LinkIconTooltip.js => LinkIconTooltip.ts} | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) rename packages/mindplot/src/components/widget/{LinkIconTooltip.js => LinkIconTooltip.ts} (88%) diff --git a/packages/mindplot/src/components/widget/LinkIconTooltip.js b/packages/mindplot/src/components/widget/LinkIconTooltip.ts similarity index 88% rename from packages/mindplot/src/components/widget/LinkIconTooltip.js rename to packages/mindplot/src/components/widget/LinkIconTooltip.ts index 7e079263..440ac955 100644 --- a/packages/mindplot/src/components/widget/LinkIconTooltip.js +++ b/packages/mindplot/src/components/widget/LinkIconTooltip.ts @@ -17,11 +17,13 @@ */ import { $assert } from '@wisemapping/core-js'; import $ from 'jquery'; +import LinkIcon from '../LinkIcon'; +import LinkModel from '../model/LinkModel'; import { $msg } from '../Messages'; import FloatingTip from './FloatingTip'; class LinkIconTooltip extends FloatingTip { - constructor(linkIcon) { + constructor(linkIcon: LinkIcon) { $assert(linkIcon, 'linkIcon can not be null'); const nativeElement = $(linkIcon.getImage().peer._native); super(nativeElement, { @@ -38,8 +40,9 @@ class LinkIconTooltip extends FloatingTip { }); } - static _buildContent(linkIcon) { - const url = linkIcon.getModel().getUrl(); + private static _buildContent(linkIcon: LinkIcon): JQuery { + const model = linkIcon.getModel() as LinkModel; + const url = model.getUrl(); const linkText = `${url}`; const result = $('
').css({ @@ -54,7 +57,6 @@ class LinkIconTooltip extends FloatingTip { link.append(linkText); result.append(link); - return result; } } From bd4656c227bbe1401a24d3e5f79f8ea775c4b764 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 23 Jun 2022 21:01:00 -0700 Subject: [PATCH 21/51] Migrate link editor to typescript --- .../widget/{LinkEditor.js => LinkEditor.ts} | 39 ++++++++++--------- .../widget/bootstrap/BootstrapDialog.js | 6 +-- 2 files changed, 24 insertions(+), 21 deletions(-) rename packages/mindplot/src/components/widget/{LinkEditor.js => LinkEditor.ts} (84%) diff --git a/packages/mindplot/src/components/widget/LinkEditor.js b/packages/mindplot/src/components/widget/LinkEditor.ts similarity index 84% rename from packages/mindplot/src/components/widget/LinkEditor.js rename to packages/mindplot/src/components/widget/LinkEditor.ts index f4dbcabc..a9b278e0 100644 --- a/packages/mindplot/src/components/widget/LinkEditor.js +++ b/packages/mindplot/src/components/widget/LinkEditor.ts @@ -20,14 +20,17 @@ import { $assert } from '@wisemapping/core-js'; import { $msg } from '../Messages'; import BootstrapDialog from './bootstrap/BootstrapDialog'; +interface LinkEditorModel { + getValue(): string; + setValue(value: string): void; +} + class LinkEditor extends BootstrapDialog { - /** - * @constructs - * @param model - * @throws will throw an error if model is null or undefined - * @extends BootstrapDialog - */ - constructor(model) { + private form: JQuery; + + private formSubmitted: boolean; + + constructor(model: LinkEditorModel) { $assert(model, 'model can not be null'); super($msg('LINK'), { cancelButton: true, @@ -37,13 +40,12 @@ class LinkEditor extends BootstrapDialog { errorMessage: true, onEventData: { model }, }); - this._model = model; this.css({ margin: '150px auto' }); const panel = this._buildPanel(model); this.setContent(panel); } - _buildPanel(model) { + protected _buildPanel(model: LinkEditorModel) { const result = $('
').css('padding-top', '5px'); this.form = $('').attr({ action: 'none', @@ -80,8 +82,9 @@ class LinkEditor extends BootstrapDialog { }); openButton.html($msg('OPEN_LINK')).css('margin-left', '0px'); - openButton.click(() => { - window.open(input.val(), '_blank', 'status=1,width=700,height=450,resize=1'); + openButton.on('click', () => { + const value = input.val() as string; + window.open(value, '_blank', 'status=1,width=700,height=450,resize=1'); }); const spanControl = $('').append(openButton); @@ -90,13 +93,13 @@ class LinkEditor extends BootstrapDialog { this.form.append(section); const me = this; - this.form.unbind('submit').submit((event) => { + this.form.off('submit').on('submit', (event) => { event.preventDefault(); - let inputValue = input.val(); + let inputValue = input.val() as string; inputValue = this.hasProtocol(inputValue) ? inputValue : `https://${inputValue}`; if (me.checkURL(inputValue)) { me.cleanError(); - if (inputValue != null && $.trim(inputValue) !== '') { + if (inputValue !== null && inputValue.trim() !== '') { model.setValue(inputValue); } me.close(); @@ -115,7 +118,7 @@ class LinkEditor extends BootstrapDialog { * checks whether the input is a valid url * @return {Boolean} true if the url is valid */ - checkURL(url) { + private checkURL(url: string): boolean { const regex = /^(http|https):\/\/[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i; return (regex.test(url)); } @@ -124,7 +127,7 @@ class LinkEditor extends BootstrapDialog { * checks whether the input is a valid url * @return {Boolean} true if the url is valid */ - hasProtocol(url) { + private hasProtocol(url: string): boolean { const regex = /^(http|https):\/\//i; return (regex.test(url)); } @@ -134,7 +137,7 @@ class LinkEditor extends BootstrapDialog { * triggered when the user clicks the accept button - submits the url input * @param event */ - onAcceptClick(event) { + onAcceptClick(event: Event): void { this.formSubmitted = false; $('#linkFormId').trigger('submit'); if (!this.formSubmitted) { @@ -146,7 +149,7 @@ class LinkEditor extends BootstrapDialog { * overrides parent method * sets the url input on focus */ - onDialogShown() { + onDialogShown(): void { $(this).find('#inputUrl').focus(); } diff --git a/packages/mindplot/src/components/widget/bootstrap/BootstrapDialog.js b/packages/mindplot/src/components/widget/bootstrap/BootstrapDialog.js index 3ba59482..cc662382 100644 --- a/packages/mindplot/src/components/widget/bootstrap/BootstrapDialog.js +++ b/packages/mindplot/src/components/widget/bootstrap/BootstrapDialog.js @@ -114,15 +114,15 @@ class BootstrapDialog extends Options { return header; } - onAcceptClick() { + onAcceptClick(event) { throw new Error('Unsupported operation'); } - onDialogShown() { + onDialogShown(event) { // Overwrite default behaviour ... } - onRemoveClick() { + onRemoveClick(event) { throw new Error('Unsupported operation'); } From 95da8db7a117bd06fd2b2068b08afdbf63577d87 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 23 Jun 2022 21:10:20 -0700 Subject: [PATCH 22/51] Migrate NoteEditos to TS --- .../src/classes/bootstrap/BootstrapDialog.js | 4 ++-- .../widget/{NoteEditor.js => NoteEditor.ts} | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) rename packages/mindplot/src/components/widget/{NoteEditor.js => NoteEditor.ts} (87%) diff --git a/packages/editor/src/classes/bootstrap/BootstrapDialog.js b/packages/editor/src/classes/bootstrap/BootstrapDialog.js index 33099fd5..848ebeb4 100644 --- a/packages/editor/src/classes/bootstrap/BootstrapDialog.js +++ b/packages/editor/src/classes/bootstrap/BootstrapDialog.js @@ -114,7 +114,7 @@ class BootstrapDialog extends Options { return header; } - onAcceptClick() { + onAcceptClick(event) { throw new Error('Unsupported operation'); } @@ -122,7 +122,7 @@ class BootstrapDialog extends Options { // Overwrite default behaviour ... } - onRemoveClick() { + onRemoveClick(event) { throw new Error('Unsupported operation'); } diff --git a/packages/mindplot/src/components/widget/NoteEditor.js b/packages/mindplot/src/components/widget/NoteEditor.ts similarity index 87% rename from packages/mindplot/src/components/widget/NoteEditor.js rename to packages/mindplot/src/components/widget/NoteEditor.ts index 3d127996..b7691e49 100644 --- a/packages/mindplot/src/components/widget/NoteEditor.js +++ b/packages/mindplot/src/components/widget/NoteEditor.ts @@ -20,8 +20,13 @@ import $ from 'jquery'; import BootstrapDialog from '../../../../editor/src/classes/bootstrap/BootstrapDialog'; import { $msg } from '../Messages'; +interface NoteEditorModel { + getValue(): string; + setValue(value: string): void; +} + class NoteEditor extends BootstrapDialog { - constructor(model) { + constructor(model: NoteEditorModel) { $assert(model, 'model can not be null'); super($msg('NOTE'), { cancelButton: true, @@ -30,13 +35,12 @@ class NoteEditor extends BootstrapDialog { removeButton: typeof model.getValue() !== 'undefined', onEventData: { model }, }); - this._model = model; this.css({ margin: '150px auto' }); const panel = this._buildPanel(model); this.setContent(panel); } - _buildPanel(model) { + _buildPanel(model: NoteEditorModel) { const result = $('
').css('padding-top', '5px'); const form = $('
').attr({ @@ -68,20 +72,20 @@ class NoteEditor extends BootstrapDialog { return result; } - onAcceptClick(event) { + onAcceptClick(event): void { event.data.dialog._submitForm(event.data.model); } - _submitForm(model) { + _submitForm(model: NoteEditorModel) { const textarea = this._native.find('textarea'); if (textarea.val()) { - model.setValue(textarea.val()); + model.setValue(textarea.val() as string); } this.close(); } onDialogShown() { - $(this).find('textarea').focus(); + $(this).find('textarea').trigger('focus'); } onRemoveClick(event) { From c469d82599b7ebbad1af36e7cd59a33766f24e82 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 23 Jun 2022 21:42:08 -0700 Subject: [PATCH 23/51] Migrate AbstractBasicSorter to TS --- ...tBasicSorter.js => AbstractBasicSorter.ts} | 36 +++---- .../{BalancedSorter.js => BalancedSorter.ts} | 93 +++---------------- .../layout/ChildrenSorterStrategy.ts | 6 +- 3 files changed, 29 insertions(+), 106 deletions(-) rename packages/mindplot/src/components/layout/{AbstractBasicSorter.js => AbstractBasicSorter.ts} (75%) rename packages/mindplot/src/components/layout/{BalancedSorter.js => BalancedSorter.ts} (77%) diff --git a/packages/mindplot/src/components/layout/AbstractBasicSorter.js b/packages/mindplot/src/components/layout/AbstractBasicSorter.ts similarity index 75% rename from packages/mindplot/src/components/layout/AbstractBasicSorter.js rename to packages/mindplot/src/components/layout/AbstractBasicSorter.ts index c0f3ede0..8bab9ffa 100644 --- a/packages/mindplot/src/components/layout/AbstractBasicSorter.js +++ b/packages/mindplot/src/components/layout/AbstractBasicSorter.ts @@ -16,24 +16,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import PositionType from '../PositionType'; import ChildrenSorterStrategy from './ChildrenSorterStrategy'; +import Node from './Node'; +import RootedTreeSet from './RootedTreeSet'; -/** - * @class - * @extends mindplot.layout.ChildrenSorterStrategy - */ -class AbstractBasicSorter extends ChildrenSorterStrategy { - computeChildrenIdByHeights(treeSet, node) { +abstract class AbstractBasicSorter extends ChildrenSorterStrategy { + private INTERNODE_VERTICAL_PADDING = 5; + + computeChildrenIdByHeights(treeSet: RootedTreeSet, node: Node) { const result = {}; this._computeChildrenHeight(treeSet, node, result); return result; } - _getVerticalPadding() { - return AbstractBasicSorter.INTERNODE_VERTICAL_PADDING; + protected _getVerticalPadding() { + return this.INTERNODE_VERTICAL_PADDING; } - _computeChildrenHeight(treeSet, node, heightCache) { + protected _computeChildrenHeight(treeSet: RootedTreeSet, node: Node, heightCache?) { // 2* Top and down padding; const height = node.getSize().height + this._getVerticalPadding() * 2; @@ -59,29 +60,16 @@ class AbstractBasicSorter extends ChildrenSorterStrategy { return result; } - _getSortedChildren(treeSet, node) { + protected _getSortedChildren(treeSet: RootedTreeSet, node: Node) { const result = treeSet.getChildren(node); result.sort((a, b) => a.getOrder() - b.getOrder()); return result; } - _getRelativeDirection(reference, position) { + protected _getRelativeDirection(reference: PositionType, position: PositionType): 1 | -1 { const offset = position.x - reference.x; return offset >= 0 ? 1 : -1; } } -/** - * @constant - * @type {Number} - * @default - */ -AbstractBasicSorter.INTERNODE_VERTICAL_PADDING = 5; -/** - * @constant - * @type {Number} - * @default - */ -AbstractBasicSorter.INTERNODE_HORIZONTAL_PADDING = 30; - export default AbstractBasicSorter; diff --git a/packages/mindplot/src/components/layout/BalancedSorter.js b/packages/mindplot/src/components/layout/BalancedSorter.ts similarity index 77% rename from packages/mindplot/src/components/layout/BalancedSorter.js rename to packages/mindplot/src/components/layout/BalancedSorter.ts index 7195f84d..9a0da019 100644 --- a/packages/mindplot/src/components/layout/BalancedSorter.js +++ b/packages/mindplot/src/components/layout/BalancedSorter.ts @@ -18,42 +18,18 @@ * limitations under the License. */ import { $assert, $defined } from '@wisemapping/core-js'; +import PositionType from '../PositionType'; import AbstractBasicSorter from './AbstractBasicSorter'; +import Node from './Node'; +import RootedTreeSet from './RootedTreeSet'; class BalancedSorter extends AbstractBasicSorter { - predict(graph, parent, node, position, free) { - // If its a free node... - if (free) { - $assert( - $defined(position), - 'position cannot be null for predict in free positioning', - ); - $assert($defined(node), 'node cannot be null for predict in free positioning'); - const rootNode = graph.getRootNode(parent); - const direction = this._getRelativeDirection( - rootNode.getPosition(), - node.getPosition(), - ); + private static INTERNODE_VERTICAL_PADDING = 5; - const limitXPos = parent.getPosition().x - + direction - * (parent.getSize().width / 2 - + node.getSize().width / 2 - + BalancedSorter.INTERNODE_HORIZONTAL_PADDING); + private static INTERNODE_HORIZONTAL_PADDING = 30; - let xPos; - if (direction > 0) { - xPos = position.x >= limitXPos - ? position.x - : limitXPos; - } else { - xPos = position.x <= limitXPos - ? position.x - : limitXPos; - } - return [0, { x: xPos, y: position.y }]; - } + predict(graph, parent, node: Node, position: PositionType) { const rootNode = graph.getRootNode(parent); @@ -145,13 +121,7 @@ class BalancedSorter extends AbstractBasicSorter { return result; } - /** - * @param {} treeSet - * @param {} parent - * @param {} child - * @param {} order - */ - insert(treeSet, parent, child, order) { + insert(treeSet: RootedTreeSet, parent: Node, child: Node, order: number) { const children = this._getChildrenForOrder(parent, treeSet, order); // If no children, return 0 or 1 depending on the side @@ -176,11 +146,7 @@ class BalancedSorter extends AbstractBasicSorter { child.setOrder(newOrder); } - /** - * @param {} treeSet - * @param {} node - */ - detach(treeSet, node) { + detach(treeSet: RootedTreeSet, node: Node): void { const parent = treeSet.getParent(node); // Filter nodes on one side.. const children = this._getChildrenForOrder(parent, treeSet, node.getOrder()); @@ -193,12 +159,7 @@ class BalancedSorter extends AbstractBasicSorter { node.setOrder(node.getOrder() % 2 === 0 ? 0 : 1); } - /** - * @param {} treeSet - * @param {} node - * @return offsets - */ - computeOffsets(treeSet, node) { + computeOffsets(treeSet: RootedTreeSet, node: Node) { $assert(treeSet, 'treeSet can no be null.'); $assert(node, 'node can no be null.'); @@ -256,12 +217,7 @@ class BalancedSorter extends AbstractBasicSorter { return result; } - /** - * @param {} treeSet - * @param {} node - * @throw will throw an error if order elements are missing - */ - verify(treeSet, node) { + verify(treeSet: RootedTreeSet, node: Node): void { // Check that all is consistent ... const children = this._getChildrenForOrder(node, treeSet, node.getOrder()); @@ -279,43 +235,22 @@ class BalancedSorter extends AbstractBasicSorter { } } - /** - * @param {} treeSet - * @param {} child - * @return the direction of the child within the treeSet - */ - getChildDirection(treeSet, child) { + getChildDirection(treeSet: RootedTreeSet, child: Node): 1 | -1 { return child.getOrder() % 2 === 0 ? 1 : -1; } - /** - * @return {String} the print name of this class - */ - toString() { + toString(): string { return 'Balanced Sorter'; } - _getChildrenForOrder(parent, graph, order) { + protected _getChildrenForOrder(parent: Node, graph: RootedTreeSet, order: number) { return this._getSortedChildren(graph, parent) .filter((child) => child.getOrder() % 2 === order % 2); } - _getVerticalPadding() { + protected _getVerticalPadding(): number { return BalancedSorter.INTERNODE_VERTICAL_PADDING; } } -/** - * @constant - * @type {Number} - * @default - */ -BalancedSorter.INTERNODE_VERTICAL_PADDING = 5; -/** - * @constant - * @type {Number} - * @default - */ -BalancedSorter.INTERNODE_HORIZONTAL_PADDING = 30; - export default BalancedSorter; diff --git a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts index fbf2cb25..85396b4c 100644 --- a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts +++ b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts @@ -24,15 +24,15 @@ abstract class ChildrenSorterStrategy { abstract computeOffsets(treeSet: RootedTreeSet, node: Node); - abstract insert(treeSet: RootedTreeSet, parent: Node, child: Node, order: number); + abstract insert(treeSet: RootedTreeSet, parent: Node, child: Node, order: number): void; - abstract detach(treeSet: RootedTreeSet, node: Node); + abstract detach(treeSet: RootedTreeSet, node: Node): void; abstract predict(treeSet: RootedTreeSet, parent, node: Node, position: PositionType); abstract verify(treeSet: RootedTreeSet, node: Node); - abstract getChildDirection(treeSet: RootedTreeSet, node: Node); + abstract getChildDirection(treeSet: RootedTreeSet, node: Node): 1 | -1; abstract toString(): string; } From b48d55ebca02c7a515b3f1e1571a07457e7c8367 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 23 Jun 2022 21:51:35 -0700 Subject: [PATCH 24/51] Fix eslint errors --- packages/mindplot/src/components/layout/BalancedSorter.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/mindplot/src/components/layout/BalancedSorter.ts b/packages/mindplot/src/components/layout/BalancedSorter.ts index 9a0da019..04b0ef20 100644 --- a/packages/mindplot/src/components/layout/BalancedSorter.ts +++ b/packages/mindplot/src/components/layout/BalancedSorter.ts @@ -24,13 +24,11 @@ import Node from './Node'; import RootedTreeSet from './RootedTreeSet'; class BalancedSorter extends AbstractBasicSorter { - private static INTERNODE_VERTICAL_PADDING = 5; private static INTERNODE_HORIZONTAL_PADDING = 30; predict(graph, parent, node: Node, position: PositionType) { - const rootNode = graph.getRootNode(parent); // If it is a dragged node... @@ -243,7 +241,7 @@ class BalancedSorter extends AbstractBasicSorter { return 'Balanced Sorter'; } - protected _getChildrenForOrder(parent: Node, graph: RootedTreeSet, order: number) { + protected _getChildrenForOrder(parent: Node, graph: RootedTreeSet, order: number) { return this._getSortedChildren(graph, parent) .filter((child) => child.getOrder() % 2 === order % 2); } From 0f4a8ee0879ce97b143caf8e5bfd6534331433fc Mon Sep 17 00:00:00 2001 From: Gustavo Fuhr Date: Sat, 9 Jul 2022 01:34:52 +0000 Subject: [PATCH 25/51] Merged in ray-develop (pull request #51) Ray develop * reset zoom and toolbar fixes * lang fixes * dialog enhancements * comments * tooltip for zoom and fit commented * merge develop into ray develop * rules for ignoring some linebreaks in eslint * comments in .eslintrc * brackets around ifs * playground fixes, comments removed, semi-colon at bottom of editor removed, root container size now defined with css Approved-by: Paulo Veiga --- .gitignore | 5 +- .prettierrc.json | 4 +- docker-compose.snapshots.update.yml | 2 +- docker-compose.snapshots.yml | 2 +- lerna.json | 3 +- package.json | 17 +- packages/editor/images/close-dialog-icon.svg | 43 ++ packages/editor/lang/de.json | 12 + packages/editor/lang/en.json | 16 +- packages/editor/lang/es.json | 12 + packages/editor/lang/fr.json | 14 +- packages/editor/lang/ru.json | 12 + packages/editor/lang/zh.json | 36 +- packages/editor/src/classes/menu/Menu.ts | 47 +- packages/editor/src/compiled-lang/de.json | 24 + packages/editor/src/compiled-lang/en.json | 26 +- packages/editor/src/compiled-lang/es.json | 24 + packages/editor/src/compiled-lang/fr.json | 26 +- packages/editor/src/compiled-lang/ru.json | 24 + packages/editor/src/compiled-lang/zh.json | 24 + .../editor/src/components/footer/index.tsx | 122 ++-- packages/editor/src/global-styled.css | 89 ++- packages/editor/src/index.tsx | 209 ++++--- packages/editor/test/playground/index.html | 64 ++- .../playground/map-render/css/viewmode.css | 2 +- .../playground/map-render/html/editor.html | 4 +- .../playground/map-render/html/showcase.html | 17 + .../playground/map-render/html/viewmode.html | 25 +- .../playground/map-render/js/showcase.tsx | 52 ++ packages/editor/webpack.playground.js | 16 +- packages/mindplot/.eslintrc.json | 20 +- packages/mindplot/src/@types/custom.d.ts | 4 +- packages/mindplot/src/components/Designer.ts | 88 +-- .../src/components/DesignerOptionsBuilder.ts | 26 +- packages/mindplot/src/components/IconGroup.ts | 21 +- .../mindplot/src/components/ScreenManager.ts | 46 +- packages/mindplot/src/components/Workspace.ts | 21 +- .../commands/MoveControlPointCommand.ts | 4 +- .../components/layout/AbstractBasicSorter.ts | 4 +- .../src/components/layout/BalancedSorter.ts | 66 +-- .../src/components/widget/LinkEditor.ts | 7 +- .../src/components/widget/LinkIconTooltip.ts | 3 +- packages/mindplot/src/index.ts | 12 +- packages/mindplot/src/indexLoader.ts | 25 +- packages/webapp/src/app.tsx | 123 ++-- .../HOCs/withSessionExpirationHandling.tsx | 38 +- .../webapp/src/components/maps-page/index.tsx | 540 +++++++++--------- 47 files changed, 1258 insertions(+), 763 deletions(-) create mode 100644 packages/editor/images/close-dialog-icon.svg create mode 100644 packages/editor/test/playground/map-render/html/showcase.html create mode 100644 packages/editor/test/playground/map-render/js/showcase.tsx diff --git a/.gitignore b/.gitignore index 21a52a85..a30550ef 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,7 @@ Thumbs.db **/build/**/* .vscode -*/test/playground/dist \ No newline at end of file +*/test/playground/dist + +# visual code local workspaces +wisemapping-frontend.code-workspace diff --git a/.prettierrc.json b/.prettierrc.json index 0c45137e..2c9ca384 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,6 +1,6 @@ { - "trailingComma": "es5", - "tabWidth": 4, + "trailingComma": "all", + "tabWidth": 2, "semi": true, "singleQuote": true, "printWidth": 100 diff --git a/docker-compose.snapshots.update.yml b/docker-compose.snapshots.update.yml index 3571ffd9..93880046 100644 --- a/docker-compose.snapshots.update.yml +++ b/docker-compose.snapshots.update.yml @@ -1,7 +1,7 @@ version: '3' services: e2e: - image: cypress/included:9.7.0 + image: cypress/included:10.2.0 container_name: wisemapping-integration-tests entrypoint: '/bin/sh -c "yarn install && yarn bootstrap && yarn build && yarn test:integration"' working_dir: /e2e diff --git a/docker-compose.snapshots.yml b/docker-compose.snapshots.yml index 35a8429d..8f7a613f 100644 --- a/docker-compose.snapshots.yml +++ b/docker-compose.snapshots.yml @@ -1,7 +1,7 @@ version: '3' services: e2e: - image: cypress/included:9.7.0 + image: cypress/included:10.2.0 container_name: wisemapping-integration-tests entrypoint: '/bin/sh -c "yarn bootstrap && yarn build && yarn test:integration"' working_dir: /e2e diff --git a/lerna.json b/lerna.json index dabb023c..d9f270f3 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,6 @@ ], "version": "1.0.0", "npmClient": "yarn", - "useWorkspaces": true + "useWorkspaces": true, + "useNx": false } diff --git a/package.json b/package.json index 0a6cd91b..0c75a662 100644 --- a/package.json +++ b/package.json @@ -45,5 +45,20 @@ "homepage": "http://localhost:8080/react", "license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL", "version": "0.4.0", - "dependencies": {} + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "pre-push": "yarn lint && yarn test:unit" + } + }, + "lint-staged": { + "**/*.{ts,tsx}": [ + "prettier --write" + ] + }, + "eslintConfig": { + "rules": { + "implicit-arrow-linebreak": "off" + } + } } diff --git a/packages/editor/images/close-dialog-icon.svg b/packages/editor/images/close-dialog-icon.svg new file mode 100644 index 00000000..3b57389c --- /dev/null +++ b/packages/editor/images/close-dialog-icon.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/editor/lang/de.json b/packages/editor/lang/de.json index bf777ed4..928a15bf 100644 --- a/packages/editor/lang/de.json +++ b/packages/editor/lang/de.json @@ -4,6 +4,18 @@ }, "editor.try-welcome-description": { "defaultMessage": "Melden Sie sich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen." + }, + "editor.try-welcome-mobile": { + "defaultMessage": "Diese Edition zeigt einige der Mindmap-Funktionen!" + }, + "editor.try-welcome-description-mobile": { + "defaultMessage": "Melden Sie sich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen. Eingeschränkte Funktionen der Mindmap-Edition werden auf Mobilgeräten unterstützt. Verwenden Sie den Desktop-Browser für vollständige Editorfunktionen." + }, + "editor.edit-mobile": { + "defaultMessage": "Hinweis für Mobilgeräte." + }, + "editor.edit-description-mobile": { + "defaultMessage": "Eingeschränkte Funktionen der Mindmap-Edition werden auf Mobilgeräten unterstützt. Verwenden Sie den Desktop-Browser für vollständige Editorfunktionen." }, "login.signup": { "defaultMessage": "Anmeldung" diff --git a/packages/editor/lang/en.json b/packages/editor/lang/en.json index c1eaa0bd..233007e1 100644 --- a/packages/editor/lang/en.json +++ b/packages/editor/lang/en.json @@ -1,9 +1,21 @@ { "editor.try-welcome": { - "defaultMessage": "This edition space showcases some of the mindmap editor capabilities !" + "defaultMessage": "This edition space showcases some of the mindmap editor capabilities!" }, "editor.try-welcome-description": { - "defaultMessage": "Sign Up to start creating, sharing and publishing unlimited number of mindmaps for free." + "defaultMessage": "Sign Up to start creating, sharing and publishing unlimited number of mindmaps for free." + }, + "editor.try-welcome-mobile": { + "defaultMessage": "This edition space showcases some of the mindmap capabilities!" + }, + "editor.try-welcome-description-mobile": { + "defaultMessage": "Sign Up to start creating, sharing and publishing unlimited number of mindmaps for free. Limited mindmap edition capabilties are supported in Mobile devices. Use Desktop browser for full editor capabilies." + }, + "editor.edit-mobile": { + "defaultMessage": "Note for mobile devices." + }, + "editor.edit-description-mobile": { + "defaultMessage": "Limited mindmap edition capabilities are supported in Mobile devices. Use Desktop browser for full editor capabilities." }, "login.signup": { "defaultMessage": "Sign Up" diff --git a/packages/editor/lang/es.json b/packages/editor/lang/es.json index df4a128a..0707cc4e 100644 --- a/packages/editor/lang/es.json +++ b/packages/editor/lang/es.json @@ -4,6 +4,18 @@ }, "editor.try-welcome-description": { "defaultMessage": "Registrate para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita." + }, + "editor.try-welcome-mobile": { + "defaultMessage": "¡Este espacio de edición muestra algunas de las capacidades de mapas mentales!" + }, + "editor.try-welcome-description-mobile": { + "defaultMessage": "Registrate para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita. En dispositivos móbiles las funciones son limitadas. Use la versión de escritorio para tener las funciones completas." + }, + "editor.edit-mobile": { + "defaultMessage": "Nota para dispositivos móbiles." + }, + "editor.edit-description-mobile": { + "defaultMessage": "En dispositivos móbiles las funciones son limitadas. Use la versión de escritorio para tener las funciones completas." }, "login.signup": { "defaultMessage": "Crear cuenta" diff --git a/packages/editor/lang/fr.json b/packages/editor/lang/fr.json index ce7af6f5..4832052b 100644 --- a/packages/editor/lang/fr.json +++ b/packages/editor/lang/fr.json @@ -1,9 +1,21 @@ { "editor.try-welcome": { - "defaultMessage": "Cet espace d'édition présente certaines des fonctionnalités de l'éditeur de cartes mentales !" + "defaultMessage": "Cet espace d'édition présente certaines des fonctionnalités de l'éditeur de cartes mentales!" }, "editor.try-welcome-description": { "defaultMessage": "Inscrivez-vous pour commencer à créer, partager et publier gratuitement un nombre illimité de cartes mentales." + }, + "editor.try-welcome-mobile": { + "defaultMessage": "Cet espace d'édition présente certaines des fonctionnalités des cartes mentales!" + }, + "editor.try-welcome-description-mobile": { + "defaultMessage": "Inscrivez-vous pour commencer à créer, partager et publier gratuitement un nombre illimité de cartes mentales. Les capacités d'édition limitées de mindmap sont prises en charge dans les appareils mobiles. Utilisez le navigateur de bureau pour bénéficier de toutes les fonctionnalités de l'éditeur." + }, + "editor.edit-mobile": { + "defaultMessage": "Remarque pour les appareils mobiles." + }, + "editor.edit-description-mobile": { + "defaultMessage": "Les capacités d'édition limitées de mindmap sont prises en charge dans les appareils mobiles. Utilisez le navigateur de bureau pour bénéficier de toutes les fonctionnalités de l'éditeur." }, "login.signup": { "defaultMessage": "S'inscrire" diff --git a/packages/editor/lang/ru.json b/packages/editor/lang/ru.json index e954afb0..72e549b5 100644 --- a/packages/editor/lang/ru.json +++ b/packages/editor/lang/ru.json @@ -4,6 +4,18 @@ }, "editor.try-welcome-description": { "defaultMessage": "Чтобы получить бесплатный неограниченный доступ — нужна только регистрация." + }, + "editor.try-welcome-mobile": { + "defaultMessage": "В этом издании демонстрируются некоторые возможности ментальных карт!" + }, + "editor.try-welcome-description-mobile": { + "defaultMessage": "Зарегистрируйтесь, чтобы начать создавать, делиться и публиковать неограниченное количество ментальных карт бесплатно. Возможности ограниченной версии Mindmap поддерживаются на мобильных устройствах. Используйте настольный браузер для полных возможностей редактора." + }, + "editor.edit-mobile": { + "defaultMessage": "Примечание для мобильных устройств." + }, + "editor.edit-description-mobile": { + "defaultMessage": "Возможности ограниченной версии Mindmap поддерживаются на мобильных устройствах. Используйте настольный браузер для полных возможностей редактора." }, "login.signup": { "defaultMessage": "Регистрация" diff --git a/packages/editor/lang/zh.json b/packages/editor/lang/zh.json index ecea81dc..cfc1a00f 100644 --- a/packages/editor/lang/zh.json +++ b/packages/editor/lang/zh.json @@ -1,14 +1,26 @@ { - "editor.try-welcome": { - "defaultMessage": "这个编辑区域展示了一些思维导图编辑器的功能!" - }, - "editor.try-welcome-description": { - "defaultMessage": "注册后可以免费创建、分享和发布无限数量的思维导图。" - }, - "login.signup": { - "defaultMessage": "注册" - }, - "action.share": { - "defaultMessage": "分享" - } + "editor.try-welcome": { + "defaultMessage": "这个编辑区域展示了一些思维导图编辑器的功能!" + }, + "editor.try-welcome-description": { + "defaultMessage": "注册后可以免费创建、分享和发布无限数量的思维导图。" + }, + "editor.try-welcome-mobile": { + "defaultMessage": "这个版本空间展示了一些思维导图功能!" + }, + "editor.try-welcome-description-mobile": { + "defaultMessage": "注册以开始免费创建、共享和发布无限数量的思维导图。 移动设备支持有限的思维导图编辑功能。 使用桌面浏览器获得完整的编辑器功能。" + }, + "editor.edit-mobile": { + "defaultMessage": "移动设备注意事项." + }, + "editor.edit-description-mobile": { + "defaultMessage": "移动设备支持有限的思维导图编辑功能。 使用桌面浏览器获得完整的编辑器功能。" + }, + "login.signup": { + "defaultMessage": "注册" + }, + "action.share": { + "defaultMessage": "分享" + } } \ No newline at end of file diff --git a/packages/editor/src/classes/menu/Menu.ts b/packages/editor/src/classes/menu/Menu.ts index 40d20db3..1cd16a93 100644 --- a/packages/editor/src/classes/menu/Menu.ts +++ b/packages/editor/src/classes/menu/Menu.ts @@ -61,7 +61,9 @@ class Menu extends IMenu { this._addButton('position', false, false, () => { designer.zoomToFit(); }); - Menu._registerTooltip('position', $msg('CENTER_POSITION')); + // Disabled because this tooltip overflows the screen and makes the button un-clickeable + // This should be enabled when migrating to material-ui + //Menu._registerTooltip('position', $msg('CENTER_POSITION')); // Edition actions ... if (!readOnly) { @@ -181,7 +183,9 @@ class Menu extends IMenu { designer.changeBorderColor(hex); }, }; - this._toolbarElems.push(new ColorPalettePanel('topicBorder', borderColorModel, widgetsBaseUrl)); + this._toolbarElems.push( + new ColorPalettePanel('topicBorder', borderColorModel, widgetsBaseUrl), + ); Menu._registerTooltip('topicBorder', $msg('TOPIC_BORDER_COLOR')); const fontColorModel = { @@ -271,14 +275,12 @@ class Menu extends IMenu { }); Menu._registerTooltip('fontItalic', $msg('FONT_ITALIC'), $msg('CTRL') + ' + I'); - if (!readOnly) { // Register action on save ... const saveElem = $('#save'); - this._addButton('save', false, false, - () => { - this.save(saveElem, designer, true); - }); + this._addButton('save', false, false, () => { + this.save(saveElem, designer, true); + }); Menu._registerTooltip('save', $msg('SAVE'), $msg('CTRL') + ' + S'); // Register unload save ... @@ -290,13 +292,11 @@ class Menu extends IMenu { }); // Autosave on a fixed period of time ... - setInterval( - () => { - if (this.isSaveRequired()) { - this.save(saveElem, designer, false); - } - }, 10000, - ); + setInterval(() => { + if (this.isSaveRequired()) { + this.save(saveElem, designer, false); + } + }, 10000); } } @@ -394,10 +394,14 @@ class Menu extends IMenu { // Register Events ... let result = null; if ($(`#${buttonId}`)) { - const button = new ToolbarItem(buttonId, ((event) => { - fn(event); - this.clear(); - }), { topicAction: isTopic, relAction: isRelationship }); + const button = new ToolbarItem( + buttonId, + (event) => { + fn(event); + this.clear(); + }, + { topicAction: isTopic, relAction: isRelationship }, + ); this._toolbarElems.push(button); result = button; @@ -409,9 +413,10 @@ class Menu extends IMenu { if ($(`#${buttonId}`)) { let tooltip = text; if (shortcut) { - const platformedShortcut = navigator.appVersion.indexOf('Mac') !== -1 - ? shortcut.replace('meta+', '⌘') - : shortcut.replace('meta+', 'ctrl+'); + const platformedShortcut = + navigator.appVersion.indexOf('Mac') !== -1 + ? shortcut.replace('meta+', '⌘') + : shortcut.replace('meta+', 'ctrl+'); tooltip = `${tooltip} (${platformedShortcut})`; } return new KeyboardShortcutTooltip($(`#${buttonId}`), tooltip); diff --git a/packages/editor/src/compiled-lang/de.json b/packages/editor/src/compiled-lang/de.json index ac8ea4ac..a455e2a8 100644 --- a/packages/editor/src/compiled-lang/de.json +++ b/packages/editor/src/compiled-lang/de.json @@ -5,6 +5,18 @@ "value": "Teilen" } ], + "editor.edit-description-mobile": [ + { + "type": 0, + "value": "Eingeschränkte Funktionen der Mindmap-Edition werden auf Mobilgeräten unterstützt. Verwenden Sie den Desktop-Browser für vollständige Editorfunktionen." + } + ], + "editor.edit-mobile": [ + { + "type": 0, + "value": "Hinweis für Mobilgeräte." + } + ], "editor.try-welcome": [ { "type": 0, @@ -17,6 +29,18 @@ "value": "Melden Sie sich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen." } ], + "editor.try-welcome-description-mobile": [ + { + "type": 0, + "value": "Melden Sie sich an, um kostenlos eine unbegrenzte Anzahl von Mindmaps zu erstellen, zu teilen und zu veröffentlichen. Eingeschränkte Funktionen der Mindmap-Edition werden auf Mobilgeräten unterstützt. Verwenden Sie den Desktop-Browser für vollständige Editorfunktionen." + } + ], + "editor.try-welcome-mobile": [ + { + "type": 0, + "value": "Diese Edition zeigt einige der Mindmap-Funktionen!" + } + ], "login.signup": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/en.json b/packages/editor/src/compiled-lang/en.json index ab5c90b6..f466aad6 100644 --- a/packages/editor/src/compiled-lang/en.json +++ b/packages/editor/src/compiled-lang/en.json @@ -5,10 +5,22 @@ "value": "Share" } ], + "editor.edit-description-mobile": [ + { + "type": 0, + "value": "Limited mindmap edition capabilities are supported in Mobile devices. Use Desktop browser for full editor capabilities." + } + ], + "editor.edit-mobile": [ + { + "type": 0, + "value": "Note for mobile devices." + } + ], "editor.try-welcome": [ { "type": 0, - "value": "This edition space showcases some of the mindmap editor capabilities !" + "value": "This edition space showcases some of the mindmap editor capabilities!" } ], "editor.try-welcome-description": [ @@ -17,6 +29,18 @@ "value": "Sign Up to start creating, sharing and publishing unlimited number of mindmaps for free." } ], + "editor.try-welcome-description-mobile": [ + { + "type": 0, + "value": "Sign Up to start creating, sharing and publishing unlimited number of mindmaps for free. Limited mindmap edition capabilties are supported in Mobile devices. Use Desktop browser for full editor capabilies." + } + ], + "editor.try-welcome-mobile": [ + { + "type": 0, + "value": "This edition space showcases some of the mindmap capabilities!" + } + ], "login.signup": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/es.json b/packages/editor/src/compiled-lang/es.json index 19ff2e8a..65e44628 100644 --- a/packages/editor/src/compiled-lang/es.json +++ b/packages/editor/src/compiled-lang/es.json @@ -5,6 +5,18 @@ "value": "Compartir" } ], + "editor.edit-description-mobile": [ + { + "type": 0, + "value": "En dispositivos móbiles las funciones son limitadas. Use la versión de escritorio para tener las funciones completas." + } + ], + "editor.edit-mobile": [ + { + "type": 0, + "value": "Nota para dispositivos móbiles." + } + ], "editor.try-welcome": [ { "type": 0, @@ -17,6 +29,18 @@ "value": "Registrate para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita." } ], + "editor.try-welcome-description-mobile": [ + { + "type": 0, + "value": "Registrate para comenzar a crear, compartir y publicar una cantidad ilimitada de mapas mentales de forma gratuita. En dispositivos móbiles las funciones son limitadas. Use la versión de escritorio para tener las funciones completas." + } + ], + "editor.try-welcome-mobile": [ + { + "type": 0, + "value": "¡Este espacio de edición muestra algunas de las capacidades de mapas mentales!" + } + ], "login.signup": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/fr.json b/packages/editor/src/compiled-lang/fr.json index a7f74b02..beab84d3 100644 --- a/packages/editor/src/compiled-lang/fr.json +++ b/packages/editor/src/compiled-lang/fr.json @@ -5,10 +5,22 @@ "value": "Partager" } ], + "editor.edit-description-mobile": [ + { + "type": 0, + "value": "Les capacités d'édition limitées de mindmap sont prises en charge dans les appareils mobiles. Utilisez le navigateur de bureau pour bénéficier de toutes les fonctionnalités de l'éditeur." + } + ], + "editor.edit-mobile": [ + { + "type": 0, + "value": "Remarque pour les appareils mobiles." + } + ], "editor.try-welcome": [ { "type": 0, - "value": "Cet espace d'édition présente certaines des fonctionnalités de l'éditeur de cartes mentales !" + "value": "Cet espace d'édition présente certaines des fonctionnalités de l'éditeur de cartes mentales!" } ], "editor.try-welcome-description": [ @@ -17,6 +29,18 @@ "value": "Inscrivez-vous pour commencer à créer, partager et publier gratuitement un nombre illimité de cartes mentales." } ], + "editor.try-welcome-description-mobile": [ + { + "type": 0, + "value": "Inscrivez-vous pour commencer à créer, partager et publier gratuitement un nombre illimité de cartes mentales. Les capacités d'édition limitées de mindmap sont prises en charge dans les appareils mobiles. Utilisez le navigateur de bureau pour bénéficier de toutes les fonctionnalités de l'éditeur." + } + ], + "editor.try-welcome-mobile": [ + { + "type": 0, + "value": "Cet espace d'édition présente certaines des fonctionnalités des cartes mentales!" + } + ], "login.signup": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/ru.json b/packages/editor/src/compiled-lang/ru.json index 6a9236c3..716d0b29 100644 --- a/packages/editor/src/compiled-lang/ru.json +++ b/packages/editor/src/compiled-lang/ru.json @@ -5,6 +5,18 @@ "value": "Поделиться" } ], + "editor.edit-description-mobile": [ + { + "type": 0, + "value": "Возможности ограниченной версии Mindmap поддерживаются на мобильных устройствах. Используйте настольный браузер для полных возможностей редактора." + } + ], + "editor.edit-mobile": [ + { + "type": 0, + "value": "Примечание для мобильных устройств." + } + ], "editor.try-welcome": [ { "type": 0, @@ -17,6 +29,18 @@ "value": "Чтобы получить бесплатный неограниченный доступ — нужна только регистрация." } ], + "editor.try-welcome-description-mobile": [ + { + "type": 0, + "value": "Зарегистрируйтесь, чтобы начать создавать, делиться и публиковать неограниченное количество ментальных карт бесплатно. Возможности ограниченной версии Mindmap поддерживаются на мобильных устройствах. Используйте настольный браузер для полных возможностей редактора." + } + ], + "editor.try-welcome-mobile": [ + { + "type": 0, + "value": "В этом издании демонстрируются некоторые возможности ментальных карт!" + } + ], "login.signup": [ { "type": 0, diff --git a/packages/editor/src/compiled-lang/zh.json b/packages/editor/src/compiled-lang/zh.json index e0ab537c..69e858e6 100644 --- a/packages/editor/src/compiled-lang/zh.json +++ b/packages/editor/src/compiled-lang/zh.json @@ -5,6 +5,18 @@ "value": "分享" } ], + "editor.edit-description-mobile": [ + { + "type": 0, + "value": "移动设备支持有限的思维导图编辑功能。 使用桌面浏览器获得完整的编辑器功能。" + } + ], + "editor.edit-mobile": [ + { + "type": 0, + "value": "移动设备注意事项." + } + ], "editor.try-welcome": [ { "type": 0, @@ -17,6 +29,18 @@ "value": "注册后可以免费创建、分享和发布无限数量的思维导图。" } ], + "editor.try-welcome-description-mobile": [ + { + "type": 0, + "value": "注册以开始免费创建、共享和发布无限数量的思维导图。 移动设备支持有限的思维导图编辑功能。 使用桌面浏览器获得完整的编辑器功能。" + } + ], + "editor.try-welcome-mobile": [ + { + "type": 0, + "value": "这个版本空间展示了一些思维导图功能!" + } + ], "login.signup": [ { "type": 0, diff --git a/packages/editor/src/components/footer/index.tsx b/packages/editor/src/components/footer/index.tsx index 1b10f9b0..dae9ba4d 100644 --- a/packages/editor/src/components/footer/index.tsx +++ b/packages/editor/src/components/footer/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { StyledLogo, Notifier } from './styled'; import { useIntl } from 'react-intl'; @@ -6,51 +6,99 @@ import KeyboardSvg from '../../../images/keyboard.svg'; import AddSvg from '../../../images/add.svg'; import MinusSvg from '../../../images/minus.svg'; import CenterFocusSvg from '../../../images/center_focus.svg'; +import CloseDialogSvg from '../../../images/close-dialog-icon.svg'; + import ActionButton from '../action-button'; import { EditorRenderMode } from '@wisemapping/mindplot'; export type FooterPropsType = { - editorMode: EditorRenderMode; + editorMode: EditorRenderMode; + isMobile: boolean; }; -const Footer = ({ editorMode }: FooterPropsType): React.ReactElement => { - const intl = useIntl(); +const Footer = ({ editorMode, isMobile }: FooterPropsType): React.ReactElement => { + const intl = useIntl(); + const [dialogClass, setDialogClass] = useState('tryInfoPanel'); - return ( - <> -
-
- -
-
- - -
-
- -
+ var titleKey = undefined; + var descriptionKey = undefined; + var showSignupButton = undefined; + + if (editorMode !== 'viewonly' && editorMode !== 'showcase' && isMobile) { + titleKey = 'editor.edit-mobile'; + descriptionKey = 'editor.edit-description-mobile'; + showSignupButton = false; + } + if (editorMode === 'showcase' && isMobile) { + titleKey = 'editor.try-welcome-mobile'; + descriptionKey = 'editor.edit-description-mobile'; + showSignupButton = true; + } + if (editorMode === 'showcase' && !isMobile) { + titleKey = 'editor.try-welcome'; + descriptionKey = 'editor.try-welcome-description'; + showSignupButton = true; + } + + // if the toolbar is present, the alert must not overlap + var alertTopAdjustmentStyle = + editorMode !== 'viewonly' && !isMobile + ? 'tryInfoPanelWithToolbar' + : 'tryInfoPanelWithoutToolbar'; + + return ( + <> +
+ {!isMobile && ( +
+ +
+ )} +
+ + +
+
+ +
+
+ + + {titleKey && ( +
+
+
+
- - - {editorMode === 'showcase' && ( -
-

{intl.formatMessage({ id: 'editor.try-welcome' })}

-

{intl.formatMessage({ id: 'editor.try-welcome-description' })}

- - - {intl.formatMessage({ id: 'login.signup', defaultMessage: 'Sign Up' })} - - -
+

+ {intl.formatMessage({ id: titleKey })} {intl.formatMessage({ id: descriptionKey })} +

+ {showSignupButton && ( + + + {intl.formatMessage({ id: 'login.signup', defaultMessage: 'Sign Up' })} + + )} - - ); +
+
+ )} + + ); }; export default Footer; diff --git a/packages/editor/src/global-styled.css b/packages/editor/src/global-styled.css index 06d15195..632406d9 100644 --- a/packages/editor/src/global-styled.css +++ b/packages/editor/src/global-styled.css @@ -9,6 +9,19 @@ html { font-size: initial; } +body { + width: 100vw; + height: 100vh; + min-width: 100vw; + min-height: 100vh; + margin: 0px; +} + +.mindplot-root { + width: 100%; + height: 100%; +} + div#mindplot { position: relative; top: 50px; @@ -201,21 +214,69 @@ div#shotcuts > img{ color: #ffffff; } -div#tryInfoPanel { - position: absolute; - margin: auto; - text-align: center; - top: 80px; - left: 20px; - width: 200px; - padding: 20px; - font-size: 15px; - border-radius: 9px; - background-color: white; - border: solid 2px #ffa800; +.tryInfoPanel { + position: absolute; + text-align: center; + left: 0; + right: 0; + background-color: white; + border: solid 2px #ffa800; + margin: auto; + width: 99%; + border-radius: 9px; + width: 96%; } -#tryInfoPanel > p { +@media (min-width: 600px) { + .tryInfoPanel { + font-size: 15px; + } +} + +@media (max-width: 600px) { + .tryInfoPanel { + font-size: 13px; + } +} + +.tryInfoPanel .tryInfoPanelInner { + padding-top: 10px; + padding-bottom: 10px; + padding-left: 5px; + padding-right: 5px; +} + +.tryInfoPanel .tryInfoPanelInner .closeButton { + position: absolute; + top: 5px; + right: 5px; +} + +.tryInfoPanel .tryInfoPanelInner .closeButton button { + cursor: pointer; + border-style: hidden; + background-color: transparent; + padding: 0px; +} + +.tryInfoPanel .tryInfoPanelInner .closeButton button img { + width: 18px; + height: 18px; + filter: invert(73%) sepia(21%) saturate(4699%) hue-rotate(357deg) brightness(98%) contrast(108%); +} + +.tryInfoPanelWithToolbar { + top: 55px; +} + +.tryInfoPanelWithoutToolbar { + top: 5px; +} + +.tryInfoPanelClosed { + display: none; +} + +.tryInfoPanel > p { justify-content: center; - padding-bottom: 20px; } \ No newline at end of file diff --git a/packages/editor/src/index.tsx b/packages/editor/src/index.tsx index eed9732f..37e4fd41 100644 --- a/packages/editor/src/index.tsx +++ b/packages/editor/src/index.tsx @@ -1,122 +1,141 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import Toolbar, { ToolbarActionType } from './components/toolbar'; import Footer from './components/footer'; import { IntlProvider } from 'react-intl'; import { - $notify, - buildDesigner, - PersistenceManager, - DesignerOptionsBuilder, - Designer, - DesignerKeyboard, - EditorRenderMode, + $notify, + buildDesigner, + PersistenceManager, + DesignerOptionsBuilder, + Designer, + DesignerKeyboard, + EditorRenderMode, } from '@wisemapping/mindplot'; import './global-styled.css'; import I18nMsg from './classes/i18n-msg'; import Menu from './classes/menu/Menu'; declare global { - // used in mindplot - var designer: Designer; - var accountEmail: string; + // used in mindplot + var designer: Designer; + var accountEmail: string; } export type EditorOptions = { - mode: EditorRenderMode, - locale: string, - zoom?: number, - locked?: boolean, - lockedMsg?: string; - mapTitle: string; - enableKeyboardEvents: boolean; -} - -export type EditorProps = { - mapId: string; - options: EditorOptions; - persistenceManager: PersistenceManager; - onAction: (action: ToolbarActionType) => void; - onLoad?: (designer: Designer) => void; + mode: EditorRenderMode; + locale: string; + zoom?: number; + locked?: boolean; + lockedMsg?: string; + mapTitle: string; + enableKeyboardEvents: boolean; }; -const Editor = ({ - mapId, - options, - persistenceManager, - onAction, - onLoad, -}: EditorProps) => { +export type EditorProps = { + mapId: string; + options: EditorOptions; + persistenceManager: PersistenceManager; + onAction: (action: ToolbarActionType) => void; + onLoad?: (designer: Designer) => void; +}; - useEffect(() => { - // Change page title ... - document.title = `${options.mapTitle} | WiseMapping `; +const Editor = ({ mapId, options, persistenceManager, onAction, onLoad }: EditorProps) => { + const [isMobile, setIsMobile] = useState(undefined); - // Load mindmap ... - const designer = onLoadDesigner(mapId, options, persistenceManager); - // Has extended actions been customized ... - if (onLoad) { - onLoad(designer); - } + useEffect(() => { + // Change page title ... + document.title = `${options.mapTitle} | WiseMapping `; - // Load mindmap ... - const instance = PersistenceManager.getInstance(); - const mindmap = instance.load(mapId); - designer.loadMap(mindmap); + // Load mindmap ... + const designer = onLoadDesigner(mapId, options, persistenceManager); + // Has extended actions been customized ... + if (onLoad) { + onLoad(designer); + } - if (options.locked) { - $notify(options.lockedMsg, false); - } - }, []); + // Load mindmap ... + const instance = PersistenceManager.getInstance(); + const mindmap = instance.load(mapId); + designer.loadMap(mindmap); - useEffect(() => { - if (options.enableKeyboardEvents) { - DesignerKeyboard.resume(); - } else { - DesignerKeyboard.pause(); - } - }, [options.enableKeyboardEvents]); + setIsMobile(checkMobile()); - const onLoadDesigner = (mapId: string, options: EditorOptions, persistenceManager: PersistenceManager): Designer => { - const buildOptions = DesignerOptionsBuilder.buildOptions({ - persistenceManager, - mode: options.mode, - mapId: mapId, - container: 'mindplot', - zoom: options.zoom, - locale: options.locale, - }); + if (options.locked) { + $notify(options.lockedMsg, false); + } + }, []); - // Build designer ... - const result = buildDesigner(buildOptions); + useEffect(() => { + if (options.enableKeyboardEvents) { + DesignerKeyboard.resume(); + } else { + DesignerKeyboard.pause(); + } + }, [options.enableKeyboardEvents]); - // Register toolbar event ... - if (options.mode === 'edition-owner' || options.mode === 'edition-editor' || options.mode === 'edition-viewer' || options.mode === 'showcase') { - const menu = new Menu(designer, 'toolbar'); + const checkMobile = () => { + const check = + /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test( + navigator.userAgent.toLowerCase(), + ) || + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( + navigator.userAgent.toLowerCase().substring(0, 4), + ); + return check; + }; - // If a node has focus, focus can be move to another node using the keys. - designer.cleanScreen = () => { - menu.clear(); - }; - } - return result; + const onLoadDesigner = ( + mapId: string, + options: EditorOptions, + persistenceManager: PersistenceManager, + ): Designer => { + const buildOptions = DesignerOptionsBuilder.buildOptions({ + persistenceManager, + mode: options.mode, + mapId: mapId, + container: 'mindplot', + zoom: options.zoom, + locale: options.locale, + }); - }; + // Build designer ... + const result = buildDesigner(buildOptions); - const locale = options.locale; - const msg = I18nMsg.loadLocaleData(locale); - const mindplotStyle = (options.mode === 'viewonly') ? { top: 0 } : { top: 'inherit' }; - return ( - - {(options.mode !== 'viewonly') && - - } -
-
-