Added field_type to Radarr events to dynamically display fields at runtime. Also updated the keybinding for events in the systems tab to reuse the 'e' key.
This commit is contained in:
@@ -585,10 +585,10 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
|
||||
_ if *key == DEFAULT_KEYBINDINGS.refresh.key => {
|
||||
self.app.should_refresh = true;
|
||||
}
|
||||
_ if *key == DEFAULT_KEYBINDINGS.queue.key => {
|
||||
_ if *key == DEFAULT_KEYBINDINGS.events.key => {
|
||||
self
|
||||
.app
|
||||
.push_navigation_stack(ActiveRadarrBlock::SystemQueue.into());
|
||||
.push_navigation_stack(ActiveRadarrBlock::SystemQueuedEvents.into());
|
||||
}
|
||||
_ if *key == DEFAULT_KEYBINDINGS.logs.key => {
|
||||
self
|
||||
|
||||
@@ -962,11 +962,11 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_queue_key() {
|
||||
fn test_queued_events_key() {
|
||||
let mut app = App::default();
|
||||
|
||||
RadarrHandler::with(
|
||||
&DEFAULT_KEYBINDINGS.queue.key,
|
||||
&DEFAULT_KEYBINDINGS.events.key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::System,
|
||||
&None,
|
||||
@@ -975,7 +975,7 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::SystemQueue.into()
|
||||
&ActiveRadarrBlock::SystemQueuedEvents.into()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1293,7 +1293,7 @@ mod tests {
|
||||
ActiveRadarrBlock::System,
|
||||
ActiveRadarrBlock::SystemLogs,
|
||||
ActiveRadarrBlock::SystemTasks,
|
||||
ActiveRadarrBlock::SystemQueue,
|
||||
ActiveRadarrBlock::SystemQueuedEvents,
|
||||
ActiveRadarrBlock::SystemUpdates
|
||||
)]
|
||||
active_radarr_block: ActiveRadarrBlock,
|
||||
|
||||
@@ -41,7 +41,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for SystemDetailsHandler
|
||||
ActiveRadarrBlock::SystemLogs => self.app.data.radarr_data.log_details.scroll_up(),
|
||||
ActiveRadarrBlock::SystemTasks => self.app.data.radarr_data.tasks.scroll_up(),
|
||||
ActiveRadarrBlock::SystemUpdates => self.app.data.radarr_data.updates.scroll_up(),
|
||||
ActiveRadarrBlock::SystemQueue => self.app.data.radarr_data.queued_events.scroll_up(),
|
||||
ActiveRadarrBlock::SystemQueuedEvents => self.app.data.radarr_data.queued_events.scroll_up(),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for SystemDetailsHandler
|
||||
ActiveRadarrBlock::SystemLogs => self.app.data.radarr_data.log_details.scroll_down(),
|
||||
ActiveRadarrBlock::SystemTasks => self.app.data.radarr_data.tasks.scroll_down(),
|
||||
ActiveRadarrBlock::SystemUpdates => self.app.data.radarr_data.updates.scroll_down(),
|
||||
ActiveRadarrBlock::SystemQueue => self.app.data.radarr_data.queued_events.scroll_down(),
|
||||
ActiveRadarrBlock::SystemQueuedEvents => {
|
||||
self.app.data.radarr_data.queued_events.scroll_down()
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -61,7 +63,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for SystemDetailsHandler
|
||||
ActiveRadarrBlock::SystemLogs => self.app.data.radarr_data.log_details.scroll_to_top(),
|
||||
ActiveRadarrBlock::SystemTasks => self.app.data.radarr_data.tasks.scroll_to_top(),
|
||||
ActiveRadarrBlock::SystemUpdates => self.app.data.radarr_data.updates.scroll_to_top(),
|
||||
ActiveRadarrBlock::SystemQueue => self.app.data.radarr_data.queued_events.scroll_to_top(),
|
||||
ActiveRadarrBlock::SystemQueuedEvents => {
|
||||
self.app.data.radarr_data.queued_events.scroll_to_top()
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -71,7 +75,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for SystemDetailsHandler
|
||||
ActiveRadarrBlock::SystemLogs => self.app.data.radarr_data.log_details.scroll_to_bottom(),
|
||||
ActiveRadarrBlock::SystemTasks => self.app.data.radarr_data.tasks.scroll_to_bottom(),
|
||||
ActiveRadarrBlock::SystemUpdates => self.app.data.radarr_data.updates.scroll_to_bottom(),
|
||||
ActiveRadarrBlock::SystemQueue => self.app.data.radarr_data.queued_events.scroll_to_bottom(),
|
||||
ActiveRadarrBlock::SystemQueuedEvents => {
|
||||
self.app.data.radarr_data.queued_events.scroll_to_bottom()
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -134,7 +140,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for SystemDetailsHandler
|
||||
self.app.data.radarr_data.reset_log_details_list();
|
||||
self.app.pop_navigation_stack()
|
||||
}
|
||||
ActiveRadarrBlock::SystemQueue
|
||||
ActiveRadarrBlock::SystemQueuedEvents
|
||||
| ActiveRadarrBlock::SystemTasks
|
||||
| ActiveRadarrBlock::SystemUpdates => self.app.pop_navigation_stack(),
|
||||
ActiveRadarrBlock::SystemTaskStartConfirmPrompt => {
|
||||
|
||||
@@ -43,7 +43,7 @@ mod tests {
|
||||
SystemDetailsHandler,
|
||||
queued_events,
|
||||
simple_stateful_iterable_vec!(QueueEvent, String, name),
|
||||
ActiveRadarrBlock::SystemQueue,
|
||||
ActiveRadarrBlock::SystemQueuedEvents,
|
||||
None,
|
||||
name
|
||||
);
|
||||
@@ -89,7 +89,7 @@ mod tests {
|
||||
SystemDetailsHandler,
|
||||
queued_events,
|
||||
extended_stateful_iterable_vec!(QueueEvent, String, name),
|
||||
ActiveRadarrBlock::SystemQueue,
|
||||
ActiveRadarrBlock::SystemQueuedEvents,
|
||||
None,
|
||||
name
|
||||
);
|
||||
@@ -357,18 +357,23 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_esc_system_queue() {
|
||||
fn test_esc_system_queued_events() {
|
||||
let mut app = App::default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::System.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::SystemQueue.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::SystemQueuedEvents.into());
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.queued_events
|
||||
.set_items(vec![QueueEvent::default()]);
|
||||
|
||||
SystemDetailsHandler::with(&ESC_KEY, &mut app, &ActiveRadarrBlock::SystemQueue, &None)
|
||||
.handle();
|
||||
SystemDetailsHandler::with(
|
||||
&ESC_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::SystemQueuedEvents,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(app.get_current_route(), &ActiveRadarrBlock::System.into());
|
||||
}
|
||||
@@ -423,7 +428,7 @@ mod tests {
|
||||
#[values(
|
||||
ActiveRadarrBlock::SystemLogs,
|
||||
ActiveRadarrBlock::SystemTasks,
|
||||
ActiveRadarrBlock::SystemQueue,
|
||||
ActiveRadarrBlock::SystemQueuedEvents,
|
||||
ActiveRadarrBlock::SystemUpdates
|
||||
)]
|
||||
active_radarr_block: ActiveRadarrBlock,
|
||||
|
||||
Reference in New Issue
Block a user