]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: realm sync edit: improve ux when there is no ldap/ad realm
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 13 Jun 2023 08:43:58 +0000 (10:43 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Jun 2023 15:23:22 +0000 (17:23 +0200)
by adding an empty text to the dropdown, and disabling the other
possibly invalid fields, so that it's clear why the panel is invalid

as soon as there is an ldap/ad realm, it gets autoselected anyway and
the fields get re-enabled.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/dc/RealmSyncJob.js

index 5a903ef7df553d2ef3e98d8c9780cb163c97cb84..e12ad858c0437be596d32aa1e138b8e5e80f040e 100644 (file)
@@ -154,6 +154,11 @@ Ext.define('PVE.dc.RealmSyncJobEdit', {
 
        updateDefaults: function(_field, newValue) {
            let me = this;
+
+           ['scope', 'enable-new', 'schedule'].forEach((reference) => {
+               me.lookup(reference)?.setDisabled(false);
+           });
+
            // only update on create
            if (!me.getView().isCreate) {
                return;
@@ -232,6 +237,9 @@ Ext.define('PVE.dc.RealmSyncJobEdit', {
                        xtype: 'pmxRealmComboBox',
                        storeFilter: rec => rec.data.type === 'ldap' || rec.data.type === 'ad',
                    },
+                   listConfig: {
+                       emptyText: `<div class="x-grid-empty">${gettext('No LDAP/AD Realm found')}</div>`,
+                   },
                    cbind: {
                        editable: '{isCreate}',
                    },
@@ -245,6 +253,7 @@ Ext.define('PVE.dc.RealmSyncJobEdit', {
                {
                    xtype: 'pveCalendarEvent',
                    fieldLabel: gettext('Schedule'),
+                   disabled: true,
                    allowBlank: false,
                    name: 'schedule',
                    reference: 'schedule',
@@ -265,6 +274,7 @@ Ext.define('PVE.dc.RealmSyncJobEdit', {
                    xtype: 'proxmoxKVComboBox',
                    name: 'scope',
                    reference: 'scope',
+                   disabled: true,
                    fieldLabel: gettext('Scope'),
                    value: '',
                    emptyText: gettext('No default available'),
@@ -280,6 +290,7 @@ Ext.define('PVE.dc.RealmSyncJobEdit', {
                    xtype: 'proxmoxKVComboBox',
                    value: '1',
                    deleteEmpty: false,
+                   disabled: true,
                    allowBlank: false,
                    comboItems: [
                        ['1', Proxmox.Utils.yesText],