public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-backup v2] ui: datastore content: allow moving namespace from parent
@ 2026-08-31 12:23 Dominik Csapak
  2026-08-31 12:46 ` Jonas Theisen
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2026-08-31 12:23 UTC (permalink / raw)
  To: pbs-devel

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>
---
changes from v1:
* prevent the 'up' entry from getting a move action, by limiting to
  either ns === undefined (the main namespace entry) or to depth > 1
  (namespaces listed under the current one)

 www/datastore/Content.js | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index bd989e660..117c9ee87 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,11 @@ 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 &&
+                            (data.ns === undefined || data.depth > 1)
+                        ) {
                             return 'fa fa-arrows';
                         }
                         return 'pmx-hidden';
@@ -1163,7 +1170,11 @@ 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 &&
+                            (data.ns === undefined || data.depth > 1)
+                        ) {
                             return false;
                         }
                         return true;
-- 
2.47.3





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

end of thread, other threads:[~2026-08-31 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 12:23 [PATCH proxmox-backup v2] ui: datastore content: allow moving namespace from parent Dominik Csapak
2026-08-31 12:46 ` Jonas Theisen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal