Skip to content

Commit

Permalink
fix tagManagement condition
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Oct 28, 2024
1 parent 06f24e9 commit bf1bff9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/frontend/src/generic/helper/TagManagement.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit bf1bff9

Please sign in to comment.