public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 widget-toolkit] fix #4531: Fix ACME plugin edit form not detecting changes
@ 2023-08-30 11:57 Filip Schauer
  2023-08-30 14:05 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Filip Schauer @ 2023-08-30 11:57 UTC (permalink / raw)
  To: pve-devel

Fix the ACME plugin edit form only detecting dirtychanges once the value
of a textfield was dirtied and then changed back to the original.

This behaviour is caused by setting the originalValue directly without
calling checkDirty. The reason is that the dirty flag of the textfield
is set to true by setValue, and then not reset to false even though the
value matches the original value. This is fixed by calling checkDirty
after setting the originalValue to refresh the dirty flag.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
Changes since v1:
* Fix introduced bug that would set a dirty value as the original one
  when switching plugins.
* Improve the commit message

 src/window/ACMEPluginEdit.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/window/ACMEPluginEdit.js b/src/window/ACMEPluginEdit.js
index 0f21527..66ef02c 100644
--- a/src/window/ACMEPluginEdit.js
+++ b/src/window/ACMEPluginEdit.js
@@ -127,6 +127,7 @@ Ext.define('Proxmox.window.ACMEPluginEdit', {
 		    if (me.createdFields[key]) {
 			me.createdFields[key].setValue(value);
 			me.createdFields[key].originalValue = me.originalValues[key];
+			me.createdFields[key].checkDirty();
 		    } else {
 			extradata.push(`${key}=${value}`);
 		    }
-- 
2.39.2





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

* [pve-devel] applied: [PATCH v2 widget-toolkit] fix #4531: Fix ACME plugin edit form not detecting changes
  2023-08-30 11:57 [pve-devel] [PATCH v2 widget-toolkit] fix #4531: Fix ACME plugin edit form not detecting changes Filip Schauer
@ 2023-08-30 14:05 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-08-30 14:05 UTC (permalink / raw)
  To: Proxmox VE development discussion, Filip Schauer

Am 30/08/2023 um 13:57 schrieb Filip Schauer:
> Fix the ACME plugin edit form only detecting dirtychanges once the value
> of a textfield was dirtied and then changed back to the original.
> 
> This behaviour is caused by setting the originalValue directly without
> calling checkDirty. The reason is that the dirty flag of the textfield
> is set to true by setValue, and then not reset to false even though the
> value matches the original value. This is fixed by calling checkDirty
> after setting the originalValue to refresh the dirty flag.
> 
> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
> ---
> Changes since v1:
> * Fix introduced bug that would set a dirty value as the original one
>   when switching plugins.
> * Improve the commit message
> 
>  src/window/ACMEPluginEdit.js | 1 +
>  1 file changed, 1 insertion(+)
> 
>

applied, slightly reworded the commit message, a few subjective nits but
also recording the actual reason we do it this way by using Dominik's example
from his reply to the v1 thread, thanks!




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

end of thread, other threads:[~2023-08-30 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30 11:57 [pve-devel] [PATCH v2 widget-toolkit] fix #4531: Fix ACME plugin edit form not detecting changes Filip Schauer
2023-08-30 14:05 ` [pve-devel] applied: " Thomas Lamprecht

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