From 813df68b086113cb093108ebfec3bdad86703841 Mon Sep 17 00:00:00 2001 From: Carla Martinez Date: Tue, 18 Oct 2022 13:18:09 +0200 Subject: [PATCH] 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 Reviewed-By: Florence Blanc-Renaud Reviewed-By: Alexander Bokovoy Reviewed-By: Mohammad Rizwan Yusuf --- install/ui/src/freeipa/certificate.js | 10 +++++----- install/ui/src/freeipa/dialog.js | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/install/ui/src/freeipa/certificate.js b/install/ui/src/freeipa/certificate.js index dc8f06f6a..ea36aa8f0 100644 --- a/install/ui/src/freeipa/certificate.js +++ b/install/ui/src/freeipa/certificate.js @@ -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, { diff --git a/install/ui/src/freeipa/dialog.js b/install/ui/src/freeipa/dialog.js index 96277b0a5..d8e26339b 100644 --- a/install/ui/src/freeipa/dialog.js +++ b/install/ui/src/freeipa/dialog.js @@ -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 $('
', { 'class': 'table-cell ' + cls, + name: nm, text: text.get(str) + suffix }); },