public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Lukas Wagner <l.wagner@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager 2/2] ui: one-shot backup: remove 'auto' notification mode for clarity
Date: Fri, 13 Jun 2025 15:51:55 +0200	[thread overview]
Message-ID: <a3815adc-d186-4ba1-b2cb-5a1344aebd93@proxmox.com> (raw)
In-Reply-To: <20250611125927.272238-2-l.wagner@proxmox.com>

On 6/11/25 14:59, Lukas Wagner wrote:
> The 'auto' mode does not really add any functionality but only adds
> confusion about what it actually does, so we completely remove it from
> the UI. It is still supported by the backend, but in the UI we map it to
> a concrete mode (either notification-system or legacy-sendmail,
> depending on whether mailto is set).
> 
> We also stop using the term 'notification system' in the UI, instead it
> is called "Global Notification Settings".
> 
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
>  www/manager6/window/Backup.js | 32 +++++++++++++++++++++-----------
>  1 file changed, 21 insertions(+), 11 deletions(-)
> 
> diff --git a/www/manager6/window/Backup.js b/www/manager6/window/Backup.js
> index 70b51409..d80a6e85 100644
> --- a/www/manager6/window/Backup.js
> +++ b/www/manager6/window/Backup.js
> @@ -33,22 +33,22 @@ Ext.define('PVE.window.Backup', {
>  	let mailtoField = Ext.create('Ext.form.field.Text', {
>  	    fieldLabel: gettext('Send email to'),
>  	    name: 'mailto',
> +	    hidden: true,
>  	    emptyText: Proxmox.Utils.noneText,
>  	});
>  
>  	let notificationModeSelector = Ext.create({
>  	    xtype: 'proxmoxKVComboBox',
>  	    comboItems: [
> -		['auto', gettext('Auto')],
> -		['legacy-sendmail', gettext('Email (legacy)')],
> -		['notification-system', gettext('Notification system')],
> +		['notification-system', gettext('Use global settings')],
> +		['legacy-sendmail', gettext('Use sendmail')],
>  	    ],
> -	    fieldLabel: gettext('Notification mode'),
> +	    fieldLabel: gettext('Notification'),
>  	    name: 'notification-mode',
> -	    value: 'auto',
> +	    value: 'notification-system',
>  	    listeners: {
>  		change: function(field, value) {
> -		    mailtoField.setDisabled(value === 'notification-system');
> +		    mailtoField.setHidden(value === 'notification-system');

While this does work, I think I'd prefer it if the field is always
visible and is enabled or disabled depending on the selection of the
notification system. With the hidden field, UI shifts a tiny bit once it
becomes visible (Firefox 139.0.1). Since the Backup window is not super
cluttered, I think this additional field could always be visible, but
that's just my two cents.

>  		},
>  	    },
>  	});
> @@ -170,11 +170,21 @@ Ext.define('PVE.window.Backup', {
>  			success: function(response, opts) {
>  			    const data = response.result.data;
>  
> -			    if (!initialDefaults && data.mailto !== undefined) {
> -				mailtoField.setValue(data.mailto);
> -			    }
> -			    if (!initialDefaults && data['notification-mode'] !== undefined) {
> -				notificationModeSelector.setValue(data['notification-mode']);
> +			    if (!initialDefaults) {
> +				let notificationMode = data['notification-mode'] ?? 'auto';
> +				let mailto = data.mailto;
> +
> +				if (notificationMode === 'auto' && mailto !== undefined) {
> +				    notificationMode = 'legacy-sendmail';
> +				}
> +				if (notificationMode === 'auto' && mailto === undefined) {
> +				    notificationMode = 'notification-system';
> +				}
> +
> +				notificationModeSelector.setValue(notificationMode);
> +				if (mailto !== undefined) {
> +				    mailtoField.setValue(mailto);
> +				}
>  			    }
>  			    if (!initialDefaults && data.mode !== undefined) {
>  				modeSelector.setValue(data.mode);



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-06-13 13:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 12:59 [pve-devel] [PATCH manager 1/2] ui: backup job edit: move notification related settings to separate tab Lukas Wagner
2025-06-11 12:59 ` [pve-devel] [PATCH manager 2/2] ui: one-shot backup: remove 'auto' notification mode for clarity Lukas Wagner
2025-06-13 13:51   ` Michael Köppl [this message]
2025-06-17  8:26     ` Lukas Wagner
2025-06-13 13:51 ` [pve-devel] [PATCH manager 1/2] ui: backup job edit: move notification related settings to separate tab Michael Köppl
2025-06-17  8:56   ` Lukas Wagner
2025-06-17  8:57 ` [pve-devel] superseded: " Lukas Wagner

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=a3815adc-d186-4ba1-b2cb-5a1344aebd93@proxmox.com \
    --to=m.koeppl@proxmox.com \
    --cc=l.wagner@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