all lists on 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

* Re: [PATCH proxmox-backup v2] ui: datastore content: allow moving namespace from parent
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Jonas Theisen @ 2026-08-31 12:46 UTC (permalink / raw)
  To: pbs-devel

On 8/31/26 14:24, Dominik Csapak wrote:
> 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>
> -snip-

Tested the patch and works as expected.
Behavior of v1 is fixed.
--
Tested-by: Jonas Theisen <j.theisen@proxmox.com>




^ permalink raw reply	[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 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