From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D52441FF146 for ; Tue, 28 Apr 2026 13:18:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 59F04F35F; Tue, 28 Apr 2026 13:18:27 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Subject: [RFC PATCH proxmox-backup] ui: datastore content: allow moving namespace from parent Date: Tue, 28 Apr 2026 13:16:30 +0200 Message-ID: <20260428111822.2471005-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.051 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: OFIOYMFUYIUS5HCGUXTFSNEKYJCNHTE4 X-Message-ID-Hash: OFIOYMFUYIUS5HCGUXTFSNEKYJCNHTE4 X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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