all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload
@ 2026-04-28 11:05 Dominik Csapak
  2026-04-28 11:30 ` Filip Schauer
  2026-04-28 13:14 ` applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-04-28 11:05 UTC (permalink / raw)
  To: pbs-devel

A double click on a namespace change it by first setting the namespace
value to the namespace selector and then triggering a reload.

When a new namespace is added to the view with a manual click on
'reload', this new namespace does not yet exist in the namespace
selectors store. So a double click can't properly set this as a value,
and thus does not change the namespace.

To fix this, always reload the namespace selector at the beginning of a
reload, so they should be in sync.

To keep the callback we use for the namespace selector, move it to the
reload function and pass it through to the load there.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/datastore/Content.js | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index b1e1f66cb..293f9ca26 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -102,8 +102,11 @@ Ext.define('PBS.DataStoreContent', {
             this.reload();
         },
 
-        reload: function () {
+        reload: function (nsLoadCallback) {
             let view = this.getView();
+            view.down('pbsNamespaceSelector').store?.load({
+                callback: Ext.isFunction(nsLoadCallback) ? nsLoadCallback : undefined,
+            });
 
             if (!view.store || !this.store) {
                 console.warn('cannot reload, no store(s)');
@@ -560,7 +563,6 @@ Ext.define('PBS.DataStoreContent', {
                 namespace: view.namespace ?? '',
                 apiCallDone: (success) => {
                     if (success) {
-                        view.down('pbsNamespaceSelector').store?.load();
                         me.reload();
                     }
                 },
@@ -685,11 +687,8 @@ Ext.define('PBS.DataStoreContent', {
                         // selector's tree store does not know about the just-created target
                         // namespace yet.
                         view.namespace = newNs;
-                        me.reload();
                         let selector = view.down('pbsNamespaceSelector');
-                        selector?.store?.load({
-                            callback: () => selector.setValue(newNs),
-                        });
+                        me.reload(() => selector.setValue(newNs));
                     }
                 },
             });
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload
  2026-04-28 11:05 [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload Dominik Csapak
@ 2026-04-28 11:30 ` Filip Schauer
  2026-04-28 13:14 ` applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Filip Schauer @ 2026-04-28 11:30 UTC (permalink / raw)
  To: Dominik Csapak, pbs-devel

On 28/04/2026 13:03, Dominik Csapak wrote:
> A double click on a namespace change it by first setting the namespace
> value to the namespace selector and then triggering a reload.
>
> When a new namespace is added to the view with a manual click on
> 'reload', this new namespace does not yet exist in the namespace
> selectors store. So a double click can't properly set this as a value,
> and thus does not change the namespace.
>
> To fix this, always reload the namespace selector at the beginning of a
> reload, so they should be in sync.
>
> To keep the callback we use for the namespace selector, move it to the
> reload function and pass it through to the load there.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>   www/datastore/Content.js | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/www/datastore/Content.js b/www/datastore/Content.js
> index b1e1f66cb..293f9ca26 100644
> --- a/www/datastore/Content.js
> +++ b/www/datastore/Content.js
> @@ -102,8 +102,11 @@ Ext.define('PBS.DataStoreContent', {
>               this.reload();
>           },
>   
> -        reload: function () {
> +        reload: function (nsLoadCallback) {
>               let view = this.getView();
> +            view.down('pbsNamespaceSelector').store?.load({
> +                callback: Ext.isFunction(nsLoadCallback) ? nsLoadCallback : undefined,
> +            });
>   
>               if (!view.store || !this.store) {
>                   console.warn('cannot reload, no store(s)');
> @@ -560,7 +563,6 @@ Ext.define('PBS.DataStoreContent', {
>                   namespace: view.namespace ?? '',
>                   apiCallDone: (success) => {
>                       if (success) {
> -                        view.down('pbsNamespaceSelector').store?.load();
>                           me.reload();
>                       }
>                   },
> @@ -685,11 +687,8 @@ Ext.define('PBS.DataStoreContent', {
>                           // selector's tree store does not know about the just-created target
>                           // namespace yet.
>                           view.namespace = newNs;
> -                        me.reload();
>                           let selector = view.down('pbsNamespaceSelector');
> -                        selector?.store?.load({
> -                            callback: () => selector.setValue(newNs),
> -                        });
> +                        me.reload(() => selector.setValue(newNs));
>                       }
>                   },
>               });

I can confirm that this fixes the bug where, after a new namespace was
pushed to a datastore, it would appear in the content view when clicking
"Reload", but double-clicking it did nothing until the entire page was
refreshed. Now, this no longer happens, and I can immediately navigate
into the namespace.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* applied: [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload
  2026-04-28 11:05 [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload Dominik Csapak
  2026-04-28 11:30 ` Filip Schauer
@ 2026-04-28 13:14 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2026-04-28 13:14 UTC (permalink / raw)
  To: pbs-devel, Dominik Csapak

On Tue, 28 Apr 2026 13:05:15 +0200, Dominik Csapak wrote:
> A double click on a namespace change it by first setting the namespace
> value to the namespace selector and then triggering a reload.
> 
> When a new namespace is added to the view with a manual click on
> 'reload', this new namespace does not yet exist in the namespace
> selectors store. So a double click can't properly set this as a value,
> and thus does not change the namespace.
> 
> [...]

Applied, thanks!

@Filip, would be nice to include a T-b and/or R-b next time to record your
testing work up into git.

[1/1] ui: datastore content: fix namespace change after reload
      commit: 30e44fb1ff1148883967cc9fbd5a34df48f3cd06




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-28 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28 11:05 [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload Dominik Csapak
2026-04-28 11:30 ` Filip Schauer
2026-04-28 13:14 ` applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal