Skip to content

Commit

Permalink
React on code review
Browse files Browse the repository at this point in the history
  • Loading branch information
JanAckermann committed Apr 13, 2022
1 parent a259a60 commit ba6547a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default {
},
methods: {
filter(groups, searchTerm) {
if (!searchTerm) {
if (!(searchTerm || '').trim()) {
return groups
}
const groupsSearchEngine = new Fuse(groups, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default {
},
methods: {
filter(users, searchTerm) {
if (!searchTerm) {
if (!(searchTerm || '').trim()) {
return users
}
const usersSearchEngine = new Fuse(users, {
Expand Down
7 changes: 6 additions & 1 deletion packages/web-app-user-management/src/search/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ export default class Provider extends EventBus implements SearchProvider {
}

public get label(): string {
return $gettext(`Search ${kind(this.router.currentRoute)} ↵`)
switch (kind(this.router.currentRoute)) {
case 'users':
return $gettext('Search users ↵')
case 'groups':
return $gettext('Search groups ↵')
}
}

public activate(term: string): void {
Expand Down

0 comments on commit ba6547a

Please sign in to comment.