webui: Add name to 'Certificates' table

For testing purposes and uniformity, the 'Certificates'
table generated after a new certificate is added should
also have the 'name' attribute to be able to access its
value.

Fixes: https://pagure.io/freeipa/issue/8946
Signed-off-by: Carla Martinez <carlmart@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Mohammad Rizwan Yusuf <myusuf@redhat.com>
This commit is contained in:
Carla Martinez 2022-10-18 13:18:09 +02:00
parent 580e62a161
commit 813df68b08
2 changed files with 9 additions and 6 deletions

View File

@ -380,7 +380,7 @@ IPA.cert.view_dialog = function(spec) {
var row = that.create_row();
row.append(that
.create_header_cell(title, ':'));
row.append(that.create_cell(value, '', 'break-words'));
row.append(that.create_cell(value, '', 'break-words', 'break-words'));
return row;
};
@ -1240,23 +1240,23 @@ IPA.cert.cert_widget = function(spec) {
var tr = that.create_row().appendTo(that.table_layout);
that.create_header_cell('@i18n:objects.cert.serial_number', ':')
.appendTo(tr);
that.cert_sn = that.create_cell('', '', 'cert-value').appendTo(tr);
that.cert_sn = that.create_cell('', '', 'cert-value', 'cert-serial-num').appendTo(tr);
tr = that.create_row().appendTo(that.table_layout);
that.create_header_cell('@i18n:objects.cert.issued_by', ':')
.appendTo(tr);
that.cert_issuer = that.create_cell('', '', 'cert-value').appendTo(tr);
that.cert_issuer = that.create_cell('', '', 'cert-value', 'cert-issued-by').appendTo(tr);
tr = that.create_row().appendTo(that.table_layout);
that.create_header_cell('@i18n:objects.cert.valid_from', ':')
.appendTo(tr);
that.cert_valid_from = that.create_cell('', '', 'cert-value')
that.cert_valid_from = that.create_cell('', '', 'cert-value', 'cert-valid-from')
.appendTo(tr);
tr = that.create_row().appendTo(that.table_layout);
that.create_header_cell('@i18n:objects.cert.valid_to', ':')
.appendTo(tr);
that.cert_valid_to = that.create_cell('', '', 'cert-value')
that.cert_valid_to = that.create_cell('', '', 'cert-value', 'cert-valid-to')
.appendTo(tr);
that.dropdown = builder.build(null, {

View File

@ -1561,14 +1561,17 @@ IPA.table_mixin = function() {
* @param {string} suffix, string which will be concatenated to the end of
* 'str' string. Not parsed using text.get()
* @param {string} cls css class which will be added to current cell
* @param {string} nm css name which will be added to current cell
*/
create_cell: function(str, suffix, cls) {
create_cell: function(str, suffix, cls, nm) {
str = str || '';
suffix = suffix || '';
cls = cls || '';
nm = nm || '';
return $('<div />', {
'class': 'table-cell ' + cls,
name: nm,
text: text.get(str) + suffix
});
},