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 selectAll from 'Utilities/Table/selectAll';
import toggleSelected from 'Utilities/Table/toggleSelected'; import toggleSelected from 'Utilities/Table/toggleSelected';
import InteractiveImportModal from '../../InteractiveImport/InteractiveImportModal'; import InteractiveImportModal from '../../InteractiveImport/InteractiveImportModal';
import { getArtistStatusDetails } from '../ArtistStatus';
import ArtistAlternateTitles from './ArtistAlternateTitles'; import ArtistAlternateTitles from './ArtistAlternateTitles';
import ArtistDetailsLinks from './ArtistDetailsLinks'; import ArtistDetailsLinks from './ArtistDetailsLinks';
import ArtistDetailsSeasonConnector from './ArtistDetailsSeasonConnector'; import ArtistDetailsSeasonConnector from './ArtistDetailsSeasonConnector';
@ -213,7 +214,8 @@ class ArtistDetails extends Component {
nextArtist, nextArtist,
onMonitorTogglePress, onMonitorTogglePress,
onRefreshPress, onRefreshPress,
onSearchPress onSearchPress,
artistType
} = this.props; } = this.props;
const { const {
@ -236,8 +238,7 @@ class ArtistDetails extends Component {
expandedState expandedState
} = this.state; } = this.state;
const continuing = status === 'continuing'; const statusDetails = getArtistStatusDetails(status, artistType);
const endedString = artistType === 'Person' ? translate('Deceased') : translate('Inactive');
let trackFilesCountMessage = translate('TrackFilesCountMessage'); let trackFilesCountMessage = translate('TrackFilesCountMessage');
@ -526,16 +527,16 @@ class ArtistDetails extends Component {
<Label <Label
className={styles.detailsLabel} className={styles.detailsLabel}
title={continuing ? translate('ContinuingMoreAlbumsAreExpected') : translate('ContinuingNoAdditionalAlbumsAreExpected')} title={statusDetails.message}
size={sizes.LARGE} size={sizes.LARGE}
> >
<Icon <Icon
name={continuing ? icons.ARTIST_CONTINUING : icons.ARTIST_ENDED} name={statusDetails.icon}
size={17} size={17}
/> />
<span className={styles.qualityProfileName}> <span className={styles.qualityProfileName}>
{continuing ? translate('Continuing') : endedString} {statusDetails.title}
</span> </span>
</Label> </Label>

View file

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

View file

@ -1,5 +1,6 @@
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { getArtistStatusDetails } from 'Artist/ArtistStatus';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import MonitorToggleButton from 'Components/MonitorToggleButton'; import MonitorToggleButton from 'Components/MonitorToggleButton';
import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell'; import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell';
@ -11,9 +12,9 @@ import styles from './ArtistStatusCell.css';
interface ArtistStatusCellProps { interface ArtistStatusCellProps {
className: string; className: string;
artistId: number; artistId: number;
artistType?: string;
monitored: boolean; monitored: boolean;
status: string; status: string;
artistType?: string;
isSelectMode: boolean; isSelectMode: boolean;
isSaving: boolean; isSaving: boolean;
component?: React.ElementType; component?: React.ElementType;
@ -23,17 +24,16 @@ function ArtistStatusCell(props: ArtistStatusCellProps) {
const { const {
className, className,
artistId, artistId,
artistType,
monitored, monitored,
status, status,
artistType,
isSelectMode, isSelectMode,
isSaving, isSaving,
component: Component = VirtualTableRowCell, component: Component = VirtualTableRowCell,
...otherProps ...otherProps
} = props; } = props;
const endedString = const statusDetails = getArtistStatusDetails(status, artistType);
artistType === 'Person' ? translate('Deceased') : translate('Inactive');
const dispatch = useDispatch(); const dispatch = useDispatch();
const onMonitoredPress = useCallback(() => { const onMonitoredPress = useCallback(() => {
@ -63,10 +63,8 @@ function ArtistStatusCell(props: ArtistStatusCellProps) {
<Icon <Icon
className={styles.statusIcon} className={styles.statusIcon}
name={status === 'ended' ? icons.ARTIST_ENDED : icons.ARTIST_CONTINUING} name={statusDetails.icon}
title={ title={`${statusDetails.title}: ${statusDetails.message}`}
status === 'ended' ? endedString : translate('StatusEndedContinuing')
}
/> />
</Component> </Component>
); );

View file

@ -209,6 +209,7 @@ export const SCORE = fasUserPlus;
export const SEARCH = fasSearch; export const SEARCH = fasSearch;
export const ARTIST_CONTINUING = fasPlay; export const ARTIST_CONTINUING = fasPlay;
export const ARTIST_ENDED = fasStop; export const ARTIST_ENDED = fasStop;
export const ARTIST_DELETED = fasExclamationTriangle;
export const SETTINGS = fasCogs; export const SETTINGS = fasCogs;
export const SHUTDOWN = fasPowerOff; export const SHUTDOWN = fasPowerOff;
export const SORT = fasSort; export const SORT = fasSort;

View file

@ -125,6 +125,7 @@
"ArtistNameHelpText": "The name of the artist/album to exclude (can be anything meaningful)", "ArtistNameHelpText": "The name of the artist/album to exclude (can be anything meaningful)",
"ArtistProgressBarText": "{trackFileCount} / {trackCount} (Total: {totalTrackCount}, Downloading: {downloadingCount})", "ArtistProgressBarText": "{trackFileCount} / {trackCount} (Total: {totalTrackCount}, Downloading: {downloadingCount})",
"ArtistType": "Artist Type", "ArtistType": "Artist Type",
"ArtistWasDeletedFromMusicBrainz": "Artist was deleted from MusicBrainz",
"Artists": "Artists", "Artists": "Artists",
"ArtistsEditRootFolderHelpText": "Moving artists to the same root folder can be used to rename artist folders to match updated name or naming format", "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", "AudioInfo": "Audio Info",
@ -498,6 +499,7 @@
"Files": "Files", "Files": "Files",
"FilterAlbumPlaceholder": "Filter album", "FilterAlbumPlaceholder": "Filter album",
"FilterArtistPlaceholder": "Filter artist", "FilterArtistPlaceholder": "Filter artist",
"FilterTracksByTitleOrNumber": "Filter tracks by title or number",
"Filters": "Filters", "Filters": "Filters",
"FirstAlbum": "First Album", "FirstAlbum": "First Album",
"FirstAlbumData": "Monitor the first albums. All other albums will be ignored", "FirstAlbumData": "Monitor the first albums. All other albums will be ignored",