From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id EBE666E3E7 for ; Tue, 29 Mar 2022 16:04:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DD4952F668 for ; Tue, 29 Mar 2022 16:04:14 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id CE1102F65E for ; Tue, 29 Mar 2022 16:04:12 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D8194429E2 for ; Tue, 29 Mar 2022 16:04:11 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Tue, 29 Mar 2022 16:04:10 +0200 Message-Id: <20220329140410.1071454-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.147 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH widget-toolkit] node/Tasks: don't count 'preFilters' as normal filters X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2022 14:04:15 -0000 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 --- 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