From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] form/RoleSelector: fix for pve
Date: Fri, 22 Jul 2022 09:35:24 +0200 [thread overview]
Message-ID: <20220722073524.645810-1-d.csapak@proxmox.com> (raw)
in pbs we get an array here, so the renderer is fine, but in pve it's
just a long string, so add a space after commas to achieve the same
effect.
without this, the second column is not visible in pve because of an error
in the renderer (no 'join' function on a string)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/form/RoleSelector.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/form/RoleSelector.js b/src/form/RoleSelector.js
index d82c980..7d897f9 100644
--- a/src/form/RoleSelector.js
+++ b/src/form/RoleSelector.js
@@ -30,8 +30,15 @@ Ext.define('Proxmox.form.RoleSelector', {
header: gettext('Privileges'),
dataIndex: 'privs',
cellWrap: true,
- // join manually here, as ExtJS joins without whitespace which breaks cellWrap
- renderer: v => v.join(', '),
+ renderer: (v) => {
+ if (Ext.isArray(v)) {
+ // join manually here, as ExtJS joins without whitespace which breaks cellWrap
+ return v.join(', ');
+ }
+
+ // add space after comma for cellWrap
+ return v.replaceAll(',', ', ');
+ },
flex: 5,
},
],
--
2.30.2
next reply other threads:[~2022-07-22 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-22 7:35 Dominik Csapak [this message]
2023-01-10 10:55 ` [pve-devel] applied: " Thomas Lamprecht
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=20220722073524.645810-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-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