all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload
Date: Tue, 28 Apr 2026 13:05:15 +0200	[thread overview]
Message-ID: <20260428110520.2343917-1-d.csapak@proxmox.com> (raw)

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





             reply	other threads:[~2026-04-28 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 11:05 Dominik Csapak [this message]
2026-04-28 11:30 ` [PATCH proxmox-backup] ui: datastore content: fix namespace change after reload Filip Schauer
2026-04-28 13:14 ` applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260428110520.2343917-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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