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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-04-26 14:25:36 +02:00
parent 3e43739f57
commit 04f27b64d9

View File

@ -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.'),
},
],
},
],
});