mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-13 02:37:57 +01:00
Fix eslint issues.
This commit is contained in:
parent
be727e3c4b
commit
1a8ffee801
@ -35,7 +35,6 @@ class CentralTopic extends Topic {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
workoutIncomingConnectionPoint(): Point {
|
||||
return this.getPosition();
|
||||
}
|
||||
|
@ -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]) {
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user