public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: fix pbs storage edit reset behavior
@ 2024-04-24 11:03 Dominik Csapak
  2024-06-12 13:51 ` Fiona Ebner
  2024-11-12 13:23 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2024-04-24 11:03 UTC (permalink / raw)
  To: pve-devel

two similar things to fix here:
* the 'crypt-allow-edit' field was not submitted, but it's value was
  only ever set with a bind, so a reset always set it to it's
  default 'false' value (disabling the radio buttons, even when
  it was not visible)

* the initial value of the 'keep' variant of the radiofield was decided
  only from 'isCreate' (via the 'checked' cbind), but should have been
  decided by whether there was an encryption key or not.

both are fixed by setting the values in the 'setValue' method
explicitly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/storage/PBSEdit.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/www/manager6/storage/PBSEdit.js b/www/manager6/storage/PBSEdit.js
index 70dc42f5..95bf0a50 100644
--- a/www/manager6/storage/PBSEdit.js
+++ b/www/manager6/storage/PBSEdit.js
@@ -220,11 +220,14 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
 		// old key without FP
 		values['crypt-key-fp'] = icon + gettext('Active');
 	    }
+	    values.cryptMode = 'keep';
+	    values['crypt-allow-edit'] = false;
 	} else {
 	    values['crypt-key-fp'] = gettext('None');
 	    let cryptModeNone = me.down('radiofield[inputValue=none]');
 	    cryptModeNone.setBoxLabel(gettext('Do not encrypt backups'));
-	    cryptModeNone.setValue(true);
+	    values.cryptMode = 'none';
+	    values['crypt-allow-edit'] = true;
 	}
 	vm.set('keepCryptVisible', !!cryptKeyInfo);
 	vm.set('allowEdit', !cryptKeyInfo);
@@ -272,7 +275,6 @@ Ext.define('PVE.panel.PBSEncryptionKeyTab', {
 	    padding: '0 0 0 25',
 	    cbind: {
 		hidden: '{isCreate}',
-		checked: '{!isCreate}',
 	    },
 	    bind: {
 		hidden: '{!keepCryptVisible}',
-- 
2.39.2



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


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

* Re: [pve-devel] [PATCH manager] ui: fix pbs storage edit reset behavior
  2024-04-24 11:03 [pve-devel] [PATCH manager] ui: fix pbs storage edit reset behavior Dominik Csapak
@ 2024-06-12 13:51 ` Fiona Ebner
  2024-11-12 13:23 ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2024-06-12 13:51 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 24.04.24 um 13:03 schrieb Dominik Csapak:
> two similar things to fix here:
> * the 'crypt-allow-edit' field was not submitted, but it's value was
>   only ever set with a bind, so a reset always set it to it's
>   default 'false' value (disabling the radio buttons, even when
>   it was not visible)
> 
> * the initial value of the 'keep' variant of the radiofield was decided
>   only from 'isCreate' (via the 'checked' cbind), but should have been
>   decided by whether there was an encryption key or not.
> 
> both are fixed by setting the values in the 'setValue' method
> explicitly
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>

Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>


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


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

* [pve-devel] applied: [PATCH manager] ui: fix pbs storage edit reset behavior
  2024-04-24 11:03 [pve-devel] [PATCH manager] ui: fix pbs storage edit reset behavior Dominik Csapak
  2024-06-12 13:51 ` Fiona Ebner
@ 2024-11-12 13:23 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-11-12 13:23 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 24.04.24 um 13:03 schrieb Dominik Csapak:
> two similar things to fix here:
> * the 'crypt-allow-edit' field was not submitted, but it's value was
>   only ever set with a bind, so a reset always set it to it's
>   default 'false' value (disabling the radio buttons, even when
>   it was not visible)
> 
> * the initial value of the 'keep' variant of the radiofield was decided
>   only from 'isCreate' (via the 'checked' cbind), but should have been
>   decided by whether there was an encryption key or not.
> 
> both are fixed by setting the values in the 'setValue' method
> explicitly
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/manager6/storage/PBSEdit.js | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
>

applied with Fiona's R-b and T-b, thanks!


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


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

end of thread, other threads:[~2024-11-12 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-24 11:03 [pve-devel] [PATCH manager] ui: fix pbs storage edit reset behavior Dominik Csapak
2024-06-12 13:51 ` Fiona Ebner
2024-11-12 13:23 ` [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