From c30a5b644458a7ab03a4dabe93face035aa0a21b Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 6 Dec 2023 20:02:36 -0500 Subject: more error/warning fixes --- src/client/util/SerializationHelper.ts | 1 - src/client/views/EditableView.tsx | 2 + src/client/views/GestureOverlay.tsx | 1 - src/client/views/MainView.tsx | 1 - src/client/views/MetadataEntryMenu.tsx | 1 + src/client/views/collections/CollectionMenu.tsx | 1 + .../CollectionFreeFormRemoteCursors.tsx | 4 +- src/client/views/global/globalScripts.ts | 6 +- src/client/views/search/IconButton.tsx | 76 ++++++++++++---------- 9 files changed, 49 insertions(+), 44 deletions(-) (limited to 'src/client') diff --git a/src/client/util/SerializationHelper.ts b/src/client/util/SerializationHelper.ts index 76037a7e9..8daa69890 100644 --- a/src/client/util/SerializationHelper.ts +++ b/src/client/util/SerializationHelper.ts @@ -1,6 +1,5 @@ import { PropSchema, serialize, deserialize, custom, setDefaultModelSchema, getDefaultModelSchema } from 'serializr'; import { Field } from '../../fields/Doc'; -import { ClientUtils } from './ClientUtils'; let serializing = 0; export function afterDocDeserialize(cb: (err: any, val: any) => void, err: any, newValue: any) { diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index edc35047f..6bc0e5424 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -222,12 +222,14 @@ export class EditableView extends React.Component { className: 'editableView-input', onKeyDown: this.onKeyDown, autoFocus: true, + // @ts-ignore onBlur: e => this.finalizeEdit(e.currentTarget.value, false, true, false), onPointerDown: this.stopPropagation, onClick: this.stopPropagation, onPointerUp: this.stopPropagation, onKeyPress: this.stopPropagation, value: this.props.autosuggestProps.value, + // @ts-ignore onChange: this.props.autosuggestProps.onChange, }} /> diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index 5f0df3c5f..214da5541 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -14,7 +14,6 @@ import { InteractionUtils } from '../util/InteractionUtils'; import { ScriptingGlobals } from '../util/ScriptingGlobals'; import { Transform } from '../util/Transform'; import './GestureOverlay.scss'; -import { InkTranscription } from './InkTranscription'; import { ActiveArrowEnd, ActiveArrowScale, diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 1408e3124..50feccce2 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -44,7 +44,6 @@ import { DictationOverlay } from './DictationOverlay'; import { DocumentDecorations } from './DocumentDecorations'; import { GestureOverlay } from './GestureOverlay'; import { KeyManager } from './GlobalKeyHandler'; -import { InkTranscription } from './InkTranscription'; import { LightboxView } from './LightboxView'; import { LinkMenu } from './linking/LinkMenu'; import './MainView.scss'; diff --git a/src/client/views/MetadataEntryMenu.tsx b/src/client/views/MetadataEntryMenu.tsx index bcbdd3ccb..5c6912121 100644 --- a/src/client/views/MetadataEntryMenu.tsx +++ b/src/client/views/MetadataEntryMenu.tsx @@ -156,6 +156,7 @@ export class MetadataEntryMenu extends React.Component { Key:
this.autosuggestRef.current!.input?.focus()}> { @@ -42,7 +42,7 @@ export class CollectionFreeFormRemoteCursors extends React.Component{ - +export class IconButton extends React.Component { @observable private _isSelected: boolean = IconBar.Instance.getIcons().indexOf(this.props.type) !== -1; @observable private _hover = false; private _resetReaction?: IReactionDisposer; private _selectAllReaction?: IReactionDisposer; static Instance: IconButton; - constructor(props: IconButtonProps) { + constructor(props: iconButtonProps) { super(props); IconButton.Instance = this; } @@ -40,7 +39,7 @@ export class IconButton extends React.Component{ IconBar.Instance._resetClicked = false; } } - }), + }) ); this._selectAllReaction = reaction( @@ -54,24 +53,35 @@ export class IconButton extends React.Component{ IconBar.Instance._selectAllClicked = false; } } - }), + }) ); - } + }; @action.bound getIcon() { switch (this.props.type) { - case (DocumentType.NONE): return "ban"; - case (DocumentType.AUDIO): return "music"; - case (DocumentType.COL): return "object-group"; - case (DocumentType.IMG): return "image"; - case (DocumentType.LINK): return "link"; - case (DocumentType.PDF): return "file-pdf"; - case (DocumentType.RTF): return "sticky-note"; - case (DocumentType.VID): return "video"; - case (DocumentType.WEB): return "globe-asia"; - case (DocumentType.MAP): return "map-marker-alt"; - default: return "caret-down"; + case DocumentType.NONE: + return 'ban'; + case DocumentType.AUDIO: + return 'music'; + case DocumentType.COL: + return 'object-group'; + case DocumentType.IMG: + return 'image'; + case DocumentType.LINK: + return 'link'; + case DocumentType.PDF: + return 'file-pdf'; + case DocumentType.RTF: + return 'sticky-note'; + case DocumentType.VID: + return 'video'; + case DocumentType.WEB: + return 'globe-asia'; + case DocumentType.MAP: + return 'map-marker-alt'; + default: + return 'caret-down'; } } @@ -82,45 +92,39 @@ export class IconButton extends React.Component{ if (!this._isSelected) { this._isSelected = true; newList.push(this.props.type); - } - else { + } else { this._isSelected = false; _.pull(newList, this.props.type); } IconBar.Instance.updateIcon(newList); - } + }; selected = { opacity: 1, - backgroundColor: "#121721", + backgroundColor: '#121721', //backgroundColor: "rgb(128, 128, 128)" }; notSelected = { opacity: 0.2, - backgroundColor: "#121721", + backgroundColor: '#121721', }; hoverStyle = { opacity: 1, - backgroundColor: "rgb(128, 128, 128)" + backgroundColor: 'rgb(128, 128, 128)', //backgroundColor: "rgb(178, 206, 248)" //$medium-blue }; render() { return ( -
this._hover = true} - onMouseLeave={() => this._hover = false} - onClick={this.onClick}> -
+
(this._hover = true)} onMouseLeave={() => (this._hover = false)} onClick={this.onClick}> +
{/*
{this.props.type}
*/}
); } -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2