diff --git a/web/src/admin.js b/web/src/admin.js index 28014c466d..95649f9803 100644 --- a/web/src/admin.js +++ b/web/src/admin.js @@ -21,7 +21,6 @@ import * as settings_sections from "./settings_sections"; import * as settings_toggle from "./settings_toggle"; import * as settings_users from "./settings_users"; import {current_user, realm} from "./state_data"; -import * as user_groups from "./user_groups"; const admin_settings_label = { // Organization profile @@ -182,9 +181,6 @@ export function build_page() { realm_invite_required: realm.realm_invite_required, can_create_user_groups: settings_data.user_can_create_user_groups(), policy_values: settings_config.common_policy_values, - realm_can_add_custom_emoji_group_name: user_groups.get_user_group_from_id( - realm.realm_can_add_custom_emoji_group, - ).name, ...settings_org.get_organization_settings_options(), demote_inactive_streams_values: settings_config.demote_inactive_streams_values, web_mark_read_on_scroll_policy_values: diff --git a/web/src/settings_emoji.ts b/web/src/settings_emoji.ts index 9237603744..4fab99a473 100644 --- a/web/src/settings_emoji.ts +++ b/web/src/settings_emoji.ts @@ -6,7 +6,6 @@ import render_confirm_deactivate_custom_emoji from "../templates/confirm_dialog/ import emoji_settings_warning_modal from "../templates/confirm_dialog/confirm_emoji_settings_warning.hbs"; import render_add_emoji from "../templates/settings/add_emoji.hbs"; import render_admin_emoji_list from "../templates/settings/admin_emoji_list.hbs"; -import render_settings_emoji_settings_tip from "../templates/settings/emoji_settings_tip.hbs"; import * as channel from "./channel"; import * as confirm_dialog from "./confirm_dialog"; @@ -19,10 +18,9 @@ import * as loading from "./loading"; import * as people from "./people"; import * as scroll_util from "./scroll_util"; import * as settings_data from "./settings_data"; -import {current_user, realm} from "./state_data"; +import {current_user} from "./state_data"; import * as ui_report from "./ui_report"; import * as upload_widget from "./upload_widget"; -import * as user_groups from "./user_groups"; import * as util from "./util"; const meta = { @@ -44,12 +42,6 @@ function can_delete_emoji(emoji: ServerEmoji): boolean { } export function update_custom_emoji_ui(): void { - const rendered_tip = render_settings_emoji_settings_tip({ - realm_can_add_custom_emoji_group_name: user_groups.get_user_group_from_id( - realm.realm_can_add_custom_emoji_group, - ).name, - }); - $("#emoji-settings").find(".emoji-settings-tip-container").html(rendered_tip); if (!settings_data.user_can_add_custom_emoji()) { $(".add-emoji-text").hide(); $("#add-custom-emoji-button").hide(); @@ -58,11 +50,7 @@ export function update_custom_emoji_ui(): void { } else { $(".add-emoji-text").show(); $("#add-custom-emoji-button").show(); - if (current_user.is_admin) { - $("#emoji-settings .emoji-settings-tip-container").show(); - } else { - $("#emoji-settings .emoji-settings-tip-container").hide(); - } + $("#emoji-settings .emoji-settings-tip-container").hide(); $(".org-settings-list li[data-section='emoji-settings'] .locked").hide(); } diff --git a/web/templates/settings/emoji_settings_admin.hbs b/web/templates/settings/emoji_settings_admin.hbs index c8c6839a7d..c184972190 100644 --- a/web/templates/settings/emoji_settings_admin.hbs +++ b/web/templates/settings/emoji_settings_admin.hbs @@ -1,6 +1,6 @@
-
- {{> emoji_settings_tip}} +
+
{{t "You do not have permission to add custom emoji."}}

{{t "Add extra emoji for members of the {realm_name} organization." }} diff --git a/web/templates/settings/emoji_settings_tip.hbs b/web/templates/settings/emoji_settings_tip.hbs deleted file mode 100644 index ce999169a5..0000000000 --- a/web/templates/settings/emoji_settings_tip.hbs +++ /dev/null @@ -1,11 +0,0 @@ -{{#if is_guest}} -

{{t "Guests cannot edit custom emoji." }}
-{{else if (eq realm_can_add_custom_emoji_group_name "role:administrators") }} -
{{t "This organization is configured so that only administrators can add custom emoji." }}
-{{else if (eq realm_can_add_custom_emoji_group_name "role:moderators")}} -
{{t 'This organization is configured so that administrators and moderators can add custom emoji.'}}
-{{else if (eq realm_can_add_custom_emoji_group_name "role:fullmembers")}} -
{{t 'This organization is configured so that full members can add custom emoji.'}}
-{{else}} -
{{t "This organization is configured so that any member of this organization can add custom emoji." }}
-{{/if}}