all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v2 1/4] ui: realm sync edit: improve ux when there is no ldap/ad realm
Date: Tue, 13 Jun 2023 10:43:58 +0200	[thread overview]
Message-ID: <20230613084401.1282876-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20230613084401.1282876-1-d.csapak@proxmox.com>

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>
---
changes from v1:
* fix eslint warnings
 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..e12ad858 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: `<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],
-- 
2.30.2





  reply	other threads:[~2023-06-13  8:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  8:43 [pve-devel] [PATCH manager v2 0/4] improve ui for reaml sync jobs Dominik Csapak
2023-06-13  8:43 ` Dominik Csapak [this message]
2023-06-14 15:42   ` [pve-devel] applied-series: [PATCH manager v2 1/4] ui: realm sync edit: improve ux when there is no ldap/ad realm Thomas Lamprecht
2023-06-13  8:43 ` [pve-devel] [PATCH manager v2 2/4] ui: realm sync: change enabled column rendering Dominik Csapak
2023-06-13  8:44 ` [pve-devel] [PATCH manager v2 3/4] ui: realm: move sync job panel into realm panel Dominik Csapak
2023-06-13  8:44 ` [pve-devel] [PATCH manager v2 4/4] ui: realm sync: add 'run now' button Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230613084401.1282876-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal