fix(style): Addressed linter complaints on formatting
This commit is contained in:
@@ -33,7 +33,7 @@ impl DrawUi for BlocklistUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Radarr(active_radarr_block, _) = app.get_current_route() {
|
||||
draw_blocklist_table(f, app, area);
|
||||
|
||||
|
||||
match active_radarr_block {
|
||||
ActiveRadarrBlock::BlocklistItemDetails => {
|
||||
draw_blocklist_item_details_popup(f, app);
|
||||
|
||||
@@ -17,7 +17,13 @@ mod tests {
|
||||
assert!(!CollectionDetailsUi::accepts(active_radarr_block.into()));
|
||||
}
|
||||
});
|
||||
|
||||
assert!(CollectionDetailsUi::accepts((ActiveRadarrBlock::CollectionDetails, Some(ActiveRadarrBlock::CollectionDetails)).into()));
|
||||
|
||||
assert!(CollectionDetailsUi::accepts(
|
||||
(
|
||||
ActiveRadarrBlock::CollectionDetails,
|
||||
Some(ActiveRadarrBlock::CollectionDetails)
|
||||
)
|
||||
.into()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ impl DrawUi for EditCollectionUi {
|
||||
return EDIT_COLLECTION_BLOCKS.contains(&active_radarr_block)
|
||||
&& context == ActiveRadarrBlock::CollectionDetails;
|
||||
}
|
||||
|
||||
|
||||
return EDIT_COLLECTION_BLOCKS.contains(&active_radarr_block);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,12 @@ mod tests {
|
||||
}
|
||||
});
|
||||
|
||||
assert!(EditCollectionUi::accepts((ActiveRadarrBlock::EditCollectionPrompt, Some(ActiveRadarrBlock::CollectionDetails)).into()));
|
||||
assert!(EditCollectionUi::accepts(
|
||||
(
|
||||
ActiveRadarrBlock::EditCollectionPrompt,
|
||||
Some(ActiveRadarrBlock::CollectionDetails)
|
||||
)
|
||||
.into()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ impl DrawUi for DownloadsUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Radarr(active_radarr_block, _) = app.get_current_route() {
|
||||
draw_downloads(f, app, area);
|
||||
|
||||
|
||||
match active_radarr_block {
|
||||
ActiveRadarrBlock::DeleteDownloadPrompt => {
|
||||
let prompt = format!(
|
||||
|
||||
@@ -34,12 +34,7 @@ impl DrawUi for EditIndexerUi {
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_edit_indexer_prompt,
|
||||
Size::WideLargePrompt,
|
||||
);
|
||||
draw_popup(f, app, draw_edit_indexer_prompt, Size::WideLargePrompt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,13 @@ impl DrawUi for IndexersUi {
|
||||
f.render_widget(loading_popup, f.area());
|
||||
} else {
|
||||
let popup = {
|
||||
let result = app.data.radarr_data.indexer_test_errors.as_ref().expect("Test result is unpopulated");
|
||||
|
||||
let result = app
|
||||
.data
|
||||
.radarr_data
|
||||
.indexer_test_errors
|
||||
.as_ref()
|
||||
.expect("Test result is unpopulated");
|
||||
|
||||
if !result.is_empty() {
|
||||
Popup::new(Message::new(result.clone())).size(Size::LargeMessage)
|
||||
} else {
|
||||
|
||||
@@ -13,6 +13,7 @@ use crate::models::radarr_models::AddMovieSearchResult;
|
||||
use crate::models::servarr_data::radarr::modals::AddMovieModal;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, ADD_MOVIE_BLOCKS};
|
||||
use crate::models::{EnumDisplayStyle, Route};
|
||||
use crate::ui::radarr_ui::collections::CollectionsUi;
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{
|
||||
borderless_block, get_width_from_percentage, layout_block, layout_paragraph_borderless,
|
||||
@@ -27,7 +28,6 @@ use crate::ui::widgets::selectable_list::SelectableList;
|
||||
use crate::ui::{draw_popup, DrawUi};
|
||||
use crate::utils::convert_runtime;
|
||||
use crate::{render_selectable_input_box, App};
|
||||
use crate::ui::radarr_ui::collections::CollectionsUi;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "add_movie_ui_tests.rs"]
|
||||
@@ -59,12 +59,7 @@ impl DrawUi for AddMovieUi {
|
||||
| ActiveRadarrBlock::AddMovieSelectQualityProfile
|
||||
| ActiveRadarrBlock::AddMovieSelectRootFolder
|
||||
| ActiveRadarrBlock::AddMovieTagsInput => {
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_confirmation_popup,
|
||||
Size::Medium,
|
||||
);
|
||||
draw_popup(f, app, draw_confirmation_popup, Size::Medium);
|
||||
}
|
||||
ActiveRadarrBlock::AddMovieAlreadyInLibrary => {
|
||||
f.render_widget(
|
||||
|
||||
@@ -47,7 +47,7 @@ impl DrawUi for EditMovieUi {
|
||||
draw_popup(f, app, MovieDetailsUi::draw, Size::Large);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
draw_popup(f, app, draw_edit_movie_confirmation_prompt, Size::Medium);
|
||||
|
||||
match active_radarr_block {
|
||||
|
||||
@@ -12,7 +12,10 @@ use crate::models::servarr_data::radarr::modals::MovieDetailsModal;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, MOVIE_DETAILS_BLOCKS};
|
||||
use crate::models::Route;
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{borderless_block, decorate_peer_style, get_width_from_percentage, layout_block_bottom_border, layout_block_top_border};
|
||||
use crate::ui::utils::{
|
||||
borderless_block, decorate_peer_style, get_width_from_percentage, layout_block_bottom_border,
|
||||
layout_block_top_border,
|
||||
};
|
||||
use crate::ui::widgets::confirmation_prompt::ConfirmationPrompt;
|
||||
use crate::ui::widgets::loading_block::LoadingBlock;
|
||||
use crate::ui::widgets::managarr_table::ManagarrTable;
|
||||
@@ -84,12 +87,7 @@ impl DrawUi for MovieDetailsUi {
|
||||
}
|
||||
};
|
||||
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_movie_info_popup,
|
||||
Size::Large,
|
||||
);
|
||||
draw_popup(f, app, draw_movie_info_popup, Size::Large);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, MOVIE_DETAILS_BLOCKS};
|
||||
use crate::ui::radarr_ui::library::movie_details_ui::{style_from_download_status, MovieDetailsUi,
|
||||
use crate::ui::radarr_ui::library::movie_details_ui::{
|
||||
style_from_download_status, MovieDetailsUi,
|
||||
};
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::DrawUi;
|
||||
|
||||
@@ -32,14 +32,11 @@ impl DrawUi for RootFoldersUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Radarr(active_radarr_block, _) = app.get_current_route() {
|
||||
draw_root_folders(f, app, area);
|
||||
|
||||
|
||||
match active_radarr_block {
|
||||
ActiveRadarrBlock::AddRootFolderPrompt => draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_add_root_folder_prompt_box,
|
||||
Size::InputBox,
|
||||
),
|
||||
ActiveRadarrBlock::AddRootFolderPrompt => {
|
||||
draw_popup(f, app, draw_add_root_folder_prompt_box, Size::InputBox)
|
||||
}
|
||||
ActiveRadarrBlock::DeleteRootFolderPrompt => {
|
||||
let prompt = format!(
|
||||
"Do you really want to delete this root folder: \n{}?",
|
||||
|
||||
@@ -64,7 +64,7 @@ impl DrawUi for SystemUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let route = app.get_current_route();
|
||||
draw_system_ui_layout(f, app, area);
|
||||
|
||||
|
||||
if SystemDetailsUi::accepts(route) {
|
||||
SystemDetailsUi::draw(f, app, area);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,7 @@ use crate::models::radarr_models::RadarrTask;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, SYSTEM_DETAILS_BLOCKS};
|
||||
use crate::models::Route;
|
||||
use crate::ui::radarr_ui::system::{
|
||||
draw_queued_events, extract_task_props, TASK_TABLE_CONSTRAINTS,
|
||||
TASK_TABLE_HEADERS,
|
||||
draw_queued_events, extract_task_props, TASK_TABLE_CONSTRAINTS, TASK_TABLE_HEADERS,
|
||||
};
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{borderless_block, style_log_list_item, title_block};
|
||||
@@ -44,19 +43,11 @@ impl DrawUi for SystemDetailsUi {
|
||||
draw_logs_popup(f, app);
|
||||
}
|
||||
ActiveRadarrBlock::SystemTasks | ActiveRadarrBlock::SystemTaskStartConfirmPrompt => {
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_tasks_popup,
|
||||
Size::Large,
|
||||
)
|
||||
draw_popup(f, app, draw_tasks_popup, Size::Large)
|
||||
}
|
||||
ActiveRadarrBlock::SystemQueuedEvents => {
|
||||
draw_popup(f, app, draw_queued_events, Size::Medium)
|
||||
}
|
||||
ActiveRadarrBlock::SystemQueuedEvents => draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_queued_events,
|
||||
Size::Medium,
|
||||
),
|
||||
ActiveRadarrBlock::SystemUpdates => {
|
||||
draw_updates_popup(f, app);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ impl DrawUi for BlocklistUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Sonarr(active_sonarr_block, _) = app.get_current_route() {
|
||||
draw_blocklist_table(f, app, area);
|
||||
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::BlocklistItemDetails => {
|
||||
draw_blocklist_item_details_popup(f, app);
|
||||
|
||||
@@ -34,12 +34,7 @@ impl DrawUi for EditIndexerUi {
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_edit_indexer_prompt,
|
||||
Size::WideLargePrompt,
|
||||
);
|
||||
draw_popup(f, app, draw_edit_indexer_prompt, Size::WideLargePrompt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,7 @@ impl DrawUi for IndexerSettingsUi {
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_edit_indexer_settings_prompt,
|
||||
Size::LargePrompt,
|
||||
);
|
||||
draw_popup(f, app, draw_edit_indexer_settings_prompt, Size::LargePrompt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,11 +57,16 @@ impl DrawUi for IndexersUi {
|
||||
app.is_loading || app.data.sonarr_data.indexer_test_errors.is_none(),
|
||||
title_block("Testing Indexer"),
|
||||
))
|
||||
.size(Size::LargeMessage);
|
||||
.size(Size::LargeMessage);
|
||||
f.render_widget(loading_popup, f.area());
|
||||
} else {
|
||||
let popup = {
|
||||
let result = app.data.sonarr_data.indexer_test_errors.as_ref().expect("Test result is unpopulated");
|
||||
let result = app
|
||||
.data
|
||||
.sonarr_data
|
||||
.indexer_test_errors
|
||||
.as_ref()
|
||||
.expect("Test result is unpopulated");
|
||||
|
||||
if !result.is_empty() {
|
||||
Popup::new(Message::new(result.clone())).size(Size::LargeMessage)
|
||||
@@ -99,7 +104,7 @@ impl DrawUi for IndexersUi {
|
||||
);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,12 +28,7 @@ impl DrawUi for TestAllIndexersUi {
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_test_all_indexers_test_results,
|
||||
Size::Large,
|
||||
);
|
||||
draw_popup(f, app, draw_test_all_indexers_test_results, Size::Large);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ impl DrawUi for AddSeriesUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
if let Route::Sonarr(active_sonarr_block, _) = app.get_current_route() {
|
||||
draw_popup(f, app, draw_add_series_search, Size::Large);
|
||||
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::AddSeriesPrompt
|
||||
| ActiveSonarrBlock::AddSeriesSelectMonitor
|
||||
|
||||
@@ -48,24 +48,23 @@ impl DrawUi for EditSeriesUi {
|
||||
draw_popup(f, app, SeriesDetailsUi::draw, Size::Large);
|
||||
}
|
||||
}
|
||||
|
||||
let draw_edit_series_prompt =
|
||||
|f: &mut Frame<'_>, app: &mut App<'_>, prompt_area: Rect| {
|
||||
draw_edit_series_confirmation_prompt(f, app, prompt_area);
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::EditSeriesSelectSeriesType => {
|
||||
draw_edit_series_select_series_type_popup(f, app);
|
||||
}
|
||||
ActiveSonarrBlock::EditSeriesSelectQualityProfile => {
|
||||
draw_edit_series_select_quality_profile_popup(f, app);
|
||||
}
|
||||
ActiveSonarrBlock::EditSeriesSelectLanguageProfile => {
|
||||
draw_edit_series_select_language_profile_popup(f, app);
|
||||
}
|
||||
_ => (),
|
||||
|
||||
let draw_edit_series_prompt = |f: &mut Frame<'_>, app: &mut App<'_>, prompt_area: Rect| {
|
||||
draw_edit_series_confirmation_prompt(f, app, prompt_area);
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::EditSeriesSelectSeriesType => {
|
||||
draw_edit_series_select_series_type_popup(f, app);
|
||||
}
|
||||
};
|
||||
ActiveSonarrBlock::EditSeriesSelectQualityProfile => {
|
||||
draw_edit_series_select_quality_profile_popup(f, app);
|
||||
}
|
||||
ActiveSonarrBlock::EditSeriesSelectLanguageProfile => {
|
||||
draw_edit_series_select_language_profile_popup(f, app);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
};
|
||||
|
||||
draw_popup(f, app, draw_edit_series_prompt, Size::Long);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, EPISODE_DETAILS_BLOCKS};
|
||||
use crate::ui::sonarr_ui::library::episode_details_ui::EpisodeDetailsUi;
|
||||
use crate::ui::DrawUi;
|
||||
use strum::IntoEnumIterator;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, EPISODE_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::ui::sonarr_ui::library::episode_details_ui::EpisodeDetailsUi;
|
||||
use crate::ui::DrawUi;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
#[test]
|
||||
fn test_episode_details_ui_accepts() {
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if EPISODE_DETAILS_BLOCKS.contains(&active_sonarr_block) {
|
||||
assert!(EpisodeDetailsUi::accepts(active_sonarr_block.into()));
|
||||
} else {
|
||||
assert!(!EpisodeDetailsUi::accepts(active_sonarr_block.into()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn test_episode_details_ui_accepts() {
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if EPISODE_DETAILS_BLOCKS.contains(&active_sonarr_block) {
|
||||
assert!(EpisodeDetailsUi::accepts(active_sonarr_block.into()));
|
||||
} else {
|
||||
assert!(!EpisodeDetailsUi::accepts(active_sonarr_block.into()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, EPISODE_DETAILS_BLOCKS, SEASON_DETAILS_BLOCKS};
|
||||
use crate::ui::sonarr_ui::library::season_details_ui::SeasonDetailsUi;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, EPISODE_DETAILS_BLOCKS, SEASON_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::ui::sonarr_ui::library::season_details_ui::SeasonDetailsUi;
|
||||
use crate::ui::DrawUi;
|
||||
|
||||
#[test]
|
||||
fn test_season_details_ui_accepts() {
|
||||
let mut blocks = SEASON_DETAILS_BLOCKS.clone().to_vec();
|
||||
blocks.extend(EPISODE_DETAILS_BLOCKS);
|
||||
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if blocks.contains(&active_sonarr_block) {
|
||||
assert!(SeasonDetailsUi::accepts(active_sonarr_block.into()));
|
||||
} else {
|
||||
assert!(!SeasonDetailsUi::accepts(active_sonarr_block.into()));
|
||||
}
|
||||
});
|
||||
}
|
||||
#[test]
|
||||
fn test_season_details_ui_accepts() {
|
||||
let mut blocks = SEASON_DETAILS_BLOCKS.clone().to_vec();
|
||||
blocks.extend(EPISODE_DETAILS_BLOCKS);
|
||||
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if blocks.contains(&active_sonarr_block) {
|
||||
assert!(SeasonDetailsUi::accepts(active_sonarr_block.into()));
|
||||
} else {
|
||||
assert!(!SeasonDetailsUi::accepts(active_sonarr_block.into()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, EPISODE_DETAILS_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS};
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, EPISODE_DETAILS_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::ui::sonarr_ui::library::series_details_ui::SeriesDetailsUi;
|
||||
use crate::ui::DrawUi;
|
||||
|
||||
@@ -11,7 +13,7 @@ mod tests {
|
||||
let mut blocks = SERIES_DETAILS_BLOCKS.clone().to_vec();
|
||||
blocks.extend(SEASON_DETAILS_BLOCKS);
|
||||
blocks.extend(EPISODE_DETAILS_BLOCKS);
|
||||
|
||||
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if blocks.contains(&active_sonarr_block) {
|
||||
assert!(SeriesDetailsUi::accepts(active_sonarr_block.into()));
|
||||
|
||||
@@ -32,14 +32,11 @@ impl DrawUi for RootFoldersUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Sonarr(active_sonarr_block, _) = app.get_current_route() {
|
||||
draw_root_folders(f, app, area);
|
||||
|
||||
|
||||
match active_sonarr_block {
|
||||
ActiveSonarrBlock::AddRootFolderPrompt => draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_add_root_folder_prompt_box,
|
||||
Size::InputBox,
|
||||
),
|
||||
ActiveSonarrBlock::AddRootFolderPrompt => {
|
||||
draw_popup(f, app, draw_add_root_folder_prompt_box, Size::InputBox)
|
||||
}
|
||||
ActiveSonarrBlock::DeleteRootFolderPrompt => {
|
||||
let prompt = format!(
|
||||
"Do you really want to delete this root folder: \n{}?",
|
||||
|
||||
@@ -58,7 +58,7 @@ impl DrawUi for SystemUi {
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let route = app.get_current_route();
|
||||
draw_system_ui_layout(f, app, area);
|
||||
|
||||
|
||||
if SystemDetailsUi::accepts(route) {
|
||||
SystemDetailsUi::draw(f, app, area);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,7 @@ use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, SYSTEM
|
||||
use crate::models::sonarr_models::SonarrTask;
|
||||
use crate::models::Route;
|
||||
use crate::ui::sonarr_ui::system::{
|
||||
draw_queued_events, extract_task_props, TASK_TABLE_CONSTRAINTS,
|
||||
TASK_TABLE_HEADERS,
|
||||
draw_queued_events, extract_task_props, TASK_TABLE_CONSTRAINTS, TASK_TABLE_HEADERS,
|
||||
};
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{borderless_block, style_log_list_item, title_block};
|
||||
@@ -44,19 +43,11 @@ impl DrawUi for SystemDetailsUi {
|
||||
draw_logs_popup(f, app);
|
||||
}
|
||||
ActiveSonarrBlock::SystemTasks | ActiveSonarrBlock::SystemTaskStartConfirmPrompt => {
|
||||
draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_tasks_popup,
|
||||
Size::Large,
|
||||
)
|
||||
draw_popup(f, app, draw_tasks_popup, Size::Large)
|
||||
}
|
||||
ActiveSonarrBlock::SystemQueuedEvents => {
|
||||
draw_popup(f, app, draw_queued_events, Size::Medium)
|
||||
}
|
||||
ActiveSonarrBlock::SystemQueuedEvents => draw_popup(
|
||||
f,
|
||||
app,
|
||||
draw_queued_events,
|
||||
Size::Medium,
|
||||
),
|
||||
ActiveSonarrBlock::SystemUpdates => {
|
||||
draw_updates_popup(f, app);
|
||||
}
|
||||
|
||||
@@ -20,10 +20,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_style_indeterminate() {
|
||||
assert_eq!(
|
||||
Style::new().indeterminate(),
|
||||
Style::new().fg(COLOR_ORANGE)
|
||||
);
|
||||
assert_eq!(Style::new().indeterminate(), Style::new().fg(COLOR_ORANGE));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::ui::utils::{
|
||||
borderless_block, centered_rect, convert_to_minutes_hours_days, decorate_peer_style,
|
||||
get_width_from_percentage, layout_block, layout_block_bottom_border, layout_block_top_border,
|
||||
layout_block_top_border_with_title, layout_block_with_title, logo_block, style_block_highlight,
|
||||
style_log_list_item, title_block, title_block_centered, title_style,
|
||||
};
|
||||
use pretty_assertions::{assert_eq, assert_str_eq};
|
||||
use ratatui::layout::{Alignment, Rect};
|
||||
use ratatui::style::{Color, Modifier, Style, Stylize};
|
||||
use ratatui::text::{Span, Text};
|
||||
use ratatui::widgets::{Block, BorderType, Borders, ListItem};
|
||||
use rstest::rstest;
|
||||
use crate::ui::utils::{borderless_block, centered_rect, convert_to_minutes_hours_days, decorate_peer_style, get_width_from_percentage, layout_block, layout_block_bottom_border, layout_block_top_border, layout_block_top_border_with_title, layout_block_with_title, logo_block, style_block_highlight, style_log_list_item, title_block, title_block_centered, title_style};
|
||||
|
||||
#[test]
|
||||
fn test_layout_block() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use derive_setters::Setters;
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{borderless_block, layout_block, style_block_highlight};
|
||||
use derive_setters::Setters;
|
||||
use ratatui::buffer::Buffer;
|
||||
use ratatui::layout::{Constraint, Layout, Rect};
|
||||
use ratatui::prelude::Text;
|
||||
|
||||
@@ -3,12 +3,12 @@ use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{layout_paragraph_borderless, title_block_centered};
|
||||
use crate::ui::widgets::button::Button;
|
||||
use crate::ui::widgets::checkbox::Checkbox;
|
||||
use derive_setters::Setters;
|
||||
use ratatui::buffer::Buffer;
|
||||
use ratatui::layout::{Constraint, Flex, Layout, Rect};
|
||||
use ratatui::text::Text;
|
||||
use ratatui::widgets::{Paragraph, Widget};
|
||||
use std::iter;
|
||||
use derive_setters::Setters;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "confirmation_prompt_tests.rs"]
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
use super::input_box_popup::InputBoxPopup;
|
||||
use super::message::Message;
|
||||
use super::popup::Size;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{centered_rect, layout_block_top_border, title_block_centered};
|
||||
@@ -5,6 +8,7 @@ use crate::ui::widgets::loading_block::LoadingBlock;
|
||||
use crate::ui::widgets::popup::Popup;
|
||||
use crate::ui::widgets::selectable_list::SelectableList;
|
||||
use crate::ui::HIGHLIGHT_SYMBOL;
|
||||
use derive_setters::Setters;
|
||||
use ratatui::buffer::Buffer;
|
||||
use ratatui::layout::{Alignment, Constraint, Layout, Position, Rect};
|
||||
use ratatui::prelude::{Style, Stylize, Text};
|
||||
@@ -12,10 +16,6 @@ use ratatui::widgets::{Block, ListItem, Paragraph, Row, StatefulWidget, Table, W
|
||||
use ratatui::Frame;
|
||||
use std::fmt::Debug;
|
||||
use std::sync::atomic::Ordering;
|
||||
use derive_setters::Setters;
|
||||
use super::input_box_popup::InputBoxPopup;
|
||||
use super::message::Message;
|
||||
use super::popup::Size;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "managarr_table_tests.rs"]
|
||||
|
||||
@@ -2,9 +2,9 @@ pub(super) mod button;
|
||||
pub(super) mod checkbox;
|
||||
pub(super) mod confirmation_prompt;
|
||||
pub(super) mod input_box;
|
||||
mod input_box_popup;
|
||||
pub(super) mod loading_block;
|
||||
pub(super) mod managarr_table;
|
||||
pub(super) mod message;
|
||||
pub(super) mod popup;
|
||||
pub(super) mod selectable_list;
|
||||
mod input_box_popup;
|
||||
|
||||
Reference in New Issue
Block a user