From 6a132187a26e1b01e01bce97bf0dd2efe95de228 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 20 Mar 2023 14:08:58 +0000 Subject: [PATCH] fix phantom column fixes amidaware/tacticalrmm#1264 --- src/components/AgentTable.vue | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/components/AgentTable.vue b/src/components/AgentTable.vue index e2384e8..e60a93b 100644 --- a/src/components/AgentTable.vue +++ b/src/components/AgentTable.vue @@ -374,16 +374,10 @@ export default { "make_model", "physical_disks", ]; - // quasar filter only does visible columns so this is a hack to add hidden columns we want to filter - for (const elem of hiddenFields) { - if (!cols.find((o) => o.name === elem)) { - cols.push({ - name: elem, - field: elem, - }); - } - } + // originally I was modifying cols directly but this led to phantom colum so doing it this way now + // https://github.com/amidaware/tacticalrmm/issues/1264 + const allColumns = [...cols, ...hiddenFields.map((field) => ({ field }))]; const lowerTerms = terms ? terms.toLowerCase() : ""; let advancedFilter = false; @@ -437,7 +431,7 @@ export default { } // Normal text filter - return cols.some((col) => { + return allColumns.some((col) => { const val = cellValue(col, row) + ""; const haystack = val === "undefined" || val === "null" ? "" : val.toLowerCase();