refactor(ui): Simplified the popup delegation so all future UI is easier to implement
This commit is contained in:
@@ -369,7 +369,7 @@ mod tests {
|
||||
test_edit_collection_key!(
|
||||
CollectionDetailsHandler,
|
||||
ActiveRadarrBlock::CollectionDetails,
|
||||
ActiveRadarrBlock::CollectionDetails
|
||||
Some(ActiveRadarrBlock::CollectionDetails)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -449,7 +449,11 @@ mod tests {
|
||||
#[test]
|
||||
fn test_collection_search_box_left_right_keys() {
|
||||
let mut app = App::default();
|
||||
app.data.radarr_data.collections.set_items(vec![Collection::default()]);
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
.set_items(vec![Collection::default()]);
|
||||
app.push_navigation_stack(ActiveRadarrBlock::SearchCollection.into());
|
||||
app.data.radarr_data.collections.search = Some("Test".into());
|
||||
|
||||
@@ -499,7 +503,11 @@ mod tests {
|
||||
#[test]
|
||||
fn test_collection_filter_box_left_right_keys() {
|
||||
let mut app = App::default();
|
||||
app.data.radarr_data.collections.set_items(vec![Collection::default()]);
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
.set_items(vec![Collection::default()]);
|
||||
app.push_navigation_stack(ActiveRadarrBlock::FilterCollections.into());
|
||||
app.data.radarr_data.collections.filter = Some("Test".into());
|
||||
|
||||
@@ -938,7 +946,11 @@ mod tests {
|
||||
filtered_state: Some(TableState::default()),
|
||||
..StatefulTable::default()
|
||||
};
|
||||
app.data.radarr_data.collections.set_items(vec![Collection::default()]);
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
.set_items(vec![Collection::default()]);
|
||||
|
||||
CollectionsHandler::with(ESC_KEY, &mut app, active_radarr_block, None).handle();
|
||||
|
||||
@@ -977,7 +989,11 @@ mod tests {
|
||||
#[test]
|
||||
fn test_collections_sort_prompt_block_esc() {
|
||||
let mut app = App::default();
|
||||
app.data.radarr_data.collections.set_items(vec![Collection::default()]);
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
.set_items(vec![Collection::default()]);
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Collections.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::CollectionsSortPrompt.into());
|
||||
|
||||
@@ -1174,11 +1190,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_collection_edit_key() {
|
||||
test_edit_collection_key!(
|
||||
CollectionsHandler,
|
||||
ActiveRadarrBlock::Collections,
|
||||
ActiveRadarrBlock::Collections
|
||||
);
|
||||
test_edit_collection_key!(CollectionsHandler, ActiveRadarrBlock::Collections, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -151,13 +151,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for CollectionsHandler<'
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::Collections => match self.key {
|
||||
_ if key == DEFAULT_KEYBINDINGS.edit.key => {
|
||||
self.app.push_navigation_stack(
|
||||
(
|
||||
ActiveRadarrBlock::EditCollectionPrompt,
|
||||
Some(ActiveRadarrBlock::Collections),
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
self
|
||||
.app
|
||||
.push_navigation_stack(ActiveRadarrBlock::EditCollectionPrompt.into());
|
||||
self.app.data.radarr_data.edit_collection_modal =
|
||||
Some((&self.app.data.radarr_data).into());
|
||||
self.app.data.radarr_data.selected_block =
|
||||
|
||||
Reference in New Issue
Block a user