[pdm-devel] [PATCH datacenter-manager] ui: views: also show empty view warning with empty rows
Michael Köppl
m.koeppl at proxmox.com
Thu Dec 11 14:40:46 CET 2025
Encountered this in my testing as well, so quickly checked and it works
as advertised!
Tested-by: Michael Köppl <m.koeppl at proxmox.com>
On Thu Dec 11, 2025 at 2:06 PM CET, Dominik Csapak wrote:
> by simply using `.flatten()` to count the actual number of widgets
>
> Suggested-by: Lukas Wagner <l.wagner at proxmox.com>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> ui/src/dashboard/view/row_view.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ui/src/dashboard/view/row_view.rs b/ui/src/dashboard/view/row_view.rs
> index 6276d555..673b4627 100644
> --- a/ui/src/dashboard/view/row_view.rs
> +++ b/ui/src/dashboard/view/row_view.rs
> @@ -337,7 +337,7 @@ impl Component for RowViewComp {
> .class(css::FlexDirection::Row)
> .class(css::FlexWrap::Wrap);
>
> - if layout.is_empty() && !self.edit_mode {
> + if layout.iter().flatten().count() == 0 && !self.edit_mode {
> let icon = "<i class=\"fa fa-pencil\"></i>";
> let message = tr!("The layout is empty. To add widgets, enable editing by clicking the {0} icon above.", icon);
> let message = Html::from_html_unchecked(message.into());
More information about the pdm-devel
mailing list