Skip to content

Commit

Permalink
dashboard: filter: feat: add filter by service name or tags
Browse files Browse the repository at this point in the history
  • Loading branch information
wuriyanto authored and wuriyanto committed Sep 4, 2024
1 parent 70f016f commit 9128cf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dashboard/ui/src/pages/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ function Dashboard() {

const filteredServices = services.filter(service => {
const matchesSearchTerm = service.name.toLowerCase().includes(searchTerm.toLowerCase());
const matchesTagSearch = service.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase()));
const matchesTag = selectedTag ? service.tags.includes(selectedTag) : true;
return matchesSearchTerm && matchesTag;
return (matchesSearchTerm || matchesTagSearch) && matchesTag;
});

return (
Expand Down

0 comments on commit 9128cf6

Please sign in to comment.