Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions packages/oneclient_app/src/components/cluster_update_popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,23 @@ enum UpdateTab {
Updates,
Additions,
Removals,
Optional,
}

impl UpdateTab {
const ALL: [UpdateTab; 3] = [UpdateTab::Updates, UpdateTab::Additions, UpdateTab::Removals];
const ALL: [UpdateTab; 4] = [
UpdateTab::Updates,
UpdateTab::Additions,
UpdateTab::Removals,
UpdateTab::Optional,
];

fn label(self) -> &'static str {
match self {
UpdateTab::Updates => "Updated",
UpdateTab::Additions => "Added",
UpdateTab::Removals => "Removed",
UpdateTab::Optional => "Optional",
}
}

Expand All @@ -39,6 +46,7 @@ impl UpdateTab {
UpdateTab::Updates => "Nothing was updated.",
UpdateTab::Additions => "Nothing was added.",
UpdateTab::Removals => "Nothing was removed.",
UpdateTab::Optional => "Nothing optional was offered.",
}
}

Expand All @@ -47,6 +55,7 @@ impl UpdateTab {
UpdateTab::Updates => IconType::RefreshCw01,
UpdateTab::Additions => IconType::Plus,
UpdateTab::Removals => IconType::Trash01,
UpdateTab::Optional => IconType::Plus,
}
}

Expand All @@ -55,6 +64,7 @@ impl UpdateTab {
UpdateTab::Updates => colors::brand(),
UpdateTab::Additions => colors::success(),
UpdateTab::Removals => colors::danger(),
UpdateTab::Optional => colors::brand(),
}
}

Expand All @@ -63,6 +73,7 @@ impl UpdateTab {
UpdateTab::Updates => &summary.updated,
UpdateTab::Additions => &summary.added,
UpdateTab::Removals => &summary.removed,
UpdateTab::Optional => &summary.optional,
}
}
}
Expand All @@ -88,7 +99,13 @@ impl Component for ClusterUpdatePopup {
let all_items: Vec<&ClusterUpdateItem> = summaries
.iter()
.flatten()
.flat_map(|s| s.updated.iter().chain(&s.added).chain(&s.removed))
.flat_map(|s| {
s.updated
.iter()
.chain(&s.added)
.chain(&s.removed)
.chain(&s.optional)
})
.collect();
let mut meta = MetaMap::new();
for provider in ProviderId::REMOTE_PROVIDERS.iter().copied() {
Expand Down
3 changes: 3 additions & 0 deletions packages/oneclient_app/src/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod charts;
mod cluster_landscape_art;
mod cluster_update_popup;
mod context_menu;
mod optional_mods_popup;
mod dropdown;
mod dynamic_art;
mod file_drop;
Expand Down Expand Up @@ -45,6 +46,7 @@ pub use charts::{BarChart, PieChart, ValueUnit, slice_color};
pub use cluster_landscape_art::ClusterLandscapeArt;
pub use cluster_update_popup::ClusterUpdatePopup;
pub use context_menu::ContextMenu;
pub use optional_mods_popup::OptionalModsPopup;
pub use dropdown::Dropdown;
pub use dynamic_art::{ART_PREVIEW_EDGE, DynamicArt};
pub use file_drop::FileDropOverlay;
Expand All @@ -62,6 +64,7 @@ pub use navbar::{AppNavbar, OnboardingNavbar};
pub use notifications::NotificationCenter;
pub use overlay_popup::OverlayPopup;
pub use package_row::{CardLayout, PackageEntry, PackageRow, provider_badge};
pub(crate) use package_row::{CARD_GRID_H, GRID_GAP, GRID_MIN_W, grid_card, package_icon};
pub use package_update_popup::PackageUpdatePopup;
pub use pagination::Pagination;
pub use player_model::PlayerModel;
Expand Down
Loading