From 9813f11abfbe1044eb434d2a3a079ed4184a8d82 Mon Sep 17 00:00:00 2001 From: whilstsomebody Date: Thu, 14 Aug 2025 17:52:08 +0530 Subject: [PATCH] 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. --- web/src/user_profile.ts | 8 ++++---- web/templates/user_profile_modal.hbs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts index 6bc7bb4b54..72b6964351 100644 --- a/web/src/user_profile.ts +++ b/web/src/user_profile.ts @@ -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 = { can_manage_profile, date_joined: timerender.get_localized_date_or_time_for_format( diff --git a/web/templates/user_profile_modal.hbs b/web/templates/user_profile_modal.hbs index f15f9ef5fe..a3af256e72 100644 --- a/web/templates/user_profile_modal.hbs +++ b/web/templates/user_profile_modal.hbs @@ -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}}