From 6cec1c6e07deef6d17bb482cc881f1fd715c95c0 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 20 Oct 2019 21:38:15 +0200 Subject: [PATCH] Adding missing artist Deleted UI elements (cherry picked from commit b72fbe06f78095d0de7957a232f434e6e33f6543) --- frontend/src/Artist/ArtistStatus.js | 27 +++++++++++++++++++ frontend/src/Artist/Details/ArtistDetails.js | 13 ++++----- .../src/Artist/Index/Table/ArtistIndexRow.tsx | 1 - .../Artist/Index/Table/ArtistStatusCell.tsx | 14 +++++----- frontend/src/Helpers/Props/icons.js | 1 + src/NzbDrone.Core/Localization/Core/en.json | 2 ++ 6 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 frontend/src/Artist/ArtistStatus.js diff --git a/frontend/src/Artist/ArtistStatus.js b/frontend/src/Artist/ArtistStatus.js new file mode 100644 index 000000000..f49f1e0bc --- /dev/null +++ b/frontend/src/Artist/ArtistStatus.js @@ -0,0 +1,27 @@ +import { icons } from 'Helpers/Props'; +import translate from 'Utilities/String/translate'; + +export function getArtistStatusDetails(status, artistType) { + + let statusDetails = { + icon: icons.ARTIST_CONTINUING, + title: translate('Continuing'), + message: translate('ContinuingMoreAlbumsAreExpected') + }; + + if (status === 'deleted') { + statusDetails = { + icon: icons.ARTIST_DELETED, + title: translate('Deleted'), + message: translate('ArtistWasDeletedFromMusicBrainz') + }; + } else if (status === 'ended') { + statusDetails = { + icon: icons.ARTIST_ENDED, + title: artistType === 'Person' ? translate('Deceased') : translate('Inactive'), + message: translate('ContinuingNoAdditionalAlbumsAreExpected') + }; + } + + return statusDetails; +} diff --git a/frontend/src/Artist/Details/ArtistDetails.js b/frontend/src/Artist/Details/ArtistDetails.js index e7500b74b..c4dd61011 100644 --- a/frontend/src/Artist/Details/ArtistDetails.js +++ b/frontend/src/Artist/Details/ArtistDetails.js @@ -33,6 +33,7 @@ import translate from 'Utilities/String/translate'; import selectAll from 'Utilities/Table/selectAll'; import toggleSelected from 'Utilities/Table/toggleSelected'; import InteractiveImportModal from '../../InteractiveImport/InteractiveImportModal'; +import { getArtistStatusDetails } from '../ArtistStatus'; import ArtistAlternateTitles from './ArtistAlternateTitles'; import ArtistDetailsLinks from './ArtistDetailsLinks'; import ArtistDetailsSeasonConnector from './ArtistDetailsSeasonConnector'; @@ -213,7 +214,8 @@ class ArtistDetails extends Component { nextArtist, onMonitorTogglePress, onRefreshPress, - onSearchPress + onSearchPress, + artistType } = this.props; const { @@ -236,8 +238,7 @@ class ArtistDetails extends Component { expandedState } = this.state; - const continuing = status === 'continuing'; - const endedString = artistType === 'Person' ? translate('Deceased') : translate('Inactive'); + const statusDetails = getArtistStatusDetails(status, artistType); let trackFilesCountMessage = translate('TrackFilesCountMessage'); @@ -526,16 +527,16 @@ class ArtistDetails extends Component { diff --git a/frontend/src/Artist/Index/Table/ArtistIndexRow.tsx b/frontend/src/Artist/Index/Table/ArtistIndexRow.tsx index 0398f5502..2f62b97ce 100644 --- a/frontend/src/Artist/Index/Table/ArtistIndexRow.tsx +++ b/frontend/src/Artist/Index/Table/ArtistIndexRow.tsx @@ -164,7 +164,6 @@ function ArtistIndexRow(props: ArtistIndexRowProps) { key={name} className={styles[name]} artistId={artistId} - artistType={artistType} monitored={monitored} status={status} isSelectMode={isSelectMode} diff --git a/frontend/src/Artist/Index/Table/ArtistStatusCell.tsx b/frontend/src/Artist/Index/Table/ArtistStatusCell.tsx index 00c7ae4c8..89c1117d1 100644 --- a/frontend/src/Artist/Index/Table/ArtistStatusCell.tsx +++ b/frontend/src/Artist/Index/Table/ArtistStatusCell.tsx @@ -1,5 +1,6 @@ import React, { useCallback } from 'react'; import { useDispatch } from 'react-redux'; +import { getArtistStatusDetails } from 'Artist/ArtistStatus'; import Icon from 'Components/Icon'; import MonitorToggleButton from 'Components/MonitorToggleButton'; import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell'; @@ -11,9 +12,9 @@ import styles from './ArtistStatusCell.css'; interface ArtistStatusCellProps { className: string; artistId: number; - artistType?: string; monitored: boolean; status: string; + artistType?: string; isSelectMode: boolean; isSaving: boolean; component?: React.ElementType; @@ -23,17 +24,16 @@ function ArtistStatusCell(props: ArtistStatusCellProps) { const { className, artistId, - artistType, monitored, status, + artistType, isSelectMode, isSaving, component: Component = VirtualTableRowCell, ...otherProps } = props; - const endedString = - artistType === 'Person' ? translate('Deceased') : translate('Inactive'); + const statusDetails = getArtistStatusDetails(status, artistType); const dispatch = useDispatch(); const onMonitoredPress = useCallback(() => { @@ -63,10 +63,8 @@ function ArtistStatusCell(props: ArtistStatusCellProps) { ); diff --git a/frontend/src/Helpers/Props/icons.js b/frontend/src/Helpers/Props/icons.js index aa9c23145..ec2c38281 100644 --- a/frontend/src/Helpers/Props/icons.js +++ b/frontend/src/Helpers/Props/icons.js @@ -209,6 +209,7 @@ export const SCORE = fasUserPlus; export const SEARCH = fasSearch; export const ARTIST_CONTINUING = fasPlay; export const ARTIST_ENDED = fasStop; +export const ARTIST_DELETED = fasExclamationTriangle; export const SETTINGS = fasCogs; export const SHUTDOWN = fasPowerOff; export const SORT = fasSort; diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 2b1605702..cab23ac98 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -125,6 +125,7 @@ "ArtistNameHelpText": "The name of the artist/album to exclude (can be anything meaningful)", "ArtistProgressBarText": "{trackFileCount} / {trackCount} (Total: {totalTrackCount}, Downloading: {downloadingCount})", "ArtistType": "Artist Type", + "ArtistWasDeletedFromMusicBrainz": "Artist was deleted from MusicBrainz", "Artists": "Artists", "ArtistsEditRootFolderHelpText": "Moving artists to the same root folder can be used to rename artist folders to match updated name or naming format", "AudioInfo": "Audio Info", @@ -498,6 +499,7 @@ "Files": "Files", "FilterAlbumPlaceholder": "Filter album", "FilterArtistPlaceholder": "Filter artist", + "FilterTracksByTitleOrNumber": "Filter tracks by title or number", "Filters": "Filters", "FirstAlbum": "First Album", "FirstAlbumData": "Monitor the first albums. All other albums will be ignored",