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>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: [pbs-devel] applied: [PATCH widget-toolkit 1/1] edit window: add optional custom submit options
Date: Thu, 7 Mar 2024 15:22:10 +0100	[thread overview]
Message-ID: <77a09987-f1c0-4ec3-9f55-2e244a8b7820@proxmox.com> (raw)
In-Reply-To: <20240306140425.4089769-2-d.csapak@proxmox.com>

Am 06/03/2024 um 15:04 schrieb Dominik Csapak:
> sometimes it's necessary or handy to add custom options to the submit
> api call (e.g. timeout). So just expose a `submitOptions` where users
> of the edit window can put their custom options.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  src/window/Edit.js | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 

applied, thanks!

> @@ -151,7 +154,7 @@ Ext.define('Proxmox.window.Edit', {
>  	    values = undefined;
>  	}
>  
> -	Proxmox.Utils.API2Request({
> +	let requestOptions = Ext.apply({
>  	    url: url,
>  	    waitMsgTarget: me,
>  	    method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
> @@ -191,7 +194,8 @@ Ext.define('Proxmox.window.Edit', {
>  		    me.close();
>  		}
>  	    },
> -	});
> +	}, me.submitOptions ?? {});
> +	Proxmox.Utils.API2Request(requestOptions);

I thought about using the spread operator, i.e. something like:

Proxmox.Utils.API2Request({
   url: url,
   // and so on
   ...(me.submitOptions ?? {})
});

but it doesn't really has much advantage besides being more modern syntax,
which on it's own is not a good justification, so I ignored the itch to
adapt this ^^




  reply	other threads:[~2024-03-07 14:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 14:04 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] tape: increase gui timeout for transfer Dominik Csapak
2024-03-06 14:04 ` [pbs-devel] [PATCH widget-toolkit 1/1] edit window: add optional custom submit options Dominik Csapak
2024-03-07 14:22   ` Thomas Lamprecht [this message]
2024-03-06 14:04 ` [pbs-devel] [PATCH proxmox-backup 1/1] ui: tape: transfer: increase timeout to 3 minutes Dominik Csapak

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=77a09987-f1c0-4ec3-9f55-2e244a8b7820@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=d.csapak@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