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: allow moving namespace from parent
Date: Mon, 31 Aug 2026 13:35:32 +0200	[thread overview]
Message-ID: <20260831113539.2622191-1-d.csapak@proxmox.com> (raw)

having to go into the namespace to move it seems unintuitive, so allow
it from it's parent too.

Only navigate to the new place when we were inside the namespace,
otherwise we stay at the one we were.

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

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index bd989e660..2b93d19a4 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -670,17 +670,20 @@ Ext.define('PBS.DataStoreContent', {
             });
         },
 
-        moveNS: function () {
+        moveNS: function (data) {
             let me = this;
             let view = me.getView();
-            if (!view.namespace || view.namespace === '') {
+
+            let namespace = data.ns || view.namespace;
+            if (!namespace) {
                 return;
             }
+            let insideNs = !!view.namespace;
             let win = Ext.create('PBS.window.NamespaceMove', {
                 datastore: view.datastore,
-                namespace: view.namespace,
+                namespace,
                 taskDone: (success) => {
-                    if (success) {
+                    if (success && insideNs) {
                         let newNs = win.getNewNamespace();
                         // update view.namespace and reload the content grid directly rather than
                         // going through the NS selector's change event, which may not fire if the
@@ -718,7 +721,7 @@ Ext.define('PBS.DataStoreContent', {
             if (data.ty === 'group') {
                 me.moveGroup(data);
             } else if (data.ty === 'ns') {
-                me.moveNS();
+                me.moveNS(data);
             }
         },
 
@@ -1154,7 +1157,7 @@ Ext.define('PBS.DataStoreContent', {
                         if (data.ty === 'group') {
                             return 'fa fa-arrows';
                         }
-                        if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
+                        if (data.ty === 'ns' && !data.isRootNS) {
                             return 'fa fa-arrows';
                         }
                         return 'pmx-hidden';
@@ -1163,7 +1166,7 @@ Ext.define('PBS.DataStoreContent', {
                         if (data.ty === 'group') {
                             return false;
                         }
-                        if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
+                        if (data.ty === 'ns' && !data.isRootNS) {
                             return false;
                         }
                         return true;
-- 
2.47.3





             reply	other threads:[~2026-08-31 11:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 11:35 Dominik Csapak [this message]
2026-08-31 12:05 ` [PATCH proxmox-backup] ui: datastore content: allow moving namespace from parent Jonas Theisen
2026-08-31 12:25 ` superseded: " Dominik Csapak

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=20260831113539.2622191-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