* [pve-devel] [RFC PATCH widget-toolkit] comboGrid: set errorMask on store load failure
@ 2020-11-04 14:17 Dominik Csapak
2020-11-05 10:09 ` Fabian Grünbichler
2020-11-09 7:02 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2020-11-04 14:17 UTC (permalink / raw)
To: pve-devel
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
this makes it possible to see that there was an error while accessing the api
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
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...
src/form/ComboGrid.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
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 = picker.getMinHeight();
picker.setMinHeight(100);
}
+ if (me.loadError) {
+ Proxmox.Utils.setErrorMask(picker, me.loadError);
+ delete me.loadError;
+ picker.updateLayout();
+ }
});
picker.getNavigationModel().navigateOnSpace = 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;
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 = Proxmox.Utils.getResponseErrorMessage(o.getError());
+ if (me.picker) {
+ Proxmox.Utils.setErrorMask(me.picker, msg);
+ }
+ me.loadError = msg;
}
});
},
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] [RFC PATCH widget-toolkit] comboGrid: set errorMask on store load failure
2020-11-04 14:17 [pve-devel] [RFC PATCH widget-toolkit] comboGrid: set errorMask on store load failure Dominik Csapak
@ 2020-11-05 10:09 ` Fabian Grünbichler
2020-11-09 7:02 ` [pve-devel] applied: " Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2020-11-05 10:09 UTC (permalink / raw)
To: Proxmox VE development discussion
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
>
> this makes it possible to see that there was an error while accessing the api
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> 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
trip down the combogrid rabbit hole, and I did not see any breakage in
the PBS GUI with other ComoboGrids
>
> src/form/ComboGrid.js | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> 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 = picker.getMinHeight();
> picker.setMinHeight(100);
> }
> + if (me.loadError) {
> + Proxmox.Utils.setErrorMask(picker, me.loadError);
> + delete me.loadError;
> + picker.updateLayout();
> + }
> });
>
> picker.getNavigationModel().navigateOnSpace = 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;
>
> 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 = Proxmox.Utils.getResponseErrorMessage(o.getError());
> + if (me.picker) {
> + Proxmox.Utils.setErrorMask(me.picker, msg);
> + }
> + me.loadError = msg;
> }
> });
> },
> --
> 2.20.1
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pve-devel] applied: [RFC PATCH widget-toolkit] comboGrid: set errorMask on store load failure
2020-11-04 14:17 [pve-devel] [RFC PATCH widget-toolkit] comboGrid: set errorMask on store load failure Dominik Csapak
2020-11-05 10:09 ` Fabian Grünbichler
@ 2020-11-09 7:02 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2020-11-09 7:02 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
On 04.11.20 15:17, 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
>
> this makes it possible to see that there was an error while accessing the api
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> 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...
>
> src/form/ComboGrid.js | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-09 7:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 14:17 [pve-devel] [RFC PATCH widget-toolkit] comboGrid: set errorMask on store load failure Dominik Csapak
2020-11-05 10:09 ` Fabian Grünbichler
2020-11-09 7:02 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox