From b72fbe06f78095d0de7957a232f434e6e33f6543 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 20 Oct 2019 21:38:15 +0200 Subject: [PATCH] Adding missing series Deleted UI elements --- frontend/src/Helpers/Props/icons.js | 1 + frontend/src/SeasonPass/SeasonPassRow.js | 8 +++--- frontend/src/Series/Details/SeriesDetails.js | 9 ++++--- .../Series/Index/Table/SeriesStatusCell.js | 7 +++-- frontend/src/Series/SeriesStatus.js | 27 +++++++++++++++++++ 5 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 frontend/src/Series/SeriesStatus.js diff --git a/frontend/src/Helpers/Props/icons.js b/frontend/src/Helpers/Props/icons.js index 1feda7923..21553bc87 100644 --- a/frontend/src/Helpers/Props/icons.js +++ b/frontend/src/Helpers/Props/icons.js @@ -181,6 +181,7 @@ export const SCORE = fasUserPlus; export const SEARCH = fasSearch; export const SERIES_CONTINUING = fasPlay; export const SERIES_ENDED = fasStop; +export const SERIES_DELETED = fasExclamationTriangle; export const SETTINGS = fasCogs; export const SHUTDOWN = fasPowerOff; export const SORT = fasSort; diff --git a/frontend/src/SeasonPass/SeasonPassRow.js b/frontend/src/SeasonPass/SeasonPassRow.js index 6da75ded9..6fb903d1a 100644 --- a/frontend/src/SeasonPass/SeasonPassRow.js +++ b/frontend/src/SeasonPass/SeasonPassRow.js @@ -1,6 +1,5 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { icons } from 'Helpers/Props'; import Icon from 'Components/Icon'; import MonitorToggleButton from 'Components/MonitorToggleButton'; 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 SeriesTitleLink from 'Series/SeriesTitleLink'; import SeasonPassSeason from './SeasonPassSeason'; +import { getSeriesStatusDetails } from 'Series/SeriesStatus'; import styles from './SeasonPassRow.css'; class SeasonPassRow extends Component { @@ -30,6 +30,8 @@ class SeasonPassRow extends Component { onSeasonMonitoredPress } = this.props; + const statusDetails = getSeriesStatusDetails(status); + return ( diff --git a/frontend/src/Series/Details/SeriesDetails.js b/frontend/src/Series/Details/SeriesDetails.js index 573725bc1..cd14014b9 100644 --- a/frontend/src/Series/Details/SeriesDetails.js +++ b/frontend/src/Series/Details/SeriesDetails.js @@ -34,6 +34,7 @@ import SeriesAlternateTitles from './SeriesAlternateTitles'; import SeriesDetailsSeasonConnector from './SeriesDetailsSeasonConnector'; import SeriesTagsConnector from './SeriesTagsConnector'; import SeriesDetailsLinks from './SeriesDetailsLinks'; +import { getSeriesStatusDetails } from 'Series/SeriesStatus'; import styles from './SeriesDetails.css'; const defaultFontSize = parseInt(fonts.defaultFontSize); @@ -216,7 +217,7 @@ class SeriesDetails extends Component { overviewHeight } = this.state; - const continuing = status === 'continuing'; + const statusDetails = getSeriesStatusDetails(status); let episodeFilesCountMessage = 'No episode files'; @@ -465,16 +466,16 @@ class SeriesDetails extends Component { diff --git a/frontend/src/Series/Index/Table/SeriesStatusCell.js b/frontend/src/Series/Index/Table/SeriesStatusCell.js index 279fb25cf..dd1b300ba 100644 --- a/frontend/src/Series/Index/Table/SeriesStatusCell.js +++ b/frontend/src/Series/Index/Table/SeriesStatusCell.js @@ -3,6 +3,7 @@ import React from 'react'; import { icons } from 'Helpers/Props'; import Icon from 'Components/Icon'; import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell'; +import { getSeriesStatusDetails } from 'Series/SeriesStatus'; import styles from './SeriesStatusCell.css'; function SeriesStatusCell(props) { @@ -14,6 +15,8 @@ function SeriesStatusCell(props) { ...otherProps } = props; + const statusDetails = getSeriesStatusDetails(status); + return ( diff --git a/frontend/src/Series/SeriesStatus.js b/frontend/src/Series/SeriesStatus.js new file mode 100644 index 000000000..2e3ad1d95 --- /dev/null +++ b/frontend/src/Series/SeriesStatus.js @@ -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; +}