Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions frontend/src/lib/event.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ export const resourcesExpandRequirementsPublic =
export function eventResourceAllowListToFilterString(allowedResources: string[]) {
let filterString = "";
for (let i = 0; i < allowedResources.length; i++) {
filterString += ` && resources ~ "${allowedResources[i]}"`;
if (i == 0) {
filterString += ` && ( resources ~ "${allowedResources[i]}"`;
} else {
filterString += ` || resources ~ "${allowedResources[i]}"`;
}
}
filterString += " )";
return filterString;
}

Expand All @@ -93,8 +98,13 @@ export function eventResourceBlockListToFilterString(blockedResources: string[])
export function eventTagAllowListToFilterString(allowedTags: string[]) {
let filterString = "";
for (let i = 0; i < allowedTags.length; i++) {
filterString += ` && tags ~ "${allowedTags[i]}"`;
if (i == 0) {
filterString += ` && ( tags ~ "${allowedTags[i]}"`;
} else {
filterString += ` || tags ~ "${allowedTags[i]}"`;
}
}
filterString += " )";
return filterString;
}

Expand Down
Loading