[pbs-devel] [PATCH proxmox-backup v6 6/6] ui: add support for optional Remote in SyncJob
Thomas Lamprecht
t.lamprecht at proxmox.com
Sat Nov 25 17:16:48 CET 2023
Am 24/11/2023 um 11:36 schrieb Lukas Wagner:
>
>
> On 11/21/23 15:31, Hannes Laimer wrote:
>> diff --git a/www/Utils.js b/www/Utils.js
>> index 2eca600e..d7f11cb6 100644
>> --- a/www/Utils.js
>> +++ b/www/Utils.js
>> @@ -711,6 +711,11 @@ Ext.define('PBS.Utils', {
>> return Ext.String.htmlEncode(value);
>> },
>>
>> + render_optional_remote: function(value, metadata, record) {
> Nit: New functions/variables should use camelCase, see
> https://pve.proxmox.com/wiki/Javascript_Style_Guide#Casing
I agree, but kept this as is, because the function above this
is named render_optional_namespace, this probably should be fixed in a more
tree-wide manner
>
>> + if (!value) return `- (${gettext('Local')})`;
> Nit: Don't use single-line if statements for new code, see
> https://pve.proxmox.com/wiki/Javascript_Style_Guide#Single-Line_If-Statement
fixed in a follow-up, those are indeed not nice to read.
>> + listeners: {
>> + change: function(_group, radio) {
>
> Nit: This component already has a controller, including a 'control'
> section for event routing - I guess it would be cleaner
> if this function was part of the controller, triggered
> by an entry for 'control'?
>
> See:
> https://docs-devel.sencha.com/extjs/7.0.0/classic/Ext.app.ViewController.html#cfg-control
>
> However, it seems like other form elements here already use the same
> approach as you, so I guess it's fine.
Yeah I agree, if there's a controller then all* view logic should use
that. But no biggie for now.
*there certainly are exceptions like to all rules/guidelines
More information about the pbs-devel
mailing list