diff --git a/frontend/src/Author/AuthorStatus.js b/frontend/src/Author/AuthorStatus.js new file mode 100644 index 000000000..dcbb1ebd7 --- /dev/null +++ b/frontend/src/Author/AuthorStatus.js @@ -0,0 +1,27 @@ +import { icons } from 'Helpers/Props'; +import translate from 'Utilities/String/translate'; + +export function getAuthorStatusDetails(status) { + + let statusDetails = { + icon: icons.AUTHOR_CONTINUING, + title: translate('StatusEndedContinuing'), + message: translate('ContinuingMoreBooksAreExpected') + }; + + if (status === 'deleted') { + statusDetails = { + icon: icons.AUTHOR_DELETED, + title: translate('StatusEndedDeceased'), + message: translate('NotContinuingAuthorDeceased') + }; + } else if (status === 'ended') { + statusDetails = { + icon: icons.AUTHOR_ENDED, + title: translate('StatusEndedEnded'), + message: translate('ContinuingNoAdditionalBooksAreExpected') + }; + } + + return statusDetails; +} diff --git a/frontend/src/Author/Details/AuthorDetailsHeader.js b/frontend/src/Author/Details/AuthorDetailsHeader.js index 261fdcc35..8d14f32fd 100644 --- a/frontend/src/Author/Details/AuthorDetailsHeader.js +++ b/frontend/src/Author/Details/AuthorDetailsHeader.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import TextTruncate from 'react-text-truncate'; import AuthorPoster from 'Author/AuthorPoster'; +import { getAuthorStatusDetails } from 'Author/AuthorStatus'; import HeartRating from 'Components/HeartRating'; import Icon from 'Components/Icon'; import Label from 'Components/Label'; @@ -87,11 +88,11 @@ class AuthorDetailsHeader extends Component { titleWidth } = this.state; + const statusDetails = getAuthorStatusDetails(status); + const fanartUrl = getFanartUrl(images); const marqueeWidth = titleWidth - (isSmallScreen ? 85 : 160); - const continuing = status === 'continuing'; - let bookFilesCountMessage = translate('BookFilesCountMessage'); if (bookFileCount === 1) { @@ -236,16 +237,16 @@ class AuthorDetailsHeader extends Component { diff --git a/frontend/src/Author/Index/Table/AuthorStatusCell.js b/frontend/src/Author/Index/Table/AuthorStatusCell.js index 45187fd0a..d17f92c23 100644 --- a/frontend/src/Author/Index/Table/AuthorStatusCell.js +++ b/frontend/src/Author/Index/Table/AuthorStatusCell.js @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; +import { getAuthorStatusDetails } from 'Author/AuthorStatus'; import Icon from 'Components/Icon'; import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell'; import { icons } from 'Helpers/Props'; @@ -15,6 +16,8 @@ function AuthorStatusCell(props) { ...otherProps } = props; + const statusDetails = getAuthorStatusDetails(status); + return ( ); diff --git a/frontend/src/Bookshelf/BookshelfRow.js b/frontend/src/Bookshelf/BookshelfRow.js index c91acccf4..fd51b8628 100644 --- a/frontend/src/Bookshelf/BookshelfRow.js +++ b/frontend/src/Bookshelf/BookshelfRow.js @@ -1,12 +1,11 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import AuthorNameLink from 'Author/AuthorNameLink'; +import { getAuthorStatusDetails } from 'Author/AuthorStatus'; import Icon from 'Components/Icon'; import MonitorToggleButton from 'Components/MonitorToggleButton'; import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell'; import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell'; -import { icons } from 'Helpers/Props'; -import translate from 'Utilities/String/translate'; import BookshelfBook from './BookshelfBook'; import styles from './BookshelfRow.css'; @@ -30,6 +29,8 @@ class BookshelfRow extends Component { onBookMonitoredPress } = this.props; + const statusDetails = getAuthorStatusDetails(status); + return ( <> diff --git a/frontend/src/Helpers/Props/icons.js b/frontend/src/Helpers/Props/icons.js index 0b67791a8..3e56a8464 100644 --- a/frontend/src/Helpers/Props/icons.js +++ b/frontend/src/Helpers/Props/icons.js @@ -204,6 +204,7 @@ export const SCORE = fasUserPlus; export const SEARCH = fasSearch; export const AUTHOR_CONTINUING = fasPlay; export const AUTHOR_ENDED = fasStop; +export const AUTHOR_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 a2ad52366..e4f994f58 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -654,6 +654,7 @@ "NoUpdatesAreAvailable": "No updates are available", "None": "None", "NotAvailable": "Not Available", + "NotContinuingAuthorDeceased": "Author is deceased. No more books are expected.", "NotMonitored": "Not Monitored", "NotificationStatusAllClientHealthCheckMessage": "All notifications are unavailable due to failures", "NotificationStatusSingleClientHealthCheckMessage": "Notifications unavailable due to failures: {0}",