mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	user_profile: Show manage profile tab for admin's own profile.
Previouly admins did not see "Manage user" tab in their own profile modal. This commit updates it to show the "Manage user" tab to admins in their own profile modal as well. Fixes part of #34830.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							30c6b35b95
						
					
				
				
					commit
					9813f11abf
				
			@@ -638,11 +638,11 @@ export function show_user_profile(user: User, default_tab_key = "profile-tab"):
 | 
			
		||||
        user_group_picker_pill.get_user_groups_allowed_to_add_members().length > 0 &&
 | 
			
		||||
        people.is_person_active(user.user_id);
 | 
			
		||||
    // We currently have the main UI for editing your own profile in
 | 
			
		||||
    // settings, so can_manage_profile is artificially false for those.
 | 
			
		||||
    // settings for non-admins, so can_manage_profile is artificially
 | 
			
		||||
    // false for those.
 | 
			
		||||
    const can_manage_profile =
 | 
			
		||||
        (people.can_admin_user(user) || current_user.is_admin) &&
 | 
			
		||||
        !user.is_system_bot &&
 | 
			
		||||
        !people.is_my_user_id(user.user_id);
 | 
			
		||||
        (current_user.is_admin || (user.is_bot && people.can_admin_user(user))) &&
 | 
			
		||||
        !user.is_system_bot;
 | 
			
		||||
    const args: Record<string, unknown> = {
 | 
			
		||||
        can_manage_profile,
 | 
			
		||||
        date_joined: timerender.get_localized_date_or_time_for_format(
 | 
			
		||||
 
 | 
			
		||||
@@ -22,8 +22,7 @@
 | 
			
		||||
                        {{> components/icon_button custom_classes="copy-link-to-user-profile tippy-zulip-delayed-tooltip" icon="link-alt" intent="neutral" data-tippy-content=(t "Copy link to profile") aria-label=(t "Copy link to profile") }}
 | 
			
		||||
                        {{#if is_me}}
 | 
			
		||||
                            {{> components/icon_button custom_classes="user-profile-manage-own-edit-button tippy-zulip-delayed-tooltip" icon="edit" intent="neutral" data-tippy-content=(t "Edit profile") aria-label=(t "Edit profile") }}
 | 
			
		||||
                        {{/if}}
 | 
			
		||||
                        {{#if can_manage_profile}}
 | 
			
		||||
                        {{else if can_manage_profile}}
 | 
			
		||||
                            {{#if is_bot}}
 | 
			
		||||
                                {{> components/icon_button custom_classes="user-profile-manage-others-edit-button tippy-zulip-delayed-tooltip" icon="edit" intent="neutral" data-tippy-content=(t "Manage bot") aria-label=(t "Manage bot") }}
 | 
			
		||||
                            {{else}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user