Refactored table filtering and searching so that they are now relative to the table being filtered/searched on. Also created two new widgets for error messages and popups to make life easier moving forward. Going to refactor table sorting into StatefulTable's as well so all tables can be searched, filtered, and sorted moving forwards.
This commit is contained in:
@@ -19,8 +19,8 @@ use crate::ui::widgets::button::Button;
|
||||
use crate::ui::widgets::checkbox::Checkbox;
|
||||
use crate::ui::widgets::input_box::InputBox;
|
||||
use crate::ui::{
|
||||
draw_drop_down_popup, draw_large_popup_over_background_fn_with_ui,
|
||||
draw_medium_popup_over, draw_popup, draw_selectable_list, DrawUi,
|
||||
draw_drop_down_popup, draw_large_popup_over_background_fn_with_ui, draw_medium_popup_over,
|
||||
draw_popup, draw_selectable_list, DrawUi,
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -91,31 +91,21 @@ impl DrawUi for EditMovieUi {
|
||||
}
|
||||
|
||||
fn draw_edit_movie_confirmation_prompt(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let (movie_title, movie_overview) =
|
||||
if let Some(filtered_movies) = app.data.radarr_data.filtered_movies.as_ref() {
|
||||
(
|
||||
filtered_movies.current_selection().title.text.clone(),
|
||||
filtered_movies.current_selection().overview.clone(),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
.current_selection()
|
||||
.title
|
||||
.text
|
||||
.clone(),
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
.current_selection()
|
||||
.overview
|
||||
.clone(),
|
||||
)
|
||||
};
|
||||
let movie_title = app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
.current_selection()
|
||||
.title
|
||||
.text
|
||||
.clone();
|
||||
let movie_overview = app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
.current_selection()
|
||||
.overview
|
||||
.clone();
|
||||
let title = format!("Edit - {movie_title}");
|
||||
let yes_no_value = app.data.radarr_data.prompt_confirm;
|
||||
let selected_block = app.data.radarr_data.selected_block.get_active_block();
|
||||
|
||||
Reference in New Issue
Block a user