* [pmg-devel] [PATCH widget-toolkit] object grid: fix onlineHelp setting from editorConfig for row editors
@ 2025-02-25 14:16 Dominik Csapak
2025-02-25 15:12 ` Stoiko Ivanov
2025-02-25 17:12 ` [pmg-devel] applied: " Thomas Lamprecht
0 siblings, 2 replies; 4+ messages in thread
From: Dominik Csapak @ 2025-02-25 14:16 UTC (permalink / raw)
To: pmg-devel
In our row editors helpers, we unconditionally set onlineHelp from
'opts.onlineHelp', even if it's undefined.
Later we use 'Ext.apply' to set first the editorConfig defaults, then
the 'rowdef.editor' settings. In javascript, the objects
{} and
{ foo: undefined }
are not the same, so Ext.apply overwrites the default from editorConfig
with that from the row definition, also for undefined.
This means if we have a default onlineHelp in editorConfig and none in
the add_*_row options, we would not show it.
To fix it, check if 'opts.onlineHelp' is truthy before setting it in
the row definition. This should not happen for other options used
from the row helper options, since those are nested
(Ext.apply does not work recursively)
This fixes a regression in pmg-gui, where we set a default onlineHelp
for e.g. the Mail Proxy Options which would not show up anymore.
Note: PMG is the only product where we used this pattern, so this
was not visible anywhere in PVE or PBS.
Fixes: 7d16f8b (object grid: allow to pass online help to row editors)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/grid/ObjectGrid.js | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/grid/ObjectGrid.js b/src/grid/ObjectGrid.js
index fa5fb92..2ed1dd2 100644
--- a/src/grid/ObjectGrid.js
+++ b/src/grid/ObjectGrid.js
@@ -67,7 +67,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
editor: {
xtype: 'proxmoxWindowEdit',
subject: text,
- onlineHelp: opts.onlineHelp,
fieldDefaults: {
labelWidth: opts.labelWidth || 100,
},
@@ -84,6 +83,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
},
},
};
+ if (opts.onlineHelp) {
+ me.rows[name].editor.onlineHelp = opts.onlineHelp;
+ }
},
add_text_row: function(name, text, opts) {
@@ -100,7 +102,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
editor: {
xtype: 'proxmoxWindowEdit',
subject: text,
- onlineHelp: opts.onlineHelp,
fieldDefaults: {
labelWidth: opts.labelWidth || 100,
},
@@ -115,6 +116,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
},
},
};
+ if (opts.onlineHelp) {
+ me.rows[name].editor.onlineHelp = opts.onlineHelp;
+ }
},
add_boolean_row: function(name, text, opts) {
@@ -131,7 +135,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
editor: {
xtype: 'proxmoxWindowEdit',
subject: text,
- onlineHelp: opts.onlineHelp,
fieldDefaults: {
labelWidth: opts.labelWidth || 100,
},
@@ -147,6 +150,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
},
},
};
+ if (opts.onlineHelp) {
+ me.rows[name].editor.onlineHelp = opts.onlineHelp;
+ }
},
add_integer_row: function(name, text, opts) {
@@ -163,7 +169,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
editor: {
xtype: 'proxmoxWindowEdit',
subject: text,
- onlineHelp: opts.onlineHelp,
fieldDefaults: {
labelWidth: opts.labelWidth || 100,
},
@@ -180,6 +185,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
},
},
};
+ if (opts.onlineHelp) {
+ me.rows[name].editor.onlineHelp = opts.onlineHelp;
+ }
},
// adds a row that allows editing in a full TextArea that transparently de/encodes as Base64
@@ -198,7 +206,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
editor: {
xtype: 'proxmoxWindowEdit',
subject: text,
- onlineHelp: opts.onlineHelp,
fieldDefaults: {
labelWidth: opts.labelWidth || 600,
},
@@ -209,6 +216,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
},
},
};
+ if (opts.onlineHelp) {
+ me.rows[name].editor.onlineHelp = opts.onlineHelp;
+ }
},
editorConfig: {}, // default config passed to editor
--
2.39.5
_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pmg-devel] [PATCH widget-toolkit] object grid: fix onlineHelp setting from editorConfig for row editors
2025-02-25 14:16 [pmg-devel] [PATCH widget-toolkit] object grid: fix onlineHelp setting from editorConfig for row editors Dominik Csapak
@ 2025-02-25 15:12 ` Stoiko Ivanov
2025-02-25 17:12 ` [pmg-devel] applied: " Thomas Lamprecht
1 sibling, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2025-02-25 15:12 UTC (permalink / raw)
To: Dominik Csapak; +Cc: pmg-devel
Thanks for finding this so fast!
It fixes the vanished help-buttons throughout pmg-gui
(introduced in 573a6e8 ("add onlineHelp properties to all edit windows"))
did not check other users of the ObjectGrid - but from a look through
pmg-gui and the changes the patch looks good - so FWIW:
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
On Tue, 25 Feb 2025 15:16:52 +0100
Dominik Csapak <d.csapak@proxmox.com> wrote:
> In our row editors helpers, we unconditionally set onlineHelp from
> 'opts.onlineHelp', even if it's undefined.
>
> Later we use 'Ext.apply' to set first the editorConfig defaults, then
> the 'rowdef.editor' settings. In javascript, the objects
>
> {} and
> { foo: undefined }
>
> are not the same, so Ext.apply overwrites the default from editorConfig
> with that from the row definition, also for undefined.
>
> This means if we have a default onlineHelp in editorConfig and none in
> the add_*_row options, we would not show it.
>
> To fix it, check if 'opts.onlineHelp' is truthy before setting it in
> the row definition. This should not happen for other options used
> from the row helper options, since those are nested
> (Ext.apply does not work recursively)
>
> This fixes a regression in pmg-gui, where we set a default onlineHelp
> for e.g. the Mail Proxy Options which would not show up anymore.
>
> Note: PMG is the only product where we used this pattern, so this
> was not visible anywhere in PVE or PBS.
>
> Fixes: 7d16f8b (object grid: allow to pass online help to row editors)
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/grid/ObjectGrid.js | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/src/grid/ObjectGrid.js b/src/grid/ObjectGrid.js
> index fa5fb92..2ed1dd2 100644
> --- a/src/grid/ObjectGrid.js
> +++ b/src/grid/ObjectGrid.js
> @@ -67,7 +67,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> editor: {
> xtype: 'proxmoxWindowEdit',
> subject: text,
> - onlineHelp: opts.onlineHelp,
> fieldDefaults: {
> labelWidth: opts.labelWidth || 100,
> },
> @@ -84,6 +83,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> },
> },
> };
> + if (opts.onlineHelp) {
> + me.rows[name].editor.onlineHelp = opts.onlineHelp;
> + }
> },
>
> add_text_row: function(name, text, opts) {
> @@ -100,7 +102,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> editor: {
> xtype: 'proxmoxWindowEdit',
> subject: text,
> - onlineHelp: opts.onlineHelp,
> fieldDefaults: {
> labelWidth: opts.labelWidth || 100,
> },
> @@ -115,6 +116,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> },
> },
> };
> + if (opts.onlineHelp) {
> + me.rows[name].editor.onlineHelp = opts.onlineHelp;
> + }
> },
>
> add_boolean_row: function(name, text, opts) {
> @@ -131,7 +135,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> editor: {
> xtype: 'proxmoxWindowEdit',
> subject: text,
> - onlineHelp: opts.onlineHelp,
> fieldDefaults: {
> labelWidth: opts.labelWidth || 100,
> },
> @@ -147,6 +150,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> },
> },
> };
> + if (opts.onlineHelp) {
> + me.rows[name].editor.onlineHelp = opts.onlineHelp;
> + }
> },
>
> add_integer_row: function(name, text, opts) {
> @@ -163,7 +169,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> editor: {
> xtype: 'proxmoxWindowEdit',
> subject: text,
> - onlineHelp: opts.onlineHelp,
> fieldDefaults: {
> labelWidth: opts.labelWidth || 100,
> },
> @@ -180,6 +185,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> },
> },
> };
> + if (opts.onlineHelp) {
> + me.rows[name].editor.onlineHelp = opts.onlineHelp;
> + }
> },
>
> // adds a row that allows editing in a full TextArea that transparently de/encodes as Base64
> @@ -198,7 +206,6 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> editor: {
> xtype: 'proxmoxWindowEdit',
> subject: text,
> - onlineHelp: opts.onlineHelp,
> fieldDefaults: {
> labelWidth: opts.labelWidth || 600,
> },
> @@ -209,6 +216,9 @@ Ext.define('Proxmox.grid.ObjectGrid', {
> },
> },
> };
> + if (opts.onlineHelp) {
> + me.rows[name].editor.onlineHelp = opts.onlineHelp;
> + }
> },
>
> editorConfig: {}, // default config passed to editor
_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pmg-devel] applied: [PATCH widget-toolkit] object grid: fix onlineHelp setting from editorConfig for row editors
2025-02-25 14:16 [pmg-devel] [PATCH widget-toolkit] object grid: fix onlineHelp setting from editorConfig for row editors Dominik Csapak
2025-02-25 15:12 ` Stoiko Ivanov
@ 2025-02-25 17:12 ` Thomas Lamprecht
2025-02-26 7:30 ` Dominik Csapak
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Lamprecht @ 2025-02-25 17:12 UTC (permalink / raw)
To: Dominik Csapak, pmg-devel
Am 25.02.25 um 15:16 schrieb Dominik Csapak:
> In our row editors helpers, we unconditionally set onlineHelp from
> 'opts.onlineHelp', even if it's undefined.
>
> Later we use 'Ext.apply' to set first the editorConfig defaults, then
> the 'rowdef.editor' settings. In javascript, the objects
>
> {} and
> { foo: undefined }
>
> are not the same, so Ext.apply overwrites the default from editorConfig
> with that from the row definition, also for undefined.
>
> This means if we have a default onlineHelp in editorConfig and none in
> the add_*_row options, we would not show it.
>
> To fix it, check if 'opts.onlineHelp' is truthy before setting it in
> the row definition. This should not happen for other options used
> from the row helper options, since those are nested
> (Ext.apply does not work recursively)
>
> This fixes a regression in pmg-gui, where we set a default onlineHelp
> for e.g. the Mail Proxy Options which would not show up anymore.
>
> Note: PMG is the only product where we used this pattern, so this
> was not visible anywhere in PVE or PBS.
>
> Fixes: 7d16f8b (object grid: allow to pass online help to row editors)
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/grid/ObjectGrid.js | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
>
applied, thanks!
we might need to start a policy for where patches for common repos should
(additionally) get send to to allow slightly simpler noticing then.
For now always adding pve-devel to cc for widget-toolkit patches might
be simple enough.
_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pmg-devel] applied: [PATCH widget-toolkit] object grid: fix onlineHelp setting from editorConfig for row editors
2025-02-25 17:12 ` [pmg-devel] applied: " Thomas Lamprecht
@ 2025-02-26 7:30 ` Dominik Csapak
0 siblings, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2025-02-26 7:30 UTC (permalink / raw)
To: Thomas Lamprecht, pmg-devel
On 2/25/25 18:12, Thomas Lamprecht wrote:
> Am 25.02.25 um 15:16 schrieb Dominik Csapak:
>> In our row editors helpers, we unconditionally set onlineHelp from
>> 'opts.onlineHelp', even if it's undefined.
>>
>> Later we use 'Ext.apply' to set first the editorConfig defaults, then
>> the 'rowdef.editor' settings. In javascript, the objects
>>
>> {} and
>> { foo: undefined }
>>
>> are not the same, so Ext.apply overwrites the default from editorConfig
>> with that from the row definition, also for undefined.
>>
>> This means if we have a default onlineHelp in editorConfig and none in
>> the add_*_row options, we would not show it.
>>
>> To fix it, check if 'opts.onlineHelp' is truthy before setting it in
>> the row definition. This should not happen for other options used
>> from the row helper options, since those are nested
>> (Ext.apply does not work recursively)
>>
>> This fixes a regression in pmg-gui, where we set a default onlineHelp
>> for e.g. the Mail Proxy Options which would not show up anymore.
>>
>> Note: PMG is the only product where we used this pattern, so this
>> was not visible anywhere in PVE or PBS.
>>
>> Fixes: 7d16f8b (object grid: allow to pass online help to row editors)
>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>> ---
>> src/grid/ObjectGrid.js | 20 +++++++++++++++-----
>> 1 file changed, 15 insertions(+), 5 deletions(-)
>>
>>
>
> applied, thanks!
>
> we might need to start a policy for where patches for common repos should
> (additionally) get send to to allow slightly simpler noticing then.
> For now always adding pve-devel to cc for widget-toolkit patches might
> be simple enough.
makes sense to me, I actually thought about doing that, but then decided against that, since it's a
pmg visible change only and I though that currently the patch would be more visible on
pmg-devel anyway. But noted, widget-toolkit will get a cc on pve-devel in the future.
Thanks!
_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-26 7:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-25 14:16 [pmg-devel] [PATCH widget-toolkit] object grid: fix onlineHelp setting from editorConfig for row editors Dominik Csapak
2025-02-25 15:12 ` Stoiko Ivanov
2025-02-25 17:12 ` [pmg-devel] applied: " Thomas Lamprecht
2025-02-26 7:30 ` Dominik Csapak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal