From 3bcc76eaf1872c7e8c39bf1bc3c1a40fb273e28d Mon Sep 17 00:00:00 2001 From: Martin Donadieu Date: Thu, 28 May 2026 02:58:13 +0200 Subject: [PATCH] fix(frontend): improve api key scope filtering --- messages/en.json | 1 + src/components/DataTable.vue | 16 +- src/pages/ApiKeys.vue | 404 +++++++++++++++++++++++++++++++++-- src/services/apikeys.ts | 11 - 4 files changed, 399 insertions(+), 33 deletions(-) diff --git a/messages/en.json b/messages/en.json index b9f47e608d..5c36f9e2c2 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1708,6 +1708,7 @@ "search-by-version": "Search by version", "search-channels": "Search channel", "search-groups": "Search groups", + "search-scope-items": "Search scopes", "search-members": "Search members", "search-organizations": "Search organizations", "search-role-bindings": "Search by user, group or role...", diff --git a/src/components/DataTable.vue b/src/components/DataTable.vue index 234ef45c92..f957f12e31 100644 --- a/src/components/DataTable.vue +++ b/src/components/DataTable.vue @@ -30,6 +30,7 @@ interface Props { isLoading?: boolean filterText?: string filters?: { [key: string]: boolean } + filterLabels?: { [key: string]: string } searchPlaceholder?: string showAdd?: boolean addButtonTestId?: string @@ -94,6 +95,10 @@ const filterActivated = computed(() => { }, 0) }) +function getFilterLabel(filter: string) { + return props.filterLabels?.[filter] ?? t(filter) +} + function sortClick(key: number) { if (!props.columns[key].sortable) return @@ -125,10 +130,10 @@ function updateUrlParams() { params.set('search', searchVal.value) else params.delete('search') if (props.filters) { + params.delete('filter') Object.entries(props.filters).forEach(([key, value]) => { if (value) params.append('filter', key) - else params.delete('filter', key) }) } if (props.currentPage) @@ -172,7 +177,6 @@ function loadFromUrlParams() { newFilters[key] = filterParams.includes(key) }) if (JSON.stringify(newFilters) !== JSON.stringify(props.filters)) { - console.log('update filters', newFilters, props.filters) emit('update:filters', newFilters) } } @@ -497,10 +501,10 @@ const paginationClass = computed(() => props.mobileFixedPagination