public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [RFC PATCH proxmox-backup] ui: datastore content: allow moving namespace from parent
@ 2026-04-28 11:16 Dominik Csapak
  0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2026-04-28 11:16 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.

Since it touches the same lines, fix the formatting issue detected with
proxmox-biome.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
sending as RFC because it's not urgent and IMHO it's not clear how we
should behave after moving: when inside the namespace it's clear,
we change the current view to the new place.

But how should we handle it when we move it from the parent?
Should we navigate to the new parent? Or should we move inside the
new path (as it's currently handled) or should we stay on the same
namespace and not navigate away?

Would appreciate input on what users might expect here...

 www/datastore/Content.js | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index 293f9ca26..dcaca4449 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -670,15 +670,17 @@ 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 win = Ext.create('PBS.window.NamespaceMove', {
                 datastore: view.datastore,
-                namespace: view.namespace,
+                namespace,
                 taskDone: (success) => {
                     if (success) {
                         let newNs = win.getNewNamespace();
@@ -714,7 +716,7 @@ Ext.define('PBS.DataStoreContent', {
             if (data.ty === 'group') {
                 me.moveGroup(data);
             } else if (data.ty === 'ns') {
-                me.moveNS();
+                me.moveNS(data);
             }
         },
 
@@ -1146,15 +1148,19 @@ Ext.define('PBS.DataStoreContent', {
                         return Ext.String.format(gettext("Move namespace '{0}'"), v);
                     },
                     getClass: (v, m, { data }) => {
-                        if (data.ty === 'group') { return 'fa fa-arrows'; }
-                        if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
+                        if (data.ty === 'group') {
+                            return 'fa fa-arrows';
+                        }
+                        if (data.ty === 'ns' && !data.isRootNS) {
                             return 'fa fa-arrows';
                         }
                         return 'pmx-hidden';
                     },
                     isActionDisabled: (v, r, c, i, { data }) => {
-                        if (data.ty === 'group') { return false; }
-                        if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
+                        if (data.ty === 'group') {
+                            return false;
+                        }
+                        if (data.ty === 'ns' && !data.isRootNS) {
                             return false;
                         }
                         return true;
-- 
2.47.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-28 11:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28 11:16 [RFC PATCH proxmox-backup] ui: datastore content: allow moving namespace from parent Dominik Csapak

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