From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH manager 1/2] ui: dc: backup: improve UX for the different 'notification-mode's
Date: Mon, 8 Jan 2024 11:43:56 +0100 [thread overview]
Message-ID: <ddb7ff33-8a00-4719-8389-0f06e725efd1@proxmox.com> (raw)
In-Reply-To: <20231123160902.282661-1-l.wagner@proxmox.com>
ping
On 11/23/23 17:09, Lukas Wagner wrote:
> - Switch order of 'mailto' and 'mailnotification' field
> - When mode is 'auto', disable 'mailtnotification' field
> - When mode is 'auto' and 'mailto' is empty, show
> hint that the notification system will be used
>
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
> www/manager6/dc/Backup.js | 37 +++++++++++++++++++++++++++++++------
> 1 file changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
> index 70903bdc..780315db 100644
> --- a/www/manager6/dc/Backup.js
> +++ b/www/manager6/dc/Backup.js
> @@ -207,13 +207,26 @@ Ext.define('PVE.dc.BackupEdit', {
> data: {
> selMode: 'include',
> notificationMode: '__default__',
> + mailto: '',
> + mailNotification: '',
> },
>
> formulas: {
> poolMode: (get) => get('selMode') === 'pool',
> - disableVMSelection: (get) => get('selMode') !== 'include' && get('selMode') !== 'exclude',
> + disableVMSelection: (get) => get('selMode') !== 'include' &&
> + get('selMode') !== 'exclude',
> showMailtoFields: (get) =>
> ['auto', 'legacy-sendmail', '__default__'].includes(get('notificationMode')),
> +
> + enableMailnotificationField: (get) => {
> + let mode = get('notificationMode');
> + let mailto = get('mailto');
> +
> + return (['auto', '__default__'].includes(mode) && mailto) ||
> + mode === 'legacy-sendmail';
> + },
> + hintTextVisible: (get) =>
> + ['auto', '__default__'].includes(get('notificationMode')) && !get('mailto'),
> },
> },
>
> @@ -325,6 +338,15 @@ Ext.define('PVE.dc.BackupEdit', {
> value: '{notificationMode}',
> },
> },
> + {
> + xtype: 'textfield',
> + fieldLabel: gettext('Send email to'),
> + name: 'mailto',
> + bind: {
> + hidden: '{!showMailtoFields}',
> + value: '{mailto}',
> + },
> + },
> {
> xtype: 'pveEmailNotificationSelector',
> fieldLabel: gettext('Send email'),
> @@ -334,15 +356,18 @@ Ext.define('PVE.dc.BackupEdit', {
> deleteEmpty: '{!isCreate}',
> },
> bind: {
> - disabled: '{!showMailtoFields}',
> + hidden: '{!showMailtoFields}',
> + disabled: '{!enableMailnotificationField}',
> + value: '{mailNotification}',
> },
> },
> {
> - xtype: 'textfield',
> - fieldLabel: gettext('Send email to'),
> - name: 'mailto',
> + xtype: 'displayfield',
> + userCls: 'pmx-hint',
> + hidden: true,
> + value: gettext('No email configured, the notification system will be used'),
> bind: {
> - disabled: '{!showMailtoFields}',
> + hidden: '{!hintTextVisible}',
> },
> },
> {
--
- Lukas
next prev parent reply other threads:[~2024-01-08 10:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 16:09 Lukas Wagner
2023-11-23 16:09 ` [pve-devel] [PATCH manager 2/2] ui: one-off backup: show hint if notification-system is used Lukas Wagner
2023-12-14 10:26 ` [pve-devel] [PATCH manager 1/2] ui: dc: backup: improve UX for the different 'notification-mode's Maximiliano Sandoval
2024-04-11 7:44 ` Thomas Lamprecht
2024-04-15 9:27 ` Lukas Wagner
2024-01-08 10:43 ` Lukas Wagner [this message]
2024-02-16 10:35 ` Lukas Wagner
2024-04-09 9:22 ` Maximiliano Sandoval
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=ddb7ff33-8a00-4719-8389-0f06e725efd1@proxmox.com \
--to=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