user_card_popover: Redesign user card popover for unknown user.

This commit extends the user card popover redesign to the case where
the guest is not allowed access to view some of the other users'
profiles due to a change in the
"Who can view all other users in the organization" permission.

Fixes #27338.
This commit is contained in:
Sayam Samal 2024-07-02 05:16:47 +05:30 committed by Tim Abbott
parent 9bd8a0c72c
commit eb5bef8ff5
2 changed files with 19 additions and 10 deletions

View File

@ -290,9 +290,11 @@ function show_user_card_popover(
let args;
if (user.is_inaccessible_user) {
const sent_by_url = hash_util.by_sender_url(user.email);
const user_avatar = people.small_avatar_url_for_person(user);
args = {
user_id: user.user_id,
sent_by_url,
user_avatar,
};
popover_html = render_user_card_popover_for_unknown_user(args);
} else {

View File

@ -1,13 +1,20 @@
<div class="user-card-popover-title no-auto-hide-right-sidebar-overlay"></div>
<div class="user-card-popover-content no-auto-hide-right-sidebar-overlay">
<ul class="nav nav-list user-card-popover-actions" id="user_card_popover" data-user-id="{{user_id}}">
<li class="popover_user_name_row">
<b class="user_full_name" data-tippy-content="{{t 'Unknown user' }}">{{t "Unknown user" }}</b>
</li>
<hr/>
<li>
<a href="{{ sent_by_url }}" class="narrow_to_messages_sent">
<i class="fa fa-paper-plane" aria-hidden="true"></i> {{t "View messages sent" }}
<div class="popover-menu user-card-popover-actions no-auto-hide-right-sidebar-overlay" id="user_card_popover" data-simplebar data-simplebar-tab-index="-1">
<div class="popover-menu-user-header">
<div class="popover-menu-user-avatar-container">
<img class="popover-menu-user-avatar" src="{{user_avatar}}" />
</div>
<div class="popover-menu-user-info">
<div class="popover-menu-user-full-name" data-tippy-content="{{t 'Unknown user' }}">
{{t 'Unknown user' }}
</div>
</div>
</div>
<ul role="menu" class="popover-menu-list" data-user-id="{{user_id}}">
<li role="separator" class="popover-menu-separator hidden-for-spectators"></li>
<li role="none" class="popover-menu-list-item link-item">
<a role="menuitem" href="{{ sent_by_url }}" class="narrow_to_messages_sent popover-menu-link hidden-for-spectators" tabindex="0">
<i class="popover-menu-icon zulip-icon zulip-icon-message-square" aria-hidden="true"></i>
<span class="popover-menu-label">{{t "View messages sent" }}</span>
</a>
</li>
</ul>