Adding missing artist Deleted UI elements

(cherry picked from commit b72fbe06f78095d0de7957a232f434e6e33f6543)
This commit is contained in:
Taloth Saldono 2019-10-20 21:38:15 +02:00 committed by bakerboy448
parent 477d0b70d0
commit b8121759a7
6 changed files with 43 additions and 15 deletions

View file

@ -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;
}

View file

@ -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 {
<Label
className={styles.detailsLabel}
title={continuing ? translate('ContinuingMoreAlbumsAreExpected') : translate('ContinuingNoAdditionalAlbumsAreExpected')}
title={statusDetails.message}
size={sizes.LARGE}
>
<Icon
name={continuing ? icons.ARTIST_CONTINUING : icons.ARTIST_ENDED}
name={statusDetails.icon}
size={17}
/>
<span className={styles.qualityProfileName}>
{continuing ? translate('Continuing') : endedString}
{statusDetails.title}
</span>
</Label>

View file

@ -164,7 +164,6 @@ function ArtistIndexRow(props: ArtistIndexRowProps) {
key={name}
className={styles[name]}
artistId={artistId}
artistType={artistType}
monitored={monitored}
status={status}
isSelectMode={isSelectMode}

View file

@ -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) {
<Icon
className={styles.statusIcon}
name={status === 'ended' ? icons.ARTIST_ENDED : icons.ARTIST_CONTINUING}
title={
status === 'ended' ? endedString : translate('StatusEndedContinuing')
}
name={statusDetails.icon}
title={`${statusDetails.title}: ${statusDetails.message}`}
/>
</Component>
);

View file

@ -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;

View file

@ -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",