group-settings: Allow system groups as subgroups when creating groups.

System groups should be shown in typeahead when adding members
to a group during its creation.
This commit is contained in:
Sahil Batra
2024-12-19 14:42:18 +05:30
committed by Tim Abbott
parent 58822372d5
commit f498201141
3 changed files with 18 additions and 3 deletions

View File

@@ -161,9 +161,9 @@ export function get_realm_user_groups(include_deactivated = false): UserGroup[]
// This is only used for testing currently, but would be used in
// future when we use system groups more and probably show them
// in the UI as well.
export function get_all_realm_user_groups(): UserGroup[] {
export function get_all_realm_user_groups(include_deactivated = false): UserGroup[] {
const user_groups = [...user_group_by_id_dict.values()].sort((a, b) => a.id - b.id);
return user_groups;
return user_groups.filter((group) => include_deactivated || !group.deactivated);
}
export function get_user_groups_allowed_to_mention(): UserGroup[] {