ui: UserView: render name as 'Firstname Lastname'

instead of only the firstname

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-11-11 13:34:14 +01:00 committed by Thomas Lamprecht
parent c0026563b0
commit 0a274ab0a0
1 changed files with 12 additions and 0 deletions

View File

@ -76,6 +76,17 @@ Ext.define('PBS.config.UserView', {
}).show(); }).show();
}, },
renderName: function(val, cell, rec) {
let name = [];
if (rec.data.firstname) {
name.push(rec.data.firstname);
}
if (rec.data.lastname) {
name.push(rec.data.lastname);
}
return name.join(' ');
},
renderUsername: function(userid) { renderUsername: function(userid) {
return Ext.String.htmlEncode(userid.match(/^(.+)@([^@]+)$/)[1]); return Ext.String.htmlEncode(userid.match(/^(.+)@([^@]+)$/)[1]);
}, },
@ -181,6 +192,7 @@ Ext.define('PBS.config.UserView', {
width: 150, width: 150,
sortable: true, sortable: true,
dataIndex: 'firstname', dataIndex: 'firstname',
renderer: 'renderName',
}, },
{ {
header: gettext('Comment'), header: gettext('Comment'),