From 09015f85e048c9d7bbf56c69cc5a9491fec64ab7 Mon Sep 17 00:00:00 2001 From: natyusha <985941+natyusha@users.noreply.github.com> Date: Sat, 9 Nov 2024 10:26:41 -0500 Subject: [PATCH] Modify Metadata Linking Header / AvDump Series Select QoL / Group Page Edit Button (#1136) * Modify Metadata Linking Header Format * Split Date and Approximate Title * Move Date & Approx. Title Higher in the List * Condense Match Types Into Four Categories / Add Tooltips to Individual Ratings - this way more matching types can easily be added to any of the match type categories * AvDump Series Select QoL - make the far right icon on each row of the "Add Series to AniDB" page a link to the series page (instead of the mass add page) - this is for cases where the user wants to check which series is the correct one when titles are similar - added tooltips to clarify where the links go - remove reference to button colour due to theme support * Add Edit Group Button to Group Page Header * Tooltip & Hover Tweaks --- src/components/Collection/SeriesMetadata.tsx | 6 +-- src/components/Collection/TitleOptions.tsx | 11 +++++- .../Collection/Tmdb/MatchRating.tsx | 20 +++++----- src/components/Collection/Tmdb/MovieRow.tsx | 1 + .../Collection/Tmdb/TmdbLinkSelectPanel.tsx | 10 ++++- src/components/Collection/Tmdb/TopPanel.tsx | 26 ++++++------- .../Unrecognized/AvDumpSeriesSelectModal.tsx | 37 ++++++++++++------- src/pages/collection/Collection.tsx | 4 +- src/pages/collection/series/TmdbLinking.tsx | 1 + 9 files changed, 72 insertions(+), 44 deletions(-) diff --git a/src/components/Collection/SeriesMetadata.tsx b/src/components/Collection/SeriesMetadata.tsx index 5f50080d5..7e8d9179e 100644 --- a/src/components/Collection/SeriesMetadata.tsx +++ b/src/components/Collection/SeriesMetadata.tsx @@ -90,19 +90,19 @@ const MetadataLink = ({ id, seriesId, site, type }: Props) => { ? ( <> {canEditLink && ( - )} {canRemoveLink && ( - )} ) : canAddLink && ( - )} diff --git a/src/components/Collection/TitleOptions.tsx b/src/components/Collection/TitleOptions.tsx index 45f5c9c10..4d41b9cbe 100644 --- a/src/components/Collection/TitleOptions.tsx +++ b/src/components/Collection/TitleOptions.tsx @@ -6,6 +6,7 @@ import { mdiFilterOutline, mdiFormatListText, mdiMagnify, + mdiPencil, mdiViewGridOutline, } from '@mdi/js'; import { useToggle } from 'usehooks-ts'; @@ -14,10 +15,15 @@ import DisplaySettingsModal from '@/components/Collection/DisplaySettingsModal'; import FilterPresetsModal from '@/components/Dialogs/FilterPresetsModal'; import IconButton from '@/components/Input/IconButton'; import Input from '@/components/Input/Input'; +import useEditGroupCallback from '@/hooks/collection/useEditGroupCallback'; + +import type { CollectionGroupType } from '@/core/types/api/collection'; +import type { SeriesType } from '@/core/types/api/series'; type Props = { - isSeries: boolean; groupSearch: string; + isSeries: boolean; + item: CollectionGroupType | SeriesType; mode: string; seriesSearch: string; setSearch: Dispatch>; @@ -47,6 +53,7 @@ const TitleOptions = (props: Props) => { const { groupSearch, isSeries, + item, mode, seriesSearch, setSearch, @@ -56,6 +63,7 @@ const TitleOptions = (props: Props) => { const [showFilterModal, toggleFilterModal] = useToggle(false); const [showDisplaySettingsModal, toggleDisplaySettingsModal] = useToggle(false); + const editGroupModalCallback = useEditGroupCallback(item); return ( <> @@ -69,6 +77,7 @@ const TitleOptions = (props: Props) => { onChange={event => setSearch(event.target.value)} /> {!isSeries && } + {isSeries && } { switch (rating) { case MatchRatingType.DateAndTitleMatches: - return 'DT'; + return ['DT', 'Date & Title']; case MatchRatingType.DateAndTitleKindaMatches: - return '~DT'; + return ['~DT', 'Date & Approx. Title']; case MatchRatingType.DateMatches: - return 'D'; + return ['D', 'Date']; case MatchRatingType.TitleMatches: - return 'T'; + return ['T', 'Title']; case MatchRatingType.TitleKindaMatches: - return '~T'; + return ['~T', 'Approx. Title']; case MatchRatingType.UserVerified: - return 'UO'; + return ['UO', 'User Override']; case MatchRatingType.FirstAvailable: - return 'BG'; + return ['BG', 'Best Guess']; default: - return ''; + return ['', '']; } }; @@ -46,8 +46,10 @@ const MatchRating = React.memo(({ isDisabled, isOdd, rating }: Props) => ( 'opacity-65': isDisabled, }, )} + data-tooltip-id="tooltip" + data-tooltip-content={getAbbreviation(rating)[1]} > - {getAbbreviation(rating)} + {getAbbreviation(rating)[0]} )); diff --git a/src/components/Collection/Tmdb/MovieRow.tsx b/src/components/Collection/Tmdb/MovieRow.tsx index 01b40d6e0..567322cb5 100644 --- a/src/components/Collection/Tmdb/MovieRow.tsx +++ b/src/components/Collection/Tmdb/MovieRow.tsx @@ -122,6 +122,7 @@ const MovieRow = React.memo((props: Props) => { && ( |