test: Updated Rust edition to 2024 and refactored network module tests to be more idiomatic
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use ratatui::Frame;
|
||||
use ratatui::layout::{Constraint, Rect};
|
||||
use ratatui::prelude::Layout;
|
||||
use ratatui::widgets::ListItem;
|
||||
use ratatui::Frame;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::Route;
|
||||
use crate::models::servarr_data::sonarr::modals::EditSeriesModal;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, EDIT_SERIES_BLOCKS, SERIES_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::models::Route;
|
||||
use crate::render_selectable_input_box;
|
||||
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
@@ -20,7 +20,7 @@ use crate::ui::widgets::checkbox::Checkbox;
|
||||
use crate::ui::widgets::input_box::InputBox;
|
||||
use crate::ui::widgets::popup::{Popup, Size};
|
||||
use crate::ui::widgets::selectable_list::SelectableList;
|
||||
use crate::ui::{draw_popup, DrawUi};
|
||||
use crate::ui::{DrawUi, draw_popup};
|
||||
|
||||
use super::series_details_ui::SeriesDetailsUi;
|
||||
|
||||
@@ -41,10 +41,10 @@ impl DrawUi for EditSeriesUi {
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
if let Route::Sonarr(active_sonarr_block, context_option) = app.get_current_route() {
|
||||
if let Some(context) = context_option {
|
||||
if SERIES_DETAILS_BLOCKS.contains(&context) {
|
||||
draw_popup(f, app, SeriesDetailsUi::draw, Size::Large);
|
||||
}
|
||||
if let Some(context) = context_option
|
||||
&& SERIES_DETAILS_BLOCKS.contains(&context)
|
||||
{
|
||||
draw_popup(f, app, SeriesDetailsUi::draw, Size::Large);
|
||||
}
|
||||
|
||||
let draw_edit_series_prompt = |f: &mut Frame<'_>, app: &mut App<'_>, prompt_area: Rect| {
|
||||
@@ -105,21 +105,31 @@ fn draw_edit_series_confirmation_prompt(f: &mut Frame<'_>, app: &mut App<'_>, ar
|
||||
let selected_quality_profile = quality_profile_list.current_selection();
|
||||
let selected_language_profile = language_profile_list.current_selection();
|
||||
|
||||
let [paragraph_area, monitored_area, season_folder_area, quality_profile_area, language_profile_area, series_type_area, path_area, tags_area, _, buttons_area] =
|
||||
Layout::vertical([
|
||||
Constraint::Length(6),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Fill(1),
|
||||
Constraint::Length(3),
|
||||
])
|
||||
.margin(1)
|
||||
.areas(area);
|
||||
let [
|
||||
paragraph_area,
|
||||
monitored_area,
|
||||
season_folder_area,
|
||||
quality_profile_area,
|
||||
language_profile_area,
|
||||
series_type_area,
|
||||
path_area,
|
||||
tags_area,
|
||||
_,
|
||||
buttons_area,
|
||||
] = Layout::vertical([
|
||||
Constraint::Length(6),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Fill(1),
|
||||
Constraint::Length(3),
|
||||
])
|
||||
.margin(1)
|
||||
.areas(area);
|
||||
let [save_area, cancel_area] =
|
||||
Layout::horizontal([Constraint::Percentage(50), Constraint::Percentage(50)])
|
||||
.areas(buttons_area);
|
||||
|
||||
Reference in New Issue
Block a user