public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] notify: sendmail: smtp: fix mailto/mailto-user parameter deletion
Date: Wed, 29 Nov 2023 13:18:12 +0100	[thread overview]
Message-ID: <20231129121812.145409-1-l.wagner@proxmox.com> (raw)

Both fields were moved to a separate panel at some point, but this
broke parameter deletion behavior (e.g. if a target is modified and
switches from using mailto to mailto-user, then mailto should be
deleted)

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 src/panel/SendmailEditPanel.js | 7 +++++++
 src/panel/SmtpEditPanel.js     | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/src/panel/SendmailEditPanel.js b/src/panel/SendmailEditPanel.js
index 5a154c1..f943fa4 100644
--- a/src/panel/SendmailEditPanel.js
+++ b/src/panel/SendmailEditPanel.js
@@ -97,7 +97,14 @@ Ext.define('Proxmox.panel.SendmailEditPanel', {
 
 	if (values.mailto) {
 	    values.mailto = values.mailto.split(/[\s,;]+/);
+	} else if (!me.isCreate) {
+	    Proxmox.Utils.assemble_field_data(values, { 'delete': 'mailto' });
 	}
+
+	if (!values['mailto-user'] && !me.isCreate) {
+	    Proxmox.Utils.assemble_field_data(values, { 'delete': 'mailto-user' });
+	}
+
 	return values;
     },
 });
diff --git a/src/panel/SmtpEditPanel.js b/src/panel/SmtpEditPanel.js
index 8b258e0..128f1e3 100644
--- a/src/panel/SmtpEditPanel.js
+++ b/src/panel/SmtpEditPanel.js
@@ -173,6 +173,12 @@ Ext.define('Proxmox.panel.SmtpEditPanel', {
 
 	if (values.mailto) {
 	    values.mailto = values.mailto.split(/[\s,;]+/);
+	} else if (!me.isCreate) {
+	    Proxmox.Utils.assemble_field_data(values, { 'delete': 'mailto' });
+	}
+
+	if (!values['mailto-user'] && !me.isCreate) {
+	    Proxmox.Utils.assemble_field_data(values, { 'delete': 'mailto-user' });
 	}
 
 	if (!values.authentication && !me.isCreate) {
-- 
2.39.2





             reply	other threads:[~2023-11-29 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 12:18 Lukas Wagner [this message]
2023-12-11 15:55 ` Maximiliano Sandoval
2023-12-12  8:26   ` 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=20231129121812.145409-1-l.wagner@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal