* [pdm-devel] [PATCH datacenter-manager] ui: views: also show empty view warning with empty rows
@ 2025-12-11 13:06 Dominik Csapak
2025-12-11 13:40 ` Michael Köppl
2025-12-12 8:50 ` [pdm-devel] applied: " Lukas Wagner
0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2025-12-11 13:06 UTC (permalink / raw)
To: pdm-devel
by simply using `.flatten()` to count the actual number of widgets
Suggested-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@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());
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pdm-devel] [PATCH datacenter-manager] ui: views: also show empty view warning with empty rows
2025-12-11 13:06 [pdm-devel] [PATCH datacenter-manager] ui: views: also show empty view warning with empty rows Dominik Csapak
@ 2025-12-11 13:40 ` Michael Köppl
2025-12-12 8:50 ` [pdm-devel] applied: " Lukas Wagner
1 sibling, 0 replies; 3+ messages in thread
From: Michael Köppl @ 2025-12-11 13:40 UTC (permalink / raw)
To: Proxmox Datacenter Manager development discussion; +Cc: pdm-devel
Encountered this in my testing as well, so quickly checked and it works
as advertised!
Tested-by: Michael Köppl <m.koeppl@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@proxmox.com>
> Signed-off-by: Dominik Csapak <d.csapak@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());
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pdm-devel] applied: [PATCH datacenter-manager] ui: views: also show empty view warning with empty rows
2025-12-11 13:06 [pdm-devel] [PATCH datacenter-manager] ui: views: also show empty view warning with empty rows Dominik Csapak
2025-12-11 13:40 ` Michael Köppl
@ 2025-12-12 8:50 ` Lukas Wagner
1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2025-12-12 8:50 UTC (permalink / raw)
To: Proxmox Datacenter Manager development discussion, Dominik Csapak
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@proxmox.com>
> Signed-off-by: Dominik Csapak <d.csapak@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());
Applied, with Michael's T-b's!
Thanks!
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-12 8:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-11 13:06 [pdm-devel] [PATCH datacenter-manager] ui: views: also show empty view warning with empty rows Dominik Csapak
2025-12-11 13:40 ` Michael Köppl
2025-12-12 8:50 ` [pdm-devel] applied: " Lukas Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox