From 5e7e0eb50bb3329651019b0afe24216d6e7e1453 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 6 Mar 2024 07:56:40 +0200 Subject: [PATCH] New: Append author name to Interactive Search header Closes #3343 --- frontend/src/Author/Details/BookRow.js | 3 +++ frontend/src/Author/Details/BookRowConnector.js | 1 + frontend/src/Book/BookSearchCell.js | 3 +++ frontend/src/Book/Search/BookInteractiveSearchModal.js | 3 +++ .../Book/Search/BookInteractiveSearchModalContent.js | 10 ++++++++-- src/NzbDrone.Core/Localization/Core/en.json | 2 ++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/frontend/src/Author/Details/BookRow.js b/frontend/src/Author/Details/BookRow.js index 04ea75539..20f411bb2 100644 --- a/frontend/src/Author/Details/BookRow.js +++ b/frontend/src/Author/Details/BookRow.js @@ -59,6 +59,7 @@ class BookRow extends Component { releaseDate, title, seriesTitle, + authorName, position, pageCount, ratings, @@ -211,6 +212,7 @@ class BookRow extends Component { bookId={id} authorId={authorId} bookTitle={title} + authorName={authorName} /> ); } @@ -229,6 +231,7 @@ BookRow.propTypes = { releaseDate: PropTypes.string, title: PropTypes.string.isRequired, seriesTitle: PropTypes.string.isRequired, + authorName: PropTypes.string.isRequired, position: PropTypes.string, pageCount: PropTypes.number, ratings: PropTypes.object.isRequired, diff --git a/frontend/src/Author/Details/BookRowConnector.js b/frontend/src/Author/Details/BookRowConnector.js index e6ab2f9dd..8cd390b65 100644 --- a/frontend/src/Author/Details/BookRowConnector.js +++ b/frontend/src/Author/Details/BookRowConnector.js @@ -33,6 +33,7 @@ function createMapStateToProps() { (author = {}, bookFiles, bookId) => { return { authorMonitored: author.monitored, + authorName: author.authorName, bookFiles: bookFiles[bookId] ?? [] }; } diff --git a/frontend/src/Book/BookSearchCell.js b/frontend/src/Book/BookSearchCell.js index abae2c639..763c9b0e1 100644 --- a/frontend/src/Book/BookSearchCell.js +++ b/frontend/src/Book/BookSearchCell.js @@ -38,6 +38,7 @@ class BookSearchCell extends Component { const { bookId, bookTitle, + authorName, isSearching, onSearchPress, ...otherProps @@ -60,6 +61,7 @@ class BookSearchCell extends Component { isOpen={this.state.isDetailsModalOpen} bookId={bookId} bookTitle={bookTitle} + authorName={authorName} onModalClose={this.onDetailsModalClose} {...otherProps} /> @@ -73,6 +75,7 @@ BookSearchCell.propTypes = { bookId: PropTypes.number.isRequired, authorId: PropTypes.number.isRequired, bookTitle: PropTypes.string.isRequired, + authorName: PropTypes.string.isRequired, isSearching: PropTypes.bool.isRequired, onSearchPress: PropTypes.func.isRequired }; diff --git a/frontend/src/Book/Search/BookInteractiveSearchModal.js b/frontend/src/Book/Search/BookInteractiveSearchModal.js index 670b5064e..130624c7a 100644 --- a/frontend/src/Book/Search/BookInteractiveSearchModal.js +++ b/frontend/src/Book/Search/BookInteractiveSearchModal.js @@ -9,6 +9,7 @@ function BookInteractiveSearchModal(props) { isOpen, bookId, bookTitle, + authorName, onModalClose } = props; @@ -22,6 +23,7 @@ function BookInteractiveSearchModal(props) { @@ -32,6 +34,7 @@ BookInteractiveSearchModal.propTypes = { isOpen: PropTypes.bool.isRequired, bookId: PropTypes.number.isRequired, bookTitle: PropTypes.string.isRequired, + authorName: PropTypes.string.isRequired, onModalClose: PropTypes.func.isRequired }; diff --git a/frontend/src/Book/Search/BookInteractiveSearchModalContent.js b/frontend/src/Book/Search/BookInteractiveSearchModalContent.js index c9beaea61..bebaf8f72 100644 --- a/frontend/src/Book/Search/BookInteractiveSearchModalContent.js +++ b/frontend/src/Book/Search/BookInteractiveSearchModalContent.js @@ -7,18 +7,23 @@ import ModalFooter from 'Components/Modal/ModalFooter'; import ModalHeader from 'Components/Modal/ModalHeader'; import { scrollDirections } from 'Helpers/Props'; import InteractiveSearchConnector from 'InteractiveSearch/InteractiveSearchConnector'; +import translate from 'Utilities/String/translate'; function BookInteractiveSearchModalContent(props) { const { bookId, bookTitle, + authorName, onModalClose } = props; return ( - Interactive Search {bookId != null && `- ${bookTitle}`} + {bookId === null ? + translate('InteractiveSearchModalHeader') : + translate('InteractiveSearchModalHeaderBookAuthor', { bookTitle, authorName }) + } @@ -32,7 +37,7 @@ function BookInteractiveSearchModalContent(props) { @@ -42,6 +47,7 @@ function BookInteractiveSearchModalContent(props) { BookInteractiveSearchModalContent.propTypes = { bookId: PropTypes.number.isRequired, bookTitle: PropTypes.string.isRequired, + authorName: PropTypes.string.isRequired, onModalClose: PropTypes.func.isRequired }; diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 32e539e90..42922d523 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -459,6 +459,8 @@ "IndexersSettingsSummary": "Indexers and release restrictions", "InstanceName": "Instance Name", "InstanceNameHelpText": "Instance name in tab and for Syslog app name", + "InteractiveSearchModalHeader": "Interactive Search", + "InteractiveSearchModalHeaderBookAuthor": "Interactive Search - {bookTitle} by {authorName}", "Interval": "Interval", "InvalidUILanguage": "Your UI is set to an invalid language, correct it and save your settings", "IsCalibreLibraryHelpText": "Use Calibre Content Server to manipulate library",