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

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