public inbox for pbs-devel@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 v2] ui: datastore content: allow moving namespace from parent
Date: Mon, 31 Aug 2026 14:23:44 +0200	[thread overview]
Message-ID: <20260831122443.2952899-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>
---
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





             reply	other threads:[~2026-08-31 12:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 12:23 Dominik Csapak [this message]
2026-08-31 12:46 ` [PATCH proxmox-backup v2] ui: datastore content: allow moving namespace from parent Jonas Theisen

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