ui: improve render_optional_namespace slighly

it maybe should still simple get dropped and replaced with
(empty)Text 'Root' or 'Root Namespace'

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-05-14 18:39:52 +02:00
parent dc193e8197
commit ed289736cf
2 changed files with 3 additions and 3 deletions

View File

@ -686,7 +686,7 @@ Ext.define('PBS.Utils', {
},
render_optional_namespace: function(value, metadata, record) {
if (!value) return '-'; // FIXME ??
if (!value) return `- (${gettext('Root')})`;
return Ext.String.htmlEncode(value);
},

View File

@ -91,7 +91,7 @@ Ext.define('PBS.form.RemoteNamespaceSelector', {
valueField: 'ns',
displayField: 'ns',
emptyText: PBS.Utils.render_optional_namespace(''),
emptyText: gettext('Root'),
notFoundIsValid: true,
matchFieldWidth: false,
@ -103,7 +103,7 @@ Ext.define('PBS.form.RemoteNamespaceSelector', {
header: gettext('Namespace'),
sortable: true,
dataIndex: 'ns',
renderer: PBS.Utils.render_optional_namespace, // FIXME proper root-aware renderer
renderer: PBS.Utils.render_optional_namespace,
flex: 1,
},
{