user-groups: Make members list search work correctly for subgroups.

There were two bugs that this commit fixed -

1) For system groups, the query was being matched with the actual
group name instead of display name.

2) Subgroup name was not converted to lower case before matching
it with query which is converted to lower case.
This commit is contained in:
Sahil Batra
2025-01-13 20:03:28 +05:30
committed by Tim Abbott
parent 658e342480
commit 57a3edcc6a

View File

@@ -3,6 +3,7 @@ import $ from "jquery";
import {$t_html} from "./i18n.ts";
import * as people from "./people.ts";
import type {User} from "./people.ts";
import * as user_groups from "./user_groups.ts";
import type {UserGroup} from "./user_groups.ts";
import * as user_sort from "./user_sort.ts";
import * as util from "./util.ts";
@@ -116,7 +117,7 @@ export function build_group_member_matcher(query: string): (member: User | UserG
return termlet_matchers.every((matcher) => matcher(member));
}
const group_name = member.name;
const group_name = user_groups.get_display_group_name(member.name).toLowerCase();
if (group_name.startsWith(query)) {
return true;
}