all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit] certificates: don't display name if there is no name
@ 2024-01-18 14:14 Maximiliano Sandoval
  2024-03-07 14:40 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Maximiliano Sandoval @ 2024-01-18 14:14 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH widget-toolkit] certificates: don't display name if there is no name
  2024-01-18 14:14 [pve-devel] [PATCH widget-toolkit] certificates: don't display name if there is no name Maximiliano Sandoval
@ 2024-03-07 14:40 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-03-07 14:40 UTC (permalink / raw)
  To: Proxmox VE development discussion, Maximiliano Sandoval

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!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-07 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 14:14 [pve-devel] [PATCH widget-toolkit] certificates: don't display name if there is no name Maximiliano Sandoval
2024-03-07 14:40 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal