Skip to content

[master] Fixed Credentials Search #2455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 2, 2025
Merged
Changes from 1 commit
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
Next Next commit
Fixed Credentials Search
  • Loading branch information
grolu committed May 21, 2025
commit 4b71f9df543d2c9d6b98f272b43796a16f61a602
22 changes: 20 additions & 2 deletions frontend/src/views/GCredentials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ SPDX-License-Identifier: Apache-2.0
v-model:sort-by="infraCredentialSortBy"
:headers="visibleInfraCredentialTableHeaders"
:items="infrastructureCredentialSortedItems"
:item-key="getItemKey"
:custom-key-sort="disableCustomKeySort(visibleInfraCredentialTableHeaders)"
must-sort
hover
:custom-filter="customFilter"
:search="infraCredentialFilter"
density="compact"
class="g-table"
Expand All @@ -116,7 +118,6 @@ SPDX-License-Identifier: Apache-2.0
>
<template #item="{ item, itemRef }">
<g-credential-row-infra
:key="`${item.credentialNamespace}/${item.credentialName}`"
:ref="itemRef"
:binding="item"
:highlighted="isHighlighted(item)"
Expand Down Expand Up @@ -223,9 +224,11 @@ SPDX-License-Identifier: Apache-2.0
v-model:sort-by="dnsCredentialSortBy"
:headers="visibleDnsCredentialTableHeaders"
:items="dnsCredentialSortedItems"
:item-key="getItemKey"
:custom-key-sort="disableCustomKeySort(visibleDnsCredentialTableHeaders)"
must-sort
hover
:custom-filter="customFilter"
:search="dnsCredentialFilter"
density="compact"
class="g-table"
Expand All @@ -234,7 +237,6 @@ SPDX-License-Identifier: Apache-2.0
>
<template #item="{ item, itemRef }">
<g-credential-row-dns
:key="`${item.credentialNamespace}/${item.credentialName}`"
:ref="itemRef"
:binding="item"
:highlighted="isHighlighted(item)"
Expand Down Expand Up @@ -576,6 +578,22 @@ export default {
isHighlighted (binding) {
return this.highlightedUid && this.highlightedUid === binding.metadata.uid
},
customFilter (_, query, item) {
const values = [
item.raw.metadata.name,
item.raw.provider.type,
item.raw.kind,
]
return values.some(value => {
if (value) {
return value.toString().toLowerCase().includes(query.toLowerCase())
}
return false
})
},
getItemKey (item, fallback) {
return get(item, ['raw', 'metadata', 'uid'], fallback)
},
},
}
</script>
Expand Down