From 04f27b64d9a366e58ec1af0adfd86ac3ef10e7f8 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 26 Apr 2022 14:25:36 +0200 Subject: [PATCH] ui: realm sync: use fieldset for remove-vanished & ux/wording Use fieldsets, which are just way nicer for grouping these things. Disable the "remove properties" checkbox if we'd remove the whole user anyway. Signed-off-by: Thomas Lamprecht --- www/manager6/dc/AuthEditLDAP.js | 58 +++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/www/manager6/dc/AuthEditLDAP.js b/www/manager6/dc/AuthEditLDAP.js index 50505ae2..4a0823af 100644 --- a/www/manager6/dc/AuthEditLDAP.js +++ b/www/manager6/dc/AuthEditLDAP.js @@ -99,6 +99,22 @@ Ext.define('PVE.panel.LDAPSyncInputPanel', { extend: 'Proxmox.panel.InputPanel', xtype: 'pveAuthLDAPSyncPanel', + controller: { + xclass: 'Ext.app.ViewController', + control: { + 'proxmoxcheckbox[name=remove-vanished-entry]': { + change: function(_f, removeEntries) { + let propertyField = this.getView() + .down('proxmoxcheckbox[name=remove-vanished-properties]'); + propertyField.setDisabled(removeEntries); + if (removeEntries) { + propertyField.setValue(true); + } + }, + }, + }, + }, + editableAttributes: ['email'], editableDefaults: ['scope', 'enable-new'], default_opts: {}, @@ -277,26 +293,28 @@ Ext.define('PVE.panel.LDAPSyncInputPanel', { columnB: [ { - xtype: 'displayfield', - fieldLabel: gettext('Remove Vanished'), - }, - { - xtype: 'proxmoxcheckbox', - fieldLabel: gettext('ACL'), - name: 'remove-vanished-acl', - boxLabel: gettext('Remove ACLs of users and groups which are not in the sync response.'), - }, - { - xtype: 'proxmoxcheckbox', - fieldLabel: gettext('Entry'), - name: 'remove-vanished-entry', - boxLabel: gettext('Remove users and groups that are not in the sync response.'), - }, - { - xtype: 'proxmoxcheckbox', - fieldLabel: gettext('Properties'), - name: 'remove-vanished-properties', - boxLabel: gettext('Remove user-properties that are not in the sync response.'), + xtype: 'fieldset', + title: gettext('Remove Vanished Options'), + items: [ + { + xtype: 'proxmoxcheckbox', + fieldLabel: gettext('ACL'), + name: 'remove-vanished-acl', + boxLabel: gettext('Remove ACLs of vanished users and groups.'), + }, + { + xtype: 'proxmoxcheckbox', + fieldLabel: gettext('Entry'), + name: 'remove-vanished-entry', + boxLabel: gettext('Remove vanished user and group entries.'), + }, + { + xtype: 'proxmoxcheckbox', + fieldLabel: gettext('Properties'), + name: 'remove-vanished-properties', + boxLabel: gettext('Remove properties from vanished users.'), + }, + ], }, ], });