public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] node/Tasks: don't count 'preFilters' as normal filters
Date: Tue, 29 Mar 2022 16:04:10 +0200	[thread overview]
Message-ID: <20220329140410.1071454-1-d.csapak@proxmox.com> (raw)

they can not be removed nor are they visible, so don't count them.

When having a prefilter, we now don't show anymore that there is an
active filter, and don't enable the button anymore.
This is the case for vms for example (vmid is a prefilter).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/node/Tasks.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/node/Tasks.js b/src/node/Tasks.js
index 3d7113d..ef1177c 100644
--- a/src/node/Tasks.js
+++ b/src/node/Tasks.js
@@ -165,9 +165,11 @@ Ext.define('Proxmox.node.Tasks', {
 		}
 
 		if (get('extraFilter')) {
+		    let preFilter = get('preFilter') || {};
 		    let extraFilter = get('extraFilter');
-		    for (const value of Object.values(extraFilter)) {
-			if (value !== undefined && value !== null && value !== "") {
+		    for (const [name, value] of Object.entries(extraFilter)) {
+			if (value !== undefined && value !== null && value !== "" &&
+			    preFilter[name] === undefined) {
 			    count++;
 			}
 		    }
@@ -458,6 +460,8 @@ Ext.define('Proxmox.node.Tasks', {
 	    updateExtraFilters(name, value);
 	}
 
+	me.getViewModel().set('preFilter', me.preFilter);
+
 	me.callParent();
 
 	let addFields = function(items) {
-- 
2.30.2





             reply	other threads:[~2022-03-29 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 14:04 Dominik Csapak [this message]
2022-03-29 15:48 ` [pve-devel] applied: " 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=20220329140410.1071454-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-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