From ca6e0ce8c82de113c6a6f877a3e4806ed0d9bb33 Mon Sep 17 00:00:00 2001 From: tnmkr Date: Tue, 20 Feb 2024 20:42:46 +0530 Subject: [PATCH] user_profile: Add links to group settings. This commit adds links to open group settings from "User groups" tab of user profile. These links are not shown to guests as they cannot view `#groups` urls. Fixes #25214. --- web/src/user_profile.js | 6 ++++++ web/templates/user_group_list_item.hbs | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/web/src/user_profile.js b/web/src/user_profile.js index 6e35749781..58ff671146 100644 --- a/web/src/user_profile.js +++ b/web/src/user_profile.js @@ -204,6 +204,8 @@ function format_user_group_list_item_html(group) { return render_user_group_list_item({ group_id: group.id, name: group.name, + group_edit_url: hash_util.group_edit_url(group), + is_guest: current_user.is_guest, }); } @@ -953,6 +955,10 @@ export function initialize() { hide_user_profile(); }); + $("body").on("click", "#user-profile-modal .group_list_item_link", () => { + hide_user_profile(); + }); + $("body").on("input", "#user-profile-streams-tab .stream-search", () => { const $input = $("#user-profile-streams-tab .stream-search"); if ($input.val().trim().length > 0) { diff --git a/web/templates/user_group_list_item.hbs b/web/templates/user_group_list_item.hbs index 9973a58c7c..b9378b5f26 100644 --- a/web/templates/user_group_list_item.hbs +++ b/web/templates/user_group_list_item.hbs @@ -1,5 +1,9 @@ - {{name}} + {{#if is_guest}} + {{name}} + {{else}} + {{name}} + {{/if}}