feat(readarr): handle the book details tabs and open the edition details popup
Add BookDetailsHandler, covering the editions, history and manual search tables, the automatic search, manual download and delete book file prompts, and tab movement across the book details modal. Selecting an edition builds the EditionDetailsModal client side from the already loaded row and pushes the popup block. Readarr has no edition detail endpoint, so there is no network request and no event to dispatch. The delete book file prompt is guarded on the book files table being populated. Unlike Lidarr, where a track row carries its own file id, an edition carries none and the file id comes from a separate table that can be empty while editions are present.
This commit is contained in:
5 files changed
+1601
-4
No files matched your search
@@ -14,8 +14,9 @@ mod tests {
|
||||
use crate::models::HorizontallyScrollableText;
|
||||
use crate::models::readarr_models::{Author, AuthorStatistics, AuthorStatus};
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock, LIBRARY_BLOCKS,
|
||||
AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock, BOOK_DETAILS_BLOCKS, LIBRARY_BLOCKS,
|
||||
};
|
||||
use crate::test_handler_delegation;
|
||||
|
||||
mod test_handle_scroll_up_and_down {
|
||||
use pretty_assertions::assert_str_eq;
|
||||
@@ -878,11 +879,21 @@ mod tests {
|
||||
assert_str_eq!(sort_option.name, "Tags");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_delegates_book_details_blocks_to_book_details_handler() {
|
||||
test_handler_delegation!(
|
||||
LibraryHandler,
|
||||
ActiveReadarrBlock::AuthorDetails,
|
||||
ActiveReadarrBlock::BookDetails
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_library_handler_accepts() {
|
||||
let mut library_handler_blocks = Vec::new();
|
||||
library_handler_blocks.extend(LIBRARY_BLOCKS);
|
||||
library_handler_blocks.extend(AUTHOR_DETAILS_BLOCKS);
|
||||
library_handler_blocks.extend(BOOK_DETAILS_BLOCKS);
|
||||
|
||||
ActiveReadarrBlock::iter().for_each(|readarr_block| {
|
||||
if library_handler_blocks.contains(&readarr_block) {
|
||||
|
||||
Reference in new issue
Block a user