mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
user_group: Show display_name instead of name for direct subgroups.
For a system group, we were showing it's name, e.g. `role:members` when we want to show it's display_name instead i.e `Members` in the user group popover. Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/system.20group.20subgroup.20display.20in.20group.20popovers/near/1986632
This commit is contained in:
committed by
Tim Abbott
parent
8c51d8d5d0
commit
00bbde8edb
@@ -93,13 +93,16 @@ export function toggle_user_group_info_popover(
|
||||
message_lists.current.select_id(message_id);
|
||||
}
|
||||
user_group_popover_instance = instance;
|
||||
const subgroups = user_groups.convert_name_to_display_name_for_groups(
|
||||
user_groups
|
||||
.get_direct_subgroups_of_group(group)
|
||||
.sort(user_group_components.sort_group_member_name),
|
||||
);
|
||||
const args = {
|
||||
group_name: user_groups.get_display_group_name(group.name),
|
||||
group_description: group.description,
|
||||
members: sort_group_members(fetch_group_members([...group.members])),
|
||||
subgroups: user_groups
|
||||
.get_direct_subgroups_of_group(group)
|
||||
.sort(user_group_components.sort_group_member_name),
|
||||
subgroups,
|
||||
group_edit_url: hash_util.group_edit_url(group, "general"),
|
||||
is_guest: current_user.is_guest,
|
||||
is_system_group: group.is_system_group,
|
||||
|
||||
@@ -375,6 +375,13 @@ export function get_direct_subgroups_of_group(target_user_group: UserGroup): Use
|
||||
return direct_subgroups;
|
||||
}
|
||||
|
||||
export function convert_name_to_display_name_for_groups(user_groups: UserGroup[]): UserGroup[] {
|
||||
return user_groups.map((user_group) => ({
|
||||
...user_group,
|
||||
name: get_display_group_name(user_group.name),
|
||||
}));
|
||||
}
|
||||
|
||||
export function is_user_in_group(
|
||||
user_group_id: number,
|
||||
user_id: number,
|
||||
|
||||
Reference in New Issue
Block a user