public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Maximiliano Sandoval <m.sandoval@proxmox.com>
Subject: [pve-devel] applied: [PATCH widget-toolkit] certificates: don't display name if there is no name
Date: Thu, 7 Mar 2024 15:40:49 +0100	[thread overview]
Message-ID: <2ef2d275-de92-4994-aed1-1875b4fc2219@proxmox.com> (raw)
In-Reply-To: <20240118141410.538521-1-m.sandoval@proxmox.com>

Am 18/01/2024 um 15:14 schrieb Maximiliano Sandoval:
> 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) {

could have kept the arrow fn style

> +		    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'));

wrapping a string without format variable in Ext.String.format is rather
useless, I amended the commit and dropped that.

applied, thanks!




      reply	other threads:[~2024-03-07 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 14:14 [pve-devel] " Maximiliano Sandoval
2024-03-07 14:40 ` Thomas Lamprecht [this message]

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=2ef2d275-de92-4994-aed1-1875b4fc2219@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=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