From dcfd445040dc989ae364bec2e29d34f3501ddcea Mon Sep 17 00:00:00 2001 From: Infinite Date: Wed, 22 Jan 2020 20:52:04 +0100 Subject: [PATCH] Library updates --- ui/v2.5/codegen.yml | 13 +- ui/v2.5/package.json | 46 +- .../src/components/Galleries/GalleryList.tsx | 6 +- .../components/Galleries/GalleryViewer.tsx | 9 +- .../Settings/SettingsConfigurationPanel.tsx | 8 +- .../Settings/SettingsInterfacePanel.tsx | 2 +- .../SettingsTasksPanel/SettingsTasksPanel.tsx | 4 +- .../components/Shared/DetailsEditNavbar.tsx | 7 +- ui/v2.5/src/components/Shared/Select.tsx | 61 +- .../Studios/StudioDetails/Studio.tsx | 23 +- ui/v2.5/src/components/Studios/StudioList.tsx | 6 +- ui/v2.5/src/components/Tags/TagList.tsx | 6 +- .../performers/PerformerDetails/Performer.tsx | 130 +- .../components/performers/PerformerList.tsx | 8 +- ui/v2.5/src/components/scenes/SceneCard.tsx | 14 +- .../scenes/SceneDetails/SceneEditPanel.tsx | 70 +- .../SceneDetails/SceneFileInfoPanel.tsx | 8 +- .../scenes/SceneDetails/SceneMarkersPanel.tsx | 18 +- .../SceneDetails/ScenePerformerPanel.tsx | 2 +- .../components/scenes/SceneFilenameParser.tsx | 70 +- ui/v2.5/src/components/scenes/SceneList.tsx | 10 +- .../src/components/scenes/SceneListTable.tsx | 10 +- .../src/components/scenes/SceneMarkerList.tsx | 8 +- .../scenes/ScenePlayer/ScenePlayer.tsx | 2 +- .../scenes/SceneSelectedOptions.tsx | 4 +- ui/v2.5/src/core/StashService.ts | 103 +- ui/v2.5/src/core/generated-graphql.tsx | 8016 ++++++++++------- ui/v2.5/src/hooks/ListHook.tsx | 74 +- ui/v2.5/src/index.tsx | 2 +- .../src/models/list-filter/criteria/tags.ts | 4 +- ui/v2.5/src/utils/text.ts | 2 +- ui/v2.5/yarn.lock | 2611 ++++-- 32 files changed, 6902 insertions(+), 4455 deletions(-) diff --git a/ui/v2.5/codegen.yml b/ui/v2.5/codegen.yml index aa2da743f..dbab06402 100644 --- a/ui/v2.5/codegen.yml +++ b/ui/v2.5/codegen.yml @@ -4,15 +4,12 @@ documents: "../../graphql/documents/**/*.graphql" generates: src/core/generated-graphql.tsx: config: - noNamespaces: true - optionalType: "undefined" - noHOC: true - noComponents: true withHooks: true + withHOC: false + withComponents: false plugins: - - add: "/* tslint:disable */" - add: "/* eslint-disable */" - time - - "typescript-common" - - "typescript-client" - - "typescript-react-apollo" + - typescript + - typescript-operations + - typescript-react-apollo diff --git a/ui/v2.5/package.json b/ui/v2.5/package.json index 23d1d5f16..eaa6aefc4 100644 --- a/ui/v2.5/package.json +++ b/ui/v2.5/package.json @@ -3,30 +3,36 @@ "version": "0.1.0", "private": true, "dependencies": { + "@apollo/react-hooks": "^3.1.3", "@fortawesome/fontawesome-svg-core": "^1.2.26", "@fortawesome/free-solid-svg-icons": "^5.12.0", "@fortawesome/react-fontawesome": "^0.1.8", - "apollo-boost": "0.4.0", + "apollo-cache": "^1.3.4", + "apollo-cache-inmemory": "^1.6.5", + "apollo-client": "^2.6.8", + "apollo-link": "^1.2.13", + "apollo-link-http": "^1.5.16", "apollo-link-ws": "^1.0.19", + "apollo-utilities": "^1.3.3", "axios": "0.18.1", "bootstrap": "^4.4.1", "classnames": "^2.2.6", - "formik": "1.5.7", - "graphql": "14.3.1", + "formik": "^2.1.2", + "graphql": "^14.5.8", + "graphql-tag": "^2.10.1", "localforage": "1.7.3", - "lodash": "4.17.13", - "node-sass": "4.12.0", + "lodash": "^4.17.15", + "node-sass": "4.13.1", "normalize.css": "^8.0.1", - "query-string": "6.5.0", + "query-string": "6.10.1", "react": "~16.12.0", - "react-apollo": "2.5.6", - "react-apollo-hooks": "0.4.5", + "react-apollo": "^3.1.3", "react-bootstrap": "^1.0.0-beta.16", "react-dom": "16.12.0", "react-hotkeys": "^2.0.0", "react-images": "0.5.19", "react-jw-player": "1.19.0", - "react-photo-gallery": "7.0.2", + "react-photo-gallery": "^8.0.0", "react-router-bootstrap": "^0.25.0", "react-router-dom": "^5.1.2", "react-scripts": "3.3.0", @@ -51,13 +57,19 @@ "not op_mini all" ], "devDependencies": { + "@graphql-codegen/add": "^1.11.2", + "@graphql-codegen/cli": "^1.11.2", + "@graphql-codegen/time": "^1.11.2", + "@graphql-codegen/typescript": "^1.11.2", + "@graphql-codegen/typescript-compatibility": "^1.11.2", + "@graphql-codegen/typescript-operations": "^1.11.2", + "@graphql-codegen/typescript-react-apollo": "^1.11.2", "@types/classnames": "^2.2.9", "@types/jest": "24.0.13", - "@types/lodash": "4.14.132", - "@types/node": "11.13.0", - "@types/query-string": "6.3.0", - "@types/react": "16.9.15", - "@types/react-dom": "16.9.4", + "@types/lodash": "^4.14.149", + "@types/node": "13.1.8", + "@types/react": "16.9.19", + "@types/react-dom": "^16.9.5", "@types/react-images": "^0.5.1", "@types/react-router-bootstrap": "^0.24.5", "@types/react-router-dom": "5.1.3", @@ -69,12 +81,6 @@ "eslint-config-airbnb-typescript": "^6.3.1", "eslint-config-prettier": "^6.9.0", "eslint-plugin-jsx-a11y": "^6.2.3", - "graphql-code-generator": "0.18.2", - "graphql-codegen-add": "0.18.2", - "graphql-codegen-time": "0.18.2", - "graphql-codegen-typescript-client": "0.18.2", - "graphql-codegen-typescript-common": "0.18.2", - "graphql-codegen-typescript-react-apollo": "0.18.2", "prettier": "1.19.1", "typescript": "~3.7.4" } diff --git a/ui/v2.5/src/components/Galleries/GalleryList.tsx b/ui/v2.5/src/components/Galleries/GalleryList.tsx index b8d805048..b6540d686 100644 --- a/ui/v2.5/src/components/Galleries/GalleryList.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryList.tsx @@ -1,10 +1,8 @@ import React from "react"; import { Table } from "react-bootstrap"; -import { QueryHookResult } from "react-apollo-hooks"; import { Link } from "react-router-dom"; import { - FindGalleriesQuery, - FindGalleriesVariables + FindGalleriesQueryResult, } from "src/core/generated-graphql"; import { useGalleriesList } from "src/hooks"; import { ListFilterModel } from "src/models/list-filter/filter"; @@ -16,7 +14,7 @@ export const GalleryList: React.FC = () => { }); function renderContent( - result: QueryHookResult, + result: FindGalleriesQueryResult, filter: ListFilterModel ) { if (!result.data || !result.data.findGalleries) { diff --git a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx index b7cf9c1de..1ae7e26b1 100644 --- a/ui/v2.5/src/components/Galleries/GalleryViewer.tsx +++ b/ui/v2.5/src/components/Galleries/GalleryViewer.tsx @@ -1,5 +1,5 @@ import React, { FunctionComponent, useState } from "react"; -import Lightbox from "react-images"; +import Lightbox from 'react-images'; import Gallery from "react-photo-gallery"; import * as GQL from "src/core/generated-graphql"; @@ -30,14 +30,15 @@ export const GalleryViewer: FunctionComponent = ({ gallery }) => { } const photos = gallery.files.map(file => ({ - src: file.path || "", - caption: file.name + src: file.path ?? '', + caption: file.name ?? '' })); const thumbs = gallery.files.map(file => ({ src: `${file.path}?thumb=true` || "", width: 1, height: 1 })); + return (
@@ -47,8 +48,8 @@ export const GalleryViewer: FunctionComponent = ({ gallery }) => { onClickPrev={gotoPrevious} onClickNext={gotoNext} currentImage={currentImage} + onClickImage={() => window.open(photos[currentImage].src ?? '', "_blank")} isOpen={lightboxIsOpen} - onClickImage={() => window.open(photos[currentImage].src, "_blank")} width={9999} />
diff --git a/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx b/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx index eea36e1e4..95ff1162c 100644 --- a/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsConfigurationPanel.tsx @@ -32,7 +32,7 @@ export const SettingsConfigurationPanel: React.FC = () => { const { data, error, loading } = StashService.useConfiguration(); - const updateGeneralConfig = StashService.useConfigureGeneral({ + const [updateGeneralConfig] = StashService.useConfigureGeneral({ stashes, databasePath, generatedPath, @@ -55,11 +55,11 @@ export const SettingsConfigurationPanel: React.FC = () => { setStashes(conf.general.stashes ?? []); setDatabasePath(conf.general.databasePath); setGeneratedPath(conf.general.generatedPath); - setMaxTranscodeSize(conf.general.maxTranscodeSize); - setMaxStreamingTranscodeSize(conf.general.maxStreamingTranscodeSize); + setMaxTranscodeSize(conf.general.maxTranscodeSize ?? undefined); + setMaxStreamingTranscodeSize(conf.general.maxStreamingTranscodeSize ?? undefined); setUsername(conf.general.username); setPassword(conf.general.password); - setLogFile(conf.general.logFile); + setLogFile(conf.general.logFile ?? undefined); setLogOut(conf.general.logOut); setLogLevel(conf.general.logLevel); setLogAccess(conf.general.logAccess); diff --git a/ui/v2.5/src/components/Settings/SettingsInterfacePanel.tsx b/ui/v2.5/src/components/Settings/SettingsInterfacePanel.tsx index 4fc8f7abd..8f02b877f 100644 --- a/ui/v2.5/src/components/Settings/SettingsInterfacePanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsInterfacePanel.tsx @@ -14,7 +14,7 @@ export const SettingsInterfacePanel: React.FC = () => { const [css, setCSS] = useState(); const [cssEnabled, setCSSEnabled] = useState(); - const updateInterfaceConfig = StashService.useConfigureInterface({ + const [updateInterfaceConfig] = StashService.useConfigureInterface({ soundOnPreview, wallShowTitle, maximumLoopDuration, diff --git a/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx b/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx index 65b712438..c5e1494a3 100644 --- a/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsTasksPanel/SettingsTasksPanel.tsx @@ -49,7 +49,7 @@ export const SettingsTasksPanel: React.FC = () => { if (newProgress < 0) { setProgress(0); } else { - setProgress(newProgress); + setProgress(newProgress * 100); } } }, [jobStatus]); @@ -61,7 +61,7 @@ export const SettingsTasksPanel: React.FC = () => { if (newProgress < 0) { setProgress(0); } else { - setProgress(newProgress); + setProgress(newProgress * 100); } } }, [metadataUpdate]); diff --git a/ui/v2.5/src/components/Shared/DetailsEditNavbar.tsx b/ui/v2.5/src/components/Shared/DetailsEditNavbar.tsx index 6db019597..c724da4e4 100644 --- a/ui/v2.5/src/components/Shared/DetailsEditNavbar.tsx +++ b/ui/v2.5/src/components/Shared/DetailsEditNavbar.tsx @@ -24,9 +24,9 @@ interface IProps { onImageChange: (event: React.FormEvent) => void; // TODO: only for performers. make generic - scrapers?: GQL.ListPerformerScrapersListPerformerScrapers[]; + scrapers?: Pick[]; onDisplayScraperDialog?: ( - scraper: GQL.ListPerformerScrapersListPerformerScrapers + scraper: Pick ) => void; } @@ -96,8 +96,7 @@ export const DetailsEditNavbar: React.FC = (props: IProps) => {