user_group_popovers: Add display message when group is empty.

Previously no message was being shown in the group popover,
when group had no members, this commit intends to fix this
by displaying an approriate message when group is empty.
Fixes #30830.
This commit is contained in:
codewithnick 2024-07-18 04:03:50 +00:00 committed by Tim Abbott
parent 68c87dbdf8
commit 8786d96fe9
2 changed files with 20 additions and 14 deletions

View File

@ -326,7 +326,8 @@ ul.popover-group-menu-member-list {
}
}
.popover-group-menu-member {
.popover-group-menu-member,
.popover-group-menu-placeholder {
display: flex;
align-items: center;
padding: 0 10px;
@ -339,7 +340,8 @@ ul.popover-group-menu-member-list {
}
.popover-group-menu-description,
.popover-group-menu-member-name {
.popover-group-menu-member-name,
.popover-group-menu-placeholder {
color: var(--color-text-popover-menu);
}

View File

@ -11,18 +11,22 @@
</li>
<li role="separator" class="popover-menu-separator"></li>
<li role="none" class="popover-menu-list-item">
<ul class="popover-menu-list popover-group-menu-member-list" data-simplebar data-simplebar-tab-index="-1" data-simplebar-auto-hide="false">
{{#each members}}
<li class="popover-group-menu-member">
{{#if is_bot}}
<i class="zulip-icon zulip-icon-bot" aria-hidden="true"></i>
{{else}}
<span class="user_circle {{user_circle_class}} popover_user_presence hidden-for-spectators" data-tippy-content="{{user_last_seen_time_status}}"></span>
{{/if}}
<span class="popover-group-menu-member-name">{{full_name}}</span>
</li>
{{/each}}
</ul>
{{#if members.length}}
<ul class="popover-menu-list popover-group-menu-member-list" data-simplebar data-simplebar-tab-index="-1" data-simplebar-auto-hide="false">
{{#each members}}
<li class="popover-group-menu-member">
{{#if is_bot}}
<i class="zulip-icon zulip-icon-bot" aria-hidden="true"></i>
{{else}}
<span class="user_circle {{user_circle_class}} popover_user_presence hidden-for-spectators" data-tippy-content="{{user_last_seen_time_status}}"></span>
{{/if}}
<span class="popover-group-menu-member-name">{{full_name}}</span>
</li>
{{/each}}
</ul>
{{else}}
<span class="popover-group-menu-placeholder"><i>{{t 'This group has no members.'}}</i></span>
{{/if}}
</li>
{{#unless (or is_guest is_system_group)}}
<li role="separator" class="popover-menu-separator hidden-for-spectators"></li>