From bf1bff9ace25614bcfcfd753521d1336b25ed0f4 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Mon, 28 Oct 2024 16:42:19 +0100 Subject: [PATCH] fix tagManagement condition --- web/frontend/src/generic/helper/TagManagement.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/frontend/src/generic/helper/TagManagement.svelte b/web/frontend/src/generic/helper/TagManagement.svelte index 6fc4f48..eb2a8ee 100644 --- a/web/frontend/src/generic/helper/TagManagement.svelte +++ b/web/frontend/src/generic/helper/TagManagement.svelte @@ -120,10 +120,13 @@ function matchJobTags(tags, availableTags, type, isAdmin, isSupport) { const jobTagIds = tags.map((t) => t.id) - if (isAdmin || type == 'used') { // Always show used tags, admin also show all unused + + if (type == 'used') { // Always show used tags return availableTags.filter((at) => jobTagIds.includes(at.id)) } else { // ... for unused - if (isSupport) { // ... show global tags for support + if (isAdmin) { // ... show all tags for admin + return availableTags.filter((at) => !jobTagIds.includes(at.id)) + } else if (isSupport) { // ... show global tags for support return availableTags.filter((at) => !jobTagIds.includes(at.id) && at.scope !== "admin") } else { // ... show only private tags for user, manager return availableTags.filter((at) => !jobTagIds.includes(at.id) && at.scope !== "admin" && at.scope !== "global")