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 9B55365E1F for ; Thu, 5 Nov 2020 11:10:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8A7EE16384 for ; Thu, 5 Nov 2020 11:09:53 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS id B835C1637A for ; Thu, 5 Nov 2020 11:09:52 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7CEE34601A for ; Thu, 5 Nov 2020 11:09:52 +0100 (CET) Date: Thu, 05 Nov 2020 11:09:43 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20201104141740.365-1-d.csapak@proxmox.com> In-Reply-To: <20201104141740.365-1-d.csapak@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1604570689.noao8kwv0u.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pve-devel] [RFC PATCH widget-toolkit] comboGrid: set errorMask on store load failure 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: Thu, 05 Nov 2020 10:10:23 -0000 On November 4, 2020 3:17 pm, Dominik Csapak wrote: > if there occured an error in the api call of the store, show this error > on the picker when opened, instead of just showing an empty picker >=20 > this makes it possible to see that there was an error while accessing the= api >=20 > Signed-off-by: Dominik Csapak > --- > altough i tested this, i'd like for someone else to test it too, since > we basically use this anywhere and i am not sure if i forgot some edge > case... FWIW, works well for the remote store selector patch that triggered this=20 trip down the combogrid rabbit hole, and I did not see any breakage in=20 the PBS GUI with other ComoboGrids >=20 > src/form/ComboGrid.js | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js > index e5a1920..20c9455 100644 > --- a/src/form/ComboGrid.js > +++ b/src/form/ComboGrid.js > @@ -304,6 +304,11 @@ Ext.define('Proxmox.form.ComboGrid', { > me.savedMinHeight =3D picker.getMinHeight(); > picker.setMinHeight(100); > } > + if (me.loadError) { > + Proxmox.Utils.setErrorMask(picker, me.loadError); > + delete me.loadError; > + picker.updateLayout(); > + } > }); > =20 > picker.getNavigationModel().navigateOnSpace =3D false; > @@ -415,6 +420,7 @@ Ext.define('Proxmox.form.ComboGrid', { > me.mon(me.store, 'load', function(store, r, success, o) { > if (success) { > me.clearInvalid(); > + delete me.loadError; > =20 > if (me.enableLoadMask) { > delete me.enableLoadMask; > @@ -425,6 +431,7 @@ Ext.define('Proxmox.form.ComboGrid', { > // gets not recalculated > if (me.picker) { > me.picker.setMinHeight(me.savedMinHeight || 0); > + Proxmox.Utils.setErrorMask(me.picker); > delete me.savedMinHeight; > me.picker.updateLayout(); > } > @@ -451,6 +458,12 @@ Ext.define('Proxmox.form.ComboGrid', { > } > } > } > + } else { > + let msg =3D Proxmox.Utils.getResponseErrorMessage(o.getError()); > + if (me.picker) { > + Proxmox.Utils.setErrorMask(me.picker, msg); > + } > + me.loadError =3D msg; > } > }); > }, > --=20 > 2.20.1 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20 =