From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id AF660A02C4 for ; Mon, 12 Jun 2023 14:44:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 95EF9235FB for ; Mon, 12 Jun 2023 14:43:58 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 12 Jun 2023 14:43:57 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7F58643AD9 for ; Mon, 12 Jun 2023 14:43:57 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Mon, 12 Jun 2023 14:43:54 +0200 Message-Id: <20230612124356.3455888-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230612124356.3455888-1-d.csapak@proxmox.com> References: <20230612124356.3455888-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH manager 1/3] ui: realm sync edit: improve ux when there is no ldap/ad realm X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2023 12:44:28 -0000 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 --- www/manager6/dc/RealmSyncJob.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/www/manager6/dc/RealmSyncJob.js b/www/manager6/dc/RealmSyncJob.js index 5a903ef7..8a1fb2b2 100644 --- a/www/manager6/dc/RealmSyncJob.js +++ b/www/manager6/dc/RealmSyncJob.js @@ -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: `
${gettext('No LDAP/AD Realm found')}
`, + }, 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], -- 2.30.2