From 61c1810f862b76a032d87039a9f193e4aca42d74 Mon Sep 17 00:00:00 2001 From: Sean Holden Date: Wed, 8 Jan 2025 21:27:45 +0000 Subject: [PATCH 1/2] add array support for enforcedQueueFilter --- .../custom-components/QueueDirectoryTab.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plugin-flex-ts-template-v2/src/feature-library/custom-transfer-directory/custom-components/QueueDirectoryTab.tsx b/plugin-flex-ts-template-v2/src/feature-library/custom-transfer-directory/custom-components/QueueDirectoryTab.tsx index 1d18d1797..e89011a66 100644 --- a/plugin-flex-ts-template-v2/src/feature-library/custom-transfer-directory/custom-components/QueueDirectoryTab.tsx +++ b/plugin-flex-ts-template-v2/src/feature-library/custom-transfer-directory/custom-components/QueueDirectoryTab.tsx @@ -216,16 +216,15 @@ const QueueDirectoryTab = (props: OwnProps) => { }) .filter((queue) => { const attributes = workerClient?.attributes as CustomWorkerAttributes; - const enforcedQueueFilter = attributes?.enforcedQueueFilter?.toLocaleLowerCase(); + // This will work with both "filterString" and ["filter1", "filter2"] formats. + const enforcedQueueFilter = attributes?.enforcedQueueFilter; if (enforceQueueFilterFromWorker() && enforcedQueueFilter) { - return queue.name.toLocaleLowerCase().includes(enforcedQueueFilter); - } - return queue; - }) - .filter((queue) => { - const enforcedQueueFilter = getGlobalFilter().toLocaleLowerCase(); - if (shouldEnforceGlobalFilter() && enforcedQueueFilter) { - return !queue.name.toLocaleLowerCase().includes(enforcedQueueFilter); + if (Array.isArray(enforcedQueueFilter)) { + return enforcedQueueFilter.some(filter => + queue.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()) + ); + } + return queue.name.toLocaleLowerCase().includes(enforcedQueueFilter.toLocaleLowerCase()); } return queue; }) From bfe796e9eac83365b3ba761eec4c5f8d55db203c Mon Sep 17 00:00:00 2001 From: Sean Holden Date: Wed, 8 Jan 2025 21:34:17 +0000 Subject: [PATCH 2/2] Update documentation to reflect changes --- docs/docs/feature-library/custom-transfer-directory.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docs/feature-library/custom-transfer-directory.md b/docs/docs/feature-library/custom-transfer-directory.md index b4877c472..a64bcde80 100644 --- a/docs/docs/feature-library/custom-transfer-directory.md +++ b/docs/docs/feature-library/custom-transfer-directory.md @@ -66,6 +66,8 @@ Example worker attribute setting for when the `enforce_queue_filter_from_worker_ ```javascript worker.attributes : { enforcedQueueFilter : "TEAM A" // example filter that will include only queues with TEAM A in the name + // OR using array format for multiple filters + enforcedQueueFilter : ["TEAM A", "TEAM B"] // will include queues that match any of these filters } ```