Added sorting to the collections table, and fixed a bug that was refreshing the underlying table while users may be selecting a sort option.

This commit is contained in:
2024-02-14 16:09:42 -07:00
parent 32a8a4de76
commit b49bfaa9c1
12 changed files with 814 additions and 108 deletions
@@ -212,6 +212,7 @@ pub enum ActiveRadarrBlock {
AddRootFolderPrompt,
AutomaticallySearchMoviePrompt,
Collections,
CollectionsSortPrompt,
CollectionDetails,
Cast,
Crew,
@@ -299,8 +300,9 @@ pub static LIBRARY_BLOCKS: [ActiveRadarrBlock; 7] = [
ActiveRadarrBlock::FilterMoviesError,
ActiveRadarrBlock::UpdateAllMoviesPrompt,
];
pub static COLLECTIONS_BLOCKS: [ActiveRadarrBlock; 6] = [
pub static COLLECTIONS_BLOCKS: [ActiveRadarrBlock; 7] = [
ActiveRadarrBlock::Collections,
ActiveRadarrBlock::CollectionsSortPrompt,
ActiveRadarrBlock::SearchCollection,
ActiveRadarrBlock::SearchCollectionError,
ActiveRadarrBlock::FilterCollections,
@@ -268,8 +268,9 @@ mod tests {
#[test]
fn test_collections_blocks_contents() {
assert_eq!(COLLECTIONS_BLOCKS.len(), 6);
assert_eq!(COLLECTIONS_BLOCKS.len(), 7);
assert!(COLLECTIONS_BLOCKS.contains(&ActiveRadarrBlock::Collections));
assert!(COLLECTIONS_BLOCKS.contains(&ActiveRadarrBlock::CollectionsSortPrompt));
assert!(COLLECTIONS_BLOCKS.contains(&ActiveRadarrBlock::SearchCollection));
assert!(COLLECTIONS_BLOCKS.contains(&ActiveRadarrBlock::SearchCollectionError));
assert!(COLLECTIONS_BLOCKS.contains(&ActiveRadarrBlock::FilterCollections));