Adding missing series Deleted UI elements

This commit is contained in:
Taloth Saldono 2019-10-20 21:38:15 +02:00
parent 41a63a5418
commit b72fbe06f7
5 changed files with 43 additions and 9 deletions

View File

@ -181,6 +181,7 @@ export const SCORE = fasUserPlus;
export const SEARCH = fasSearch; export const SEARCH = fasSearch;
export const SERIES_CONTINUING = fasPlay; export const SERIES_CONTINUING = fasPlay;
export const SERIES_ENDED = fasStop; export const SERIES_ENDED = fasStop;
export const SERIES_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

@ -1,6 +1,5 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { icons } from 'Helpers/Props';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import MonitorToggleButton from 'Components/MonitorToggleButton'; import MonitorToggleButton from 'Components/MonitorToggleButton';
import TableRow from 'Components/Table/TableRow'; import TableRow from 'Components/Table/TableRow';
@ -8,6 +7,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableSelectCell from 'Components/Table/Cells/TableSelectCell'; import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
import SeriesTitleLink from 'Series/SeriesTitleLink'; import SeriesTitleLink from 'Series/SeriesTitleLink';
import SeasonPassSeason from './SeasonPassSeason'; import SeasonPassSeason from './SeasonPassSeason';
import { getSeriesStatusDetails } from 'Series/SeriesStatus';
import styles from './SeasonPassRow.css'; import styles from './SeasonPassRow.css';
class SeasonPassRow extends Component { class SeasonPassRow extends Component {
@ -30,6 +30,8 @@ class SeasonPassRow extends Component {
onSeasonMonitoredPress onSeasonMonitoredPress
} = this.props; } = this.props;
const statusDetails = getSeriesStatusDetails(status);
return ( return (
<TableRow> <TableRow>
<TableSelectCell <TableSelectCell
@ -41,8 +43,8 @@ class SeasonPassRow extends Component {
<TableRowCell className={styles.status}> <TableRowCell className={styles.status}>
<Icon <Icon
className={styles.statusIcon} className={styles.statusIcon}
name={status === 'ended' ? icons.SERIES_ENDED : icons.SERIES_CONTINUING} name={statusDetails.icon}
title={status === 'ended' ? 'Ended' : 'Continuing'} title={statusDetails.title}
/> />
</TableRowCell> </TableRowCell>

View File

@ -34,6 +34,7 @@ import SeriesAlternateTitles from './SeriesAlternateTitles';
import SeriesDetailsSeasonConnector from './SeriesDetailsSeasonConnector'; import SeriesDetailsSeasonConnector from './SeriesDetailsSeasonConnector';
import SeriesTagsConnector from './SeriesTagsConnector'; import SeriesTagsConnector from './SeriesTagsConnector';
import SeriesDetailsLinks from './SeriesDetailsLinks'; import SeriesDetailsLinks from './SeriesDetailsLinks';
import { getSeriesStatusDetails } from 'Series/SeriesStatus';
import styles from './SeriesDetails.css'; import styles from './SeriesDetails.css';
const defaultFontSize = parseInt(fonts.defaultFontSize); const defaultFontSize = parseInt(fonts.defaultFontSize);
@ -216,7 +217,7 @@ class SeriesDetails extends Component {
overviewHeight overviewHeight
} = this.state; } = this.state;
const continuing = status === 'continuing'; const statusDetails = getSeriesStatusDetails(status);
let episodeFilesCountMessage = 'No episode files'; let episodeFilesCountMessage = 'No episode files';
@ -465,16 +466,16 @@ class SeriesDetails extends Component {
<Label <Label
className={styles.detailsLabel} className={styles.detailsLabel}
title={continuing ? 'More episodes/another season is expected' : 'No additional episodes or or another season is expected'} title={statusDetails.message}
size={sizes.LARGE} size={sizes.LARGE}
> >
<Icon <Icon
name={continuing ? icons.SERIES_CONTINUING : icons.SERIES_ENDED} name={statusDetails.icon}
size={17} size={17}
/> />
<span className={styles.qualityProfileName}> <span className={styles.qualityProfileName}>
{continuing ? 'Continuing' : 'Ended'} {statusDetails.title}
</span> </span>
</Label> </Label>

View File

@ -3,6 +3,7 @@ import React from 'react';
import { icons } from 'Helpers/Props'; import { icons } from 'Helpers/Props';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell'; import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell';
import { getSeriesStatusDetails } from 'Series/SeriesStatus';
import styles from './SeriesStatusCell.css'; import styles from './SeriesStatusCell.css';
function SeriesStatusCell(props) { function SeriesStatusCell(props) {
@ -14,6 +15,8 @@ function SeriesStatusCell(props) {
...otherProps ...otherProps
} = props; } = props;
const statusDetails = getSeriesStatusDetails(status);
return ( return (
<Component <Component
className={className} className={className}
@ -27,8 +30,8 @@ function SeriesStatusCell(props) {
<Icon <Icon
className={styles.statusIcon} className={styles.statusIcon}
name={status === 'ended' ? icons.SERIES_ENDED : icons.SERIES_CONTINUING} name={statusDetails.icon}
title={status === 'ended' ? 'Ended' : 'Continuing'} title={`${statusDetails.title}: ${statusDetails.message}`}
/> />
</Component> </Component>

View File

@ -0,0 +1,27 @@
import { icons } from 'Helpers/Props';
export function getSeriesStatusDetails(status) {
let statusDetails = {
icon: icons.SERIES_CONTINUING,
title: 'Continuing',
message: 'More episodes/another season is expected'
};
if (status === 'deleted') {
statusDetails = {
icon: icons.SERIES_DELETED,
title: 'Deleted',
message: 'Series was deleted from TheTVDB'
};
} else if (status === 'ended') {
statusDetails = {
icon: icons.SERIES_ENDED,
title: 'Ended',
message: 'No additional episodes or or another season is expected'
};
}
return statusDetails;
}