public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 5/6] ui: sync job: don't send delete value on creation
Date: Wed,  6 Mar 2024 12:21:03 +0100	[thread overview]
Message-ID: <20240306112104.2486728-7-d.csapak@proxmox.com> (raw)
In-Reply-To: <20240306112104.2486728-1-d.csapak@proxmox.com>

since that's not a valid api parameter there
we have to pass the `isCreate` value through to the inputpanel, we even
used it there already but it was never set.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/window/SyncJobEdit.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js
index c11103eb..e06fdd81 100644
--- a/www/window/SyncJobEdit.js
+++ b/www/window/SyncJobEdit.js
@@ -80,6 +80,9 @@ Ext.define('PBS.window.SyncJobEdit', {
 		    }
 		    return values;
 		},
+		cbind: {
+		    isCreate: '{isCreate}', // pass it through
+		},
 		column1: [
 		    {
 			xtype: 'pmxDisplayEditField',
@@ -266,7 +269,9 @@ Ext.define('PBS.window.SyncJobEdit', {
 			xtype: 'pbsNamespaceMaxDepthReduced',
 			name: 'max-depth',
 			fieldLabel: gettext('Max. Depth'),
-			deleteEmpty: true,
+			cbind: {
+			    deleteEmpty: '{!isCreate}',
+			},
 		    },
 		    {
 			fieldLabel: gettext('Remove vanished'),
@@ -321,6 +326,7 @@ Ext.define('PBS.window.SyncJobEdit', {
 	    {
 		xtype: 'inputpanel',
 		onGetValues: function(values) {
+		    let me = this;
 		    PBS.Utils.delete_if_default(values, 'group-filter');
 		    if (Ext.isArray(values['group-filter'])) {
 			if (values['group-filter'].length === 0) {
@@ -331,8 +337,14 @@ Ext.define('PBS.window.SyncJobEdit', {
 			    values['group-filter'] = [...new Set(values['group-filter'])];
 			}
 		    }
+		    if (me.isCreate) {
+			delete values.delete;
+		    }
 		    return values;
 		},
+		cbind: {
+		    isCreate: '{isCreate}', // pass it through
+		},
 		title: gettext('Group Filter'),
 		items: [
 		    {
-- 
2.39.2





  parent reply	other threads:[~2024-03-06 11:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 11:20 [pbs-devel] [PATCH widget-toolkit/proxmox-backup] adapt to stricter api parameter checks Dominik Csapak
2024-03-06 11:20 ` [pbs-devel] [PATCH widget-toolkit 1/1] realms: don't send type and delete on creation Dominik Csapak
2024-03-06 11:20 ` [pbs-devel] [PATCH proxmox-backup 1/6] ui: prune job edit: indent fix Dominik Csapak
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 2/6] ui: metrics: don't send digest when creating a new influxdbupd host Dominik Csapak
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 3/6] ui: tape backup job: don't send delete value on creation Dominik Csapak
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 4/6] ui: prune: fix sending invalid parameters Dominik Csapak
2024-03-06 11:21 ` Dominik Csapak [this message]
2024-03-06 11:21 ` [pbs-devel] [PATCH proxmox-backup 6/6] ui: verify job: don't send delete value on creation Dominik Csapak
2024-03-07  9:32 ` [pbs-devel] applied-series: [PATCH widget-toolkit/proxmox-backup] adapt to stricter api parameter checks Thomas Lamprecht

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=20240306112104.2486728-7-d.csapak@proxmox.com \
    --to=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