Skip to content

Commit

Permalink
UI search by key (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
serh11d authored Jan 1, 2024
1 parent 3e4fb4a commit 2e3a36b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions browser/flagr-ui/src/components/Flags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,18 @@ export default {
computed: {
filteredFlags: function() {
if (this.searchTerm) {
return this.flags.filter(({ id, description, tags }) =>
return this.flags.filter(({ id, key, description, tags }) =>
this.searchTerm
.split(",")
.map(term => {
const termLowerCase = term.toLowerCase();
return (
id.toString().includes(term) ||
description.toLowerCase().includes(term.toLowerCase()) ||
key.includes(term) ||
description.toLowerCase().includes(termLowerCase) ||
tags
.map(tag =>
tag.value.toLowerCase().includes(term.toLowerCase())
tag.value.toLowerCase().includes(termLowerCase)
)
.includes(true)
);
Expand Down

0 comments on commit 2e3a36b

Please sign in to comment.