From f50cb45ca50a75c402ffc05d8379471bacb47700 Mon Sep 17 00:00:00 2001 From: Infinite Date: Sat, 4 Jan 2020 22:46:08 +0100 Subject: [PATCH] Changes --- ui/v2.5/package.json | 4 +- ui/v2.5/src/components/Galleries/Gallery.tsx | 1 - .../src/components/Galleries/GalleryList.tsx | 1 - .../components/Galleries/GalleryViewer.tsx | 1 - .../Settings/SettingsAboutPanel.tsx | 25 +-- .../Settings/SettingsConfigurationPanel.tsx | 21 +-- .../Settings/SettingsInterfacePanel.tsx | 4 +- .../components/Settings/SettingsLogsPanel.tsx | 2 +- .../SettingsTasksPanel/SettingsTasksPanel.tsx | 21 +-- ui/v2.5/src/components/Studios/StudioList.tsx | 1 - ui/v2.5/src/components/Wall/WallItem.tsx | 2 +- ui/v2.5/src/components/Wall/WallPanel.tsx | 1 - ui/v2.5/src/components/list/AddFilter.tsx | 115 ++++++------- ui/v2.5/src/components/list/ListFilter.tsx | 155 ++++++++---------- ui/v2.5/src/components/list/Pagination.tsx | 19 +-- .../components/scenes/SceneFilenameParser.tsx | 12 +- .../ScenePlayer/ScenePlayerScrubber.tsx | 4 +- .../scenes/SceneSelectedOptions.tsx | 8 +- .../src/components/select/FilterSelect.tsx | 6 +- .../select/ScrapePerformerSuggest.tsx | 2 +- .../select/ValidGalleriesSelect.tsx | 2 +- ui/v2.5/src/core/StashService.ts | 2 +- .../models/list-filter/criteria/criterion.ts | 7 +- ui/v2.5/src/utils/image.tsx | 4 +- ui/v2.5/yarn.lock | 9 +- 25 files changed, 188 insertions(+), 241 deletions(-) diff --git a/ui/v2.5/package.json b/ui/v2.5/package.json index 62bbc623a..06244ea1a 100644 --- a/ui/v2.5/package.json +++ b/ui/v2.5/package.json @@ -18,7 +18,7 @@ "lodash": "4.17.13", "node-sass": "4.12.0", "query-string": "6.5.0", - "react": "16.12.0", + "react": "~16.12.0", "react-apollo": "2.5.6", "react-apollo-hooks": "0.4.5", "react-bootstrap": "^1.0.0-beta.16", @@ -68,6 +68,6 @@ "graphql-codegen-typescript-client": "0.18.2", "graphql-codegen-typescript-common": "0.18.2", "graphql-codegen-typescript-react-apollo": "0.18.2", - "typescript": "3.4.5" + "typescript": "~3.7.4" } } diff --git a/ui/v2.5/src/components/Galleries/Gallery.tsx b/ui/v2.5/src/components/Galleries/Gallery.tsx index 57890d875..f2167354e 100644 --- a/ui/v2.5/src/components/Galleries/Gallery.tsx +++ b/ui/v2.5/src/components/Galleries/Gallery.tsx @@ -1,4 +1,3 @@ -import _ from "lodash"; import React, { useEffect, useState } from "react"; import { Spinner } from 'react-bootstrap'; import * as GQL from "../../core/generated-graphql"; diff --git a/ui/v2.5/src/components/Galleries/GalleryList.tsx b/ui/v2.5/src/components/Galleries/GalleryList.tsx index fa3ec30af..29a1b905f 100644 --- a/ui/v2.5/src/components/Galleries/GalleryList.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryList.tsx @@ -1,4 +1,3 @@ -import _ from "lodash"; import React from "react"; import { Table } from 'react-bootstrap'; import { QueryHookResult } from "react-apollo-hooks"; diff --git a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx index 5a1e7a3ef..55bc2e99d 100644 --- a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx @@ -1,4 +1,3 @@ -import _ from "lodash"; import React, { FunctionComponent, useState } from "react"; import Lightbox from "react-images"; import Gallery from "react-photo-gallery"; diff --git a/ui/v2.5/src/components/Settings/SettingsAboutPanel.tsx b/ui/v2.5/src/components/Settings/SettingsAboutPanel.tsx index f995b0552..d02e1e796 100644 --- a/ui/v2.5/src/components/Settings/SettingsAboutPanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsAboutPanel.tsx @@ -1,19 +1,8 @@ -import { - H1, - H4, - H6, - HTMLTable, - Spinner, - Tag, -} from "@blueprintjs/core"; -import React, { FunctionComponent } from "react"; -import * as GQL from "../../core/generated-graphql"; -import { TextUtils } from "../../utils/text"; +import React from "react"; +import { Table, Spinner } from 'react-bootstrap'; import { StashService } from "../../core/StashService"; -interface IProps {} - -export const SettingsAboutPanel: FunctionComponent = (props: IProps) => { +export const SettingsAboutPanel: React.FC = () => { const { data, error, loading } = StashService.useVersion(); function maybeRenderTag() { @@ -30,7 +19,7 @@ export const SettingsAboutPanel: FunctionComponent = (props: IProps) => if (!data || !data.version) { return; } return ( <> - + {maybeRenderTag()} @@ -42,14 +31,14 @@ export const SettingsAboutPanel: FunctionComponent = (props: IProps) => - +
{data.version.build_time}
); } return ( <> -

About

- {!data || loading ? : undefined} +

About

+ {!data || loading ? : undefined} {!!error ? error.message : undefined} {renderVersion()} diff --git a/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx b/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx index bf52604b3..b5f5caa16 100644 --- a/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx @@ -3,25 +3,19 @@ import { Button, Divider, FormGroup, - H1, - H4, - H6, InputGroup, Spinner, - Tag, Checkbox, HTMLSelect, } from "@blueprintjs/core"; -import React, { FunctionComponent, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import * as GQL from "../../core/generated-graphql"; import { StashService } from "../../core/StashService"; import { ErrorUtils } from "../../utils/errors"; import { ToastUtils } from "../../utils/toasts"; import { FolderSelect } from "../Shared/FolderSelect/FolderSelect"; -interface IProps {} - -export const SettingsConfigurationPanel: FunctionComponent = (props: IProps) => { +export const SettingsConfigurationPanel: React.FC = () => { // Editing config state const [stashes, setStashes] = useState([]); const [databasePath, setDatabasePath] = useState(undefined); @@ -51,7 +45,6 @@ export const SettingsConfigurationPanel: FunctionComponent = (props: IPr logLevel, logAccess, excludes, - }); useEffect(() => { @@ -86,7 +79,7 @@ export const SettingsConfigurationPanel: FunctionComponent = (props: IPr } function excludeRemoveRegex(idx: number) { - const newExcludes = excludes.filter((regex, i) => i!== idx ); + const newExcludes = excludes.filter((_regex, i) => i !== idx ); setExcludes(newExcludes); } @@ -148,7 +141,7 @@ export const SettingsConfigurationPanel: FunctionComponent = (props: IPr <> {!!error ?

{error.message}

: undefined} {(!data || !data.configuration || loading) ? : undefined} -

Library

+

Library

= (props: IPr -

Video

+

Video

= (props: IPr -

Authentication

+

Authentication

= (props: IPr -

Logging

+

Logging

= () => { <> {!!config.error ?

{config.error.message}

: undefined} {(!config.data || !config.data.configuration || config.loading) ? : undefined} -

User Interface

+

User Interface

= (props: IProps) => { const logLevels = ["Debug", "Info", "Warning", "Error"]; function filterByLogLevel(logEntry : LogEntry) { - if (logLevel == "Debug") { + if (logLevel === "Debug") { return true; } diff --git a/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx b/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx index cdebb5a71..c0e056a92 100644 --- a/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx @@ -4,21 +4,16 @@ import { Checkbox, Divider, FormGroup, - H4, - AnchorButton, ProgressBar, - H5, } from "@blueprintjs/core"; -import React, { FunctionComponent, useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import { StashService } from "../../../core/StashService"; import { ErrorUtils } from "../../../utils/errors"; import { ToastUtils } from "../../../utils/toasts"; import { GenerateButton } from "./GenerateButton"; import { Link } from "react-router-dom"; -interface IProps {} - -export const SettingsTasksPanel: FunctionComponent = (props: IProps) => { +export const SettingsTasksPanel: React.FC = () => { const [isImportAlertOpen, setIsImportAlertOpen] = useState(false); const [isCleanAlertOpen, setIsCleanAlertOpen] = useState(false); const [useFileMetadata, setUseFileMetadata] = useState(false); @@ -173,7 +168,7 @@ export const SettingsTasksPanel: FunctionComponent = (props: IProps) => return ( <> -
Status: {status}
+
Status: {status}
{!!status && status !== "Idle" ? : undefined}
{maybeRenderStop()} @@ -186,13 +181,13 @@ export const SettingsTasksPanel: FunctionComponent = (props: IProps) => {renderImportAlert()} {renderCleanAlert()} -

Running Jobs

+

Running Jobs

{renderJobStatus()} -

Library

+

Library

= (props: IProps) => -

Auto Tagging

+

Auto Tagging

= (props: IProps) => -

Generated Content

+

Generated Content

= (props: IProps) => -

Metadata

+

Metadata

= (props: IWallItemProp loop={true} ref={videoHoverHook.videoEl} /> - previewNotFound()} /> + Preview previewNotFound()} /> {showTextContainer ?
diff --git a/ui/v2.5/src/components/Wall/WallPanel.tsx b/ui/v2.5/src/components/Wall/WallPanel.tsx index df466f727..7705535bc 100644 --- a/ui/v2.5/src/components/Wall/WallPanel.tsx +++ b/ui/v2.5/src/components/Wall/WallPanel.tsx @@ -1,4 +1,3 @@ -import _ from "lodash"; import React, { FunctionComponent, useState } from "react"; import * as GQL from "../../core/generated-graphql"; import "./Wall.scss"; diff --git a/ui/v2.5/src/components/list/AddFilter.tsx b/ui/v2.5/src/components/list/AddFilter.tsx index fd3c9fa78..ee44e7cfd 100644 --- a/ui/v2.5/src/components/list/AddFilter.tsx +++ b/ui/v2.5/src/components/list/AddFilter.tsx @@ -1,15 +1,7 @@ -import { - Button, - Classes, - Dialog, - FormGroup, - HTMLSelect, - InputGroup, - Tooltip, -} from "@blueprintjs/core"; import _ from "lodash"; -import React, { FunctionComponent, useEffect, useRef, useState } from "react"; -import { isArray } from "util"; +import React, { useEffect, useRef, useState } from "react"; +import { Button, Form, Modal, OverlayTrigger, Tooltip } from 'react-bootstrap' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { CriterionModifier } from "../../core/generated-graphql"; import { Criterion, CriterionType } from "../../models/list-filter/criteria/criterion"; import { NoneCriterion } from "../../models/list-filter/criteria/none"; @@ -27,8 +19,8 @@ interface IAddFilterProps { editingCriterion?: Criterion; } -export const AddFilter: FunctionComponent = (props: IAddFilterProps) => { - const singleValueSelect = useRef(null); +export const AddFilter: React.FC = (props: IAddFilterProps) => { + const defaultValue= useRef(); const [isOpen, setIsOpen] = useState(false); const [criterion, setCriterion] = useState>(new NoneCriterion()); @@ -71,8 +63,8 @@ export const AddFilter: FunctionComponent = (props: IAddFilterP } function onAddFilter() { - if (!isArray(criterion.value) && !!singleValueSelect.current) { - const value = singleValueSelect.current.props.defaultValue; + if (!Array.isArray(criterion.value) && defaultValue.current) { + const value = defaultValue.current; if (criterion.options && (value === undefined || value === "" || typeof value === "number")) { criterion.value = criterion.options[0]; } else if (typeof value === "number" && value === undefined) { @@ -101,11 +93,15 @@ export const AddFilter: FunctionComponent = (props: IAddFilterP if (criterion.modifierOptions.length === 0) { return; } return (
- + value={criterion.modifier} + > + { criterion.modifierOptions.map(c => ( + + ))} +
); } @@ -116,7 +112,7 @@ export const AddFilter: FunctionComponent = (props: IAddFilterP return; } - if (isArray(criterion.value)) { + if (Array.isArray(criterion.value)) { let type: "performers" | "studios" | "tags" | "" = ""; if (criterion instanceof PerformersCriterion) { type = "performers"; @@ -140,21 +136,25 @@ export const AddFilter: FunctionComponent = (props: IAddFilterP } } else { if (criterion.options) { + defaultValue.current = criterion.value; return ( - + value={criterion.value} + > + { criterion.options.map(c => ( + + ))} + ); } else { return ( - ) } @@ -162,57 +162,62 @@ export const AddFilter: FunctionComponent = (props: IAddFilterP } return ( <> - + {renderModifier()} - - + + {renderSelect()} - + ); }; function maybeRenderFilterSelect() { - if (!!props.editingCriterion) { return; } + if (props.editingCriterion) { return; } return ( - - + Filter + - + value={criterion.type}> + { props.filter.criterionOptions.map(c => ( + + ))} + + ); } const title = !props.editingCriterion ? "Add Filter" : "Update Filter"; return ( <> - Filter} > - + - onToggle()} title={title}> -
- {maybeRenderFilterSelect()} - {maybeRenderFilterPopoverContents()} -
-
-
- + onToggle()}> + {title} + +
+ {maybeRenderFilterSelect()} + {maybeRenderFilterPopoverContents()}
-
-
+ + + + + ); }; diff --git a/ui/v2.5/src/components/list/ListFilter.tsx b/ui/v2.5/src/components/list/ListFilter.tsx index 9524ea896..d3b8afdf0 100644 --- a/ui/v2.5/src/components/list/ListFilter.tsx +++ b/ui/v2.5/src/components/list/ListFilter.tsx @@ -1,17 +1,8 @@ -import { - Button, - ButtonGroup, - HTMLSelect, - InputGroup, - Menu, - MenuItem, - Popover, - Tag, - Tooltip, - Slider, -} from "@blueprintjs/core"; import { debounce } from "lodash"; -import React, { FunctionComponent, SyntheticEvent, useEffect, useState } from "react"; +import React, { SyntheticEvent, useCallback, useState } from "react"; +import { Badge, Button, ButtonGroup, Dropdown, Form, OverlayTrigger, Tooltip } from 'react-bootstrap'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' + import { Criterion } from "../../models/list-filter/criteria/criterion"; import { ListFilterModel } from "../../models/list-filter/filter"; import { DisplayMode } from "../../models/list-filter/types"; @@ -40,17 +31,15 @@ interface IListFilterProps { const PAGE_SIZE_OPTIONS = ["20", "40", "60", "120"]; -export const ListFilter: FunctionComponent = (props: IListFilterProps) => { - let searchCallback: any; +export const ListFilter: React.FC = (props: IListFilterProps) => { + const searchCallback = useCallback( + debounce((event: any) => { + props.onChangeQuery(event.target.value); + }, 500), [props.onChangeQuery] + ); const [editingCriterion, setEditingCriterion] = useState(undefined); - useEffect(() => { - searchCallback = debounce((event: any) => { - props.onChangeQuery(event.target.value); - }, 500); - }); - function onChangePageSize(event: SyntheticEvent) { const val = event!.currentTarget!.value; props.onChangePageSize(parseInt(val, 10)); @@ -99,16 +88,16 @@ export const ListFilter: FunctionComponent = (props: IListFilt function renderSortByOptions() { return props.filter.sortByOptions.map((option) => ( - + {option} )); } function renderDisplayModeOptions() { function getIcon(option: DisplayMode) { switch (option) { - case DisplayMode.Grid: return "grid-view"; + case DisplayMode.Grid: return "th-large"; case DisplayMode.List: return "list"; - case DisplayMode.Wall: return "symbol-square"; + case DisplayMode.Wall: return "square"; } } function getLabel(option: DisplayMode) { @@ -119,29 +108,30 @@ export const ListFilter: FunctionComponent = (props: IListFilt } } return props.filter.displayModeOptions.map((option) => ( - + {getLabel(option)}}> + )); } function renderFilterTags() { return props.filter.criteria.map((criterion) => ( - onRemoveCriterionTag(criterion)} + variant="secondary" onClick={() => onClickCriterionTag(criterion)} > {criterion.getLabel()} - + + )); } @@ -159,45 +149,40 @@ export const ListFilter: FunctionComponent = (props: IListFilt function renderSelectAll() { if (props.onSelectAll) { - return onSelectAll()} text="Select All" />; + return onSelectAll()}>Select All; } } function renderSelectNone() { if (props.onSelectNone) { - return onSelectNone()} text="Select None" />; + return onSelectNone()}>Select None; } } function renderMore() { - let options = []; - options.push(renderSelectAll()); - options.push(renderSelectNone()); + let options = [ + renderSelectAll(), + renderSelectNone() + ]; if (props.otherOperations) { props.otherOperations.forEach((o) => { - options.push(); + options.push({o.text}); }); } - options = options.filter((o) => !!o); - - let menuItems = options as JSX.Element[]; - - function renderMoreOptions() { + if (options.length > 0) { return ( - <> - {menuItems} - - ) - } - - if (menuItems.length > 0) { - return ( - - + + + {options} + + ); } } @@ -212,13 +197,11 @@ export const ListFilter: FunctionComponent = (props: IListFilt if (props.onChangeZoom) { return ( - onChangeZoom(v)} + onChange={(event: any) => onChangeZoom(Number.parseInt(event.target.value))} /> ); @@ -229,37 +212,37 @@ export const ListFilter: FunctionComponent = (props: IListFilt return ( <>
- - + > + { PAGE_SIZE_OPTIONS.map(s => ) } + - - - {renderSortByOptions()} - - - - + + + {renderSortByOptions()} + + + + {props.filter.sortDirection === "asc" ? "Ascending" : "Descending"} + }> + + + {this.renderPageButtons()} ); } @@ -66,10 +62,9 @@ export class Pagination extends React.Component ( )); } diff --git a/ui/v2.5/src/components/scenes/SceneFilenameParser.tsx b/ui/v2.5/src/components/scenes/SceneFilenameParser.tsx index fdae8f375..24b3c8a7b 100644 --- a/ui/v2.5/src/components/scenes/SceneFilenameParser.tsx +++ b/ui/v2.5/src/components/scenes/SceneFilenameParser.tsx @@ -431,19 +431,19 @@ export const SceneFilenameParser: React.FC = () => { return !r.studioId.set; }); - if (newAllTitleSet != allTitleSet) { + if (newAllTitleSet !== allTitleSet) { setAllTitleSet(newAllTitleSet); } - if (newAllDateSet != allDateSet) { + if (newAllDateSet !== allDateSet) { setAllDateSet(newAllDateSet); } - if (newAllPerformerSet != allPerformerSet) { + if (newAllPerformerSet !== allPerformerSet) { setAllTagSet(newAllPerformerSet); } - if (newAllTagSet != allTagSet) { + if (newAllTagSet !== allTagSet) { setAllTagSet(newAllTagSet); } - if (newAllStudioSet != allStudioSet) { + if (newAllStudioSet !== allStudioSet) { setAllStudioSet(newAllStudioSet); } }, [parserResult]); @@ -927,7 +927,7 @@ export const SceneFilenameParser: React.FC = () => { } function renderTable() { - if (parserResult.length == 0) { return undefined; } + if (parserResult.length === 0) { return undefined; } return ( <> diff --git a/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayerScrubber.tsx b/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayerScrubber.tsx index e524b6194..a36c724cc 100644 --- a/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayerScrubber.tsx +++ b/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayerScrubber.tsx @@ -1,5 +1,5 @@ import axios from "axios"; -import React, { CSSProperties, FunctionComponent, RefObject, useEffect, useRef, useState } from "react"; +import React, { CSSProperties, useEffect, useRef, useState } from "react"; import * as GQL from "../../../core/generated-graphql"; import { TextUtils } from "../../../utils/text"; import "./ScenePlayerScrubber.scss"; @@ -20,7 +20,7 @@ interface ISceneSpriteItem { h: number; } -export const ScenePlayerScrubber: FunctionComponent = (props: IScenePlayerScrubberProps) => { +export const ScenePlayerScrubber: React.FC = (props: IScenePlayerScrubberProps) => { const contentEl = useRef(null); const positionIndicatorEl = useRef(null); const scrubberSliderEl = useRef(null); diff --git a/ui/v2.5/src/components/scenes/SceneSelectedOptions.tsx b/ui/v2.5/src/components/scenes/SceneSelectedOptions.tsx index da3941dd7..5d60d0c6b 100644 --- a/ui/v2.5/src/components/scenes/SceneSelectedOptions.tsx +++ b/ui/v2.5/src/components/scenes/SceneSelectedOptions.tsx @@ -93,7 +93,7 @@ export const SceneSelectedOptions: React.FC = (props: IList async function onSave() { setIsLoading(true); try { - const result = await updateScenes(); + await updateScenes(); ToastUtils.success("Updated scenes"); } catch (e) { ErrorUtils.handle(e); @@ -130,7 +130,7 @@ export const SceneSelectedOptions: React.FC = (props: IList first = false; } else { var studioId = scene.studio ? scene.studio.id : undefined; - if (ret != studioId) { + if (ret !== studioId) { ret = undefined; } } @@ -208,7 +208,7 @@ export const SceneSelectedOptions: React.FC = (props: IList if (rating !== thisRating) { rating = ""; } - if (studioId != thisStudio) { + if (studioId !== thisStudio) { studioId = undefined; } const perfIds = !!scene.performers ? scene.performers.map(toId).sort() : []; @@ -261,7 +261,7 @@ export const SceneSelectedOptions: React.FC = (props: IList as="select" onChange={(event: any) => setRating(event.target.value)}> { ["", 1, 2, 3, 4, 5].map(opt => ( - + )) } diff --git a/ui/v2.5/src/components/select/FilterSelect.tsx b/ui/v2.5/src/components/select/FilterSelect.tsx index b906667db..7f285c40b 100644 --- a/ui/v2.5/src/components/select/FilterSelect.tsx +++ b/ui/v2.5/src/components/select/FilterSelect.tsx @@ -1,6 +1,6 @@ import * as React from "react"; +import { Button } from 'react-bootstrap'; -import { Button, MenuItem } from "@blueprintjs/core"; import { ISelectProps, ItemPredicate, ItemRenderer, Select } from "@blueprintjs/select"; import * as GQL from "../../core/generated-graphql"; import { StashService } from "../../core/StashService"; @@ -91,7 +91,7 @@ export const FilterSelect: React.FunctionComponent = (props: IProps) => }; function onItemSelect(item: ValidTypes | undefined) { - if (item && item.id == "0") { + if (item && item.id === "0") { item = undefined; } @@ -111,7 +111,7 @@ export const FilterSelect: React.FunctionComponent = (props: IProps) => popoverProps={{position: "bottom"}} {...props} > - ); }; diff --git a/ui/v2.5/src/components/select/ScrapePerformerSuggest.tsx b/ui/v2.5/src/components/select/ScrapePerformerSuggest.tsx index c9fa3fc92..183d8f456 100644 --- a/ui/v2.5/src/components/select/ScrapePerformerSuggest.tsx +++ b/ui/v2.5/src/components/select/ScrapePerformerSuggest.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { MenuItem } from "@blueprintjs/core"; -import { ItemPredicate, ItemRenderer, Suggest } from "@blueprintjs/select"; +import { ItemRenderer, Suggest } from "@blueprintjs/select"; import * as GQL from "../../core/generated-graphql"; import { StashService } from "../../core/StashService"; import { HTMLInputProps } from "../../models"; diff --git a/ui/v2.5/src/components/select/ValidGalleriesSelect.tsx b/ui/v2.5/src/components/select/ValidGalleriesSelect.tsx index 1c3c140df..b00dd9bee 100644 --- a/ui/v2.5/src/components/select/ValidGalleriesSelect.tsx +++ b/ui/v2.5/src/components/select/ValidGalleriesSelect.tsx @@ -50,7 +50,7 @@ export const ValidGalleriesSelect: React.FunctionComponent = (props: IPr }; function onItemSelect(item: GQL.ValidGalleriesForSceneValidGalleriesForScene | undefined) { - if (item && item.id == "0") { + if (item && item.id === "0") { item = undefined; } diff --git a/ui/v2.5/src/core/StashService.ts b/ui/v2.5/src/core/StashService.ts index cfe7f9e4b..d75a20425 100644 --- a/ui/v2.5/src/core/StashService.ts +++ b/ui/v2.5/src/core/StashService.ts @@ -525,7 +525,7 @@ export class StashService { if (_.isPlainObject(value)) { return _.mapValues(value, StashService.nullToUndefined); } - if (_.isArray(value)) { + if (Array.isArray(value)) { return value.map(StashService.nullToUndefined); } if (value === null) { diff --git a/ui/v2.5/src/models/list-filter/criteria/criterion.ts b/ui/v2.5/src/models/list-filter/criteria/criterion.ts index a54df5245..da334d0a0 100644 --- a/ui/v2.5/src/models/list-filter/criteria/criterion.ts +++ b/ui/v2.5/src/models/list-filter/criteria/criterion.ts @@ -1,4 +1,3 @@ -import { isArray } from "util"; import { CriterionModifier } from "../../../core/generated-graphql"; import { ILabeledId, ILabeledValue } from "../types"; @@ -94,7 +93,7 @@ export abstract class Criterion