public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Hannes Laimer <h.laimer@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v5 6/6] ui: add support for optional Remote in SyncJob
Date: Wed, 8 Nov 2023 12:06:15 +0100	[thread overview]
Message-ID: <0dc6bbd6-1a9e-45ae-ba0f-8764e32144be@proxmox.com> (raw)
In-Reply-To: <20231006140529.723988-7-h.laimer@proxmox.com>

works quite nice now, a few smaller comments inline.

Am 06/10/2023 um 16:05 schrieb Hannes Laimer:
> @@ -134,16 +143,78 @@ Ext.define('PBS.window.SyncJobEdit', {
>  		],
>  
>  		column2: [
> +		    {
> +			xtype: 'radiogroup',
> +			fieldLabel: gettext('Location'),
> +			defaultType: 'radiofield',
> +			items: [
> +			    {
> +				boxLabel: 'Local',
> +				name: 'location',
> +				inputValue: 'local',
> +				submitValue: false,
> +			    },
> +			    {
> +				boxLabel: 'Remote',
> +				name: 'location',
> +				inputValue: 'remote',
> +				submitValue: false

Seems to miss a

    checked: true,

here to correctly indicate the default from the start on.

> +			    },
> +			],
> +			listeners: {
> +			    change: function(_group, radio) {
> +				let me = this;
> +				let form = me.up('pbsSyncJobEdit');
> +				let remoteField = form.down('field[name=remote]');
> +				let storeField = form.down('field[name=remote-store]');
> +				let nsField = form.down('field[name=remote-ns]');
> +
> +				if (!storeField.value) {
> +				    nsField.clearValue();
> +				    nsField.setDisabled(true);
> +				}
> +

no hard feelings, but for below you could go for a pattern like:

let isLocalSync = radio.location === 'local';

remoteField.setDisabled(isLocalSync);
remoteField.allowBlank = isLocalSync;

and so on, as that might save us some duplication here, but as said, just a nit.

And I observed a small glitch, when switching the radio-group selection from local
to remote, the "Source Remote" field is not marked as required, i.e., a validate
call might be missing.





  reply	other threads:[~2023-11-08 11:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 14:05 [pbs-devel] [PATCH proxmox-backup v5 0/6] local sync-jobs Hannes Laimer
2023-10-06 14:05 ` [pbs-devel] [PATCH proxmox-backup v5 1/6] api: make Remote for SyncJob optional Hannes Laimer
2023-11-08 10:53   ` Thomas Lamprecht
2023-11-08 13:26     ` Hannes Laimer
2023-10-06 14:05 ` [pbs-devel] [PATCH proxmox-backup v5 2/6] manager: add completion for opt. Remote in SyncJob Hannes Laimer
2023-10-06 14:05 ` [pbs-devel] [PATCH proxmox-backup v5 3/6] accept a ref to a HttpClient Hannes Laimer
2023-10-06 14:05 ` [pbs-devel] [PATCH proxmox-backup v5 4/6] pull: refactor pulling from a datastore Hannes Laimer
2023-10-06 14:05 ` [pbs-devel] [PATCH proxmox-backup v5 5/6] pull: add support for pulling from local datastore Hannes Laimer
2023-10-06 14:05 ` [pbs-devel] [PATCH proxmox-backup v5 6/6] ui: add support for optional Remote in SyncJob Hannes Laimer
2023-11-08 11:06   ` Thomas Lamprecht [this message]
2023-11-09  9:34   ` Gabriel Goller

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=0dc6bbd6-1a9e-45ae-ba0f-8764e32144be@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=h.laimer@proxmox.com \
    --cc=pbs-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 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