public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] certificates: don't display name if there is no name
Date: Thu, 18 Jan 2024 15:14:10 +0100	[thread overview]
Message-ID: <20240118141410.538521-1-m.sandoval@proxmox.com> (raw)

The default certificate does not have a name.

Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 src/panel/Certificates.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/panel/Certificates.js b/src/panel/Certificates.js
index a522ab6..f924512 100644
--- a/src/panel/Certificates.js
+++ b/src/panel/Certificates.js
@@ -237,10 +237,16 @@ Ext.define('Proxmox.panel.Certificates', {
 	    {
 		xtype: 'proxmoxButton',
 		text: gettext('Delete Custom Certificate'),
-		confirmMsg: rec => Ext.String.format(
-		    gettext('Are you sure you want to remove the certificate used for {0}'),
-		    me.certById[rec.id].name,
-		),
+		confirmMsg: function(rec) {
+		    let cert = me.certById[rec.id];
+		    if (cert.name) {
+			return Ext.String.format(
+			    gettext('Are you sure you want to remove the certificate used for {0}'),
+			    cert.name,
+			);
+		    }
+		    return Ext.String.format(gettext('Are you sure you want to remove the certificate'));
+		},
 		callback: () => me.reload(),
 		selModel: me.selModel,
 		disabled: true,
-- 
2.39.2





             reply	other threads:[~2024-01-18 14:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 14:14 Maximiliano Sandoval [this message]
2024-03-07 14:40 ` [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=20240118141410.538521-1-m.sandoval@proxmox.com \
    --to=m.sandoval@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal