Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

user_profile: Show manage profile tab for admin's own profile.

whilstsomebody9813f11abfbe
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index 6bc7bb4b54f..72b69643516 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<string, unknown> = {
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 f15f9ef5fe3..a3af256e725 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}}