diff --git a/packages/mindplot/src/components/CentralTopic.ts b/packages/mindplot/src/components/CentralTopic.ts index 5164b6fa..85908a28 100644 --- a/packages/mindplot/src/components/CentralTopic.ts +++ b/packages/mindplot/src/components/CentralTopic.ts @@ -35,7 +35,6 @@ class CentralTopic extends Topic { }); } - workoutIncomingConnectionPoint(): Point { return this.getPosition(); } diff --git a/packages/mindplot/src/components/DesignerKeyboard.ts b/packages/mindplot/src/components/DesignerKeyboard.ts index 45bdd562..4de8d09a 100644 --- a/packages/mindplot/src/components/DesignerKeyboard.ts +++ b/packages/mindplot/src/components/DesignerKeyboard.ts @@ -22,7 +22,8 @@ import { Designer } from '..'; import Topic from './Topic'; class DesignerKeyboard extends Keyboard { - static _instance: any; + // eslint-disable-next-line no-use-before-define + static _instance: DesignerKeyboard; constructor(designer: Designer) { super(); @@ -79,14 +80,14 @@ class DesignerKeyboard extends Keyboard { this.addShortcut( ['tab'], (eventevent: Event) => { designer.createChildForSelectedNode(); - event.preventDefault(); - event.stopPropagation(); + eventevent.preventDefault(); + eventevent.stopPropagation(); }, ); this.addShortcut( ['meta+enter'], (eventevent: Event) => { - event.preventDefault(); - event.stopPropagation(); + eventevent.preventDefault(); + eventevent.stopPropagation(); designer.createChildForSelectedNode(); }, ); @@ -244,7 +245,7 @@ class DesignerKeyboard extends Keyboard { const excludes = ['esc', 'escape', 'f1', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12']; $(document).on('keypress', (event) => { - let keyCode; + let keyCode: number; // Firefox doesn't skip special keys for keypress event... if (event.key && excludes.includes(event.key.toLowerCase())) { return; @@ -256,6 +257,7 @@ class DesignerKeyboard extends Keyboard { keyCode = event.keyCode; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any const jq: any = $; const specialKey = jq.hotkeys.specialKeys[keyCode]; if (['enter', 'capslock'].indexOf(specialKey) === -1 && !jq.hotkeys.shiftNums[keyCode]) { diff --git a/packages/mindplot/src/components/MainTopic.ts b/packages/mindplot/src/components/MainTopic.ts index ad0a6b43..c5db2dd8 100644 --- a/packages/mindplot/src/components/MainTopic.ts +++ b/packages/mindplot/src/components/MainTopic.ts @@ -27,6 +27,7 @@ import SizeType from './SizeType'; class MainTopic extends Topic { private INNER_RECT_ATTRIBUTES: { stroke: string; }; + /** * @extends mindplot.Topic * @constructs @@ -74,7 +75,6 @@ class MainTopic extends Topic { return group; } - updateTopicShape(targetTopic: Topic) { // Change figure based on the connected topic ... const model = this.getModel(); diff --git a/packages/mindplot/src/components/ShrinkConnector.ts b/packages/mindplot/src/components/ShrinkConnector.ts index bb8aea96..271e690c 100644 --- a/packages/mindplot/src/components/ShrinkConnector.ts +++ b/packages/mindplot/src/components/ShrinkConnector.ts @@ -20,11 +20,12 @@ import { Elipse } from '@wisemapping/web2d'; import TopicConfig from './TopicConfig'; import ActionDispatcher from './ActionDispatcher'; import Topic from './Topic'; -import IconGroup from './IconGroup'; class ShirinkConnector { private _isShrink: boolean; - private _ellipse: any; + + private _ellipse: Elipse; + constructor(topic: Topic) { this._isShrink = false; const ellipse = new Elipse(TopicConfig.INNER_RECT_ATTRIBUTES); @@ -33,7 +34,7 @@ class ShirinkConnector { ellipse.setFill('rgb(62,118,179)'); ellipse.setSize(TopicConfig.CONNECTOR_WIDTH, TopicConfig.CONNECTOR_WIDTH); - ellipse.addEvent('click', (event) => { + ellipse.addEvent('click', (event: Event) => { const model = topic.getModel(); const collapse = !model.areChildrenShrunken(); diff --git a/packages/mindplot/src/components/Topic.ts b/packages/mindplot/src/components/Topic.ts index a4249b84..3e5f6989 100644 --- a/packages/mindplot/src/components/Topic.ts +++ b/packages/mindplot/src/components/Topic.ts @@ -19,7 +19,7 @@ import $ from 'jquery'; import { $assert, $defined } from '@wisemapping/core-js'; import { - Rect, Image, Line, Text, Group, ElementClass, Point + Rect, Image, Line, Text, Group, ElementClass, Point, } from '@wisemapping/web2d'; import NodeGraph from './NodeGraph'; @@ -35,7 +35,6 @@ import NoteEditor from './widget/NoteEditor'; import ActionDispatcher from './ActionDispatcher'; import LinkEditor from './widget/LinkEditor'; - import TopicEventDispatcher, { TopicEvent } from './TopicEventDispatcher'; import { TopicShape } from './model/INodeModel'; import NodeModel from './model/NodeModel'; @@ -50,14 +49,25 @@ const ICON_SCALING_FACTOR = 1.3; abstract class Topic extends NodeGraph { private _innerShape: ElementClass; + private _relationships: Relationship[]; + private _isInWorkspace: boolean; + + // eslint-disable-next-line no-use-before-define private _children: Topic[]; + + // eslint-disable-next-line no-use-before-define private _parent: Topic | null; + private _outerShape: ElementClass; + private _text: Text | null; + private _iconsGroup: IconGroup; - private _connector: any; + + private _connector: ShirinkConnector; + private _outgoingLine: Line; constructor(model: NodeModel, options) { @@ -241,7 +251,7 @@ abstract class Topic extends NodeGraph { result.setStroke(1, 'solid', stokeColor); }; - result.getSize = function getSize() { this.size }; + result.getSize = function getSize() { return this.size; }; result.setPosition = () => { // Overwrite behaviour ... @@ -1324,7 +1334,6 @@ abstract class Topic extends NodeGraph { return result; } - isChildTopic(childTopic: Topic): boolean { let result = this.getId() === childTopic.getId(); if (!result) { diff --git a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts index ea89bbb9..952e6562 100644 --- a/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts +++ b/packages/mindplot/src/components/commands/AddFeatureToTopicCommand.ts @@ -18,6 +18,7 @@ import { $assert, $defined } from '@wisemapping/core-js'; import Command from '../Command'; import CommandContext from '../CommandContext'; +import FeatureModel from '../model/FeatureModel'; import FeatureType from '../model/FeatureType'; class AddFeatureToTopicCommand extends Command { @@ -27,7 +28,7 @@ class AddFeatureToTopicCommand extends Command { private _attributes: object; - private _featureModel: any; + private _featureModel: FeatureModel; /* * @classdesc This command class handles do/undo of adding features to topics, e.g. an diff --git a/packages/mindplot/src/components/commands/ChangeFeatureToTopicCommand.ts b/packages/mindplot/src/components/commands/ChangeFeatureToTopicCommand.ts index 98069885..07253e15 100644 --- a/packages/mindplot/src/components/commands/ChangeFeatureToTopicCommand.ts +++ b/packages/mindplot/src/components/commands/ChangeFeatureToTopicCommand.ts @@ -24,9 +24,9 @@ class ChangeFeatureToTopicCommand extends Command { private _topicId: number; - private _attributes: any; + private _attributes; - constructor(topicId: number, featureId: number, attributes: any) { + constructor(topicId: number, featureId: number, attributes) { $assert($defined(topicId), 'topicId can not be null'); $assert($defined(featureId), 'featureId can not be null'); $assert($defined(attributes), 'attributes can not be null'); @@ -53,7 +53,7 @@ class ChangeFeatureToTopicCommand extends Command { * Overrides abstract parent method * @see {@link mindplot.Command.undoExecute} */ - undoExecute(commandContext: any) { + undoExecute(commandContext: CommandContext) { this.execute(commandContext); } } diff --git a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts index 22da44bb..85f9868a 100644 --- a/packages/mindplot/src/components/commands/MoveControlPointCommand.ts +++ b/packages/mindplot/src/components/commands/MoveControlPointCommand.ts @@ -16,13 +16,14 @@ * limitations under the License. */ import { $assert, $defined } from '@wisemapping/core-js'; +import { Line } from '@wisemapping/web2d'; import Command from '../Command'; import ControlPoint from '../ControlPoint'; class MoveControlPointCommand extends Command { private _ctrlPointControler: ControlPoint; - private _line: any; + private _line: Line; private _controlPoint: any; diff --git a/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js b/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js index f982bf11..303c5221 100644 --- a/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js +++ b/packages/mindplot/src/components/libraries/bootstrap/BootstrapDialog.js @@ -112,7 +112,7 @@ class BootstrapDialog extends Options { return header; } - onAcceptClick(event) { + onAcceptClick() { throw new Error('Unsupported operation'); } @@ -120,7 +120,7 @@ class BootstrapDialog extends Options { // Overwrite default behaviour ... } - onRemoveClick(event) { + onRemoveClick() { throw new Error('Unsupported operation'); } diff --git a/packages/webapp/src/classes/client/rest-client/index.ts b/packages/webapp/src/classes/client/rest-client/index.ts index 942472e7..5fdd6285 100644 --- a/packages/webapp/src/classes/client/rest-client/index.ts +++ b/packages/webapp/src/classes/client/rest-client/index.ts @@ -11,7 +11,7 @@ import Client, { ImportMapInfo, Permission, } from '..'; -import { LocaleCode, localeFromStr, Locales } from '../../app-i18n'; +import { LocaleCode, localeFromStr } from '../../app-i18n'; export default class RestClient implements Client { private baseUrl: string; diff --git a/packages/webapp/src/components/form/input/index.tsx b/packages/webapp/src/components/form/input/index.tsx index 2d4b0ae2..806a2524 100644 --- a/packages/webapp/src/components/form/input/index.tsx +++ b/packages/webapp/src/components/form/input/index.tsx @@ -1,5 +1,4 @@ import TextField from '@mui/material/TextField'; -import { row } from '@wisemapping/mindplot/src/components/widget/ColorPaletteHtml'; import React, { ChangeEvent } from 'react'; import { ErrorInfo } from '../../../classes/client'; diff --git a/packages/webapp/src/components/maps-page/language-menu/index.tsx b/packages/webapp/src/components/maps-page/language-menu/index.tsx index b89ea31b..676a0bbb 100644 --- a/packages/webapp/src/components/maps-page/language-menu/index.tsx +++ b/packages/webapp/src/components/maps-page/language-menu/index.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { useMutation, useQueryClient } from 'react-query'; import Client from '../../../classes/client'; import { useSelector } from 'react-redux'; -import { activeInstance, fetchAccount } from '../../../redux/clientSlice'; +import { activeInstance } from '../../../redux/clientSlice'; import { FormattedMessage, useIntl } from 'react-intl'; import AppI18n, { LocaleCode, Locales } from '../../../classes/app-i18n'; import Tooltip from '@mui/material/Tooltip';