diff --git a/static/js/admin.js b/static/js/admin.js index 0c8508ba67..4a8c7b3027 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -59,6 +59,7 @@ exports.build_page = function () { realm_user_group_edit_policy: page_params.realm_user_group_edit_policy, USER_GROUP_EDIT_POLICY_MEMBERS: 1, realm_private_message_policy: page_params.realm_private_message_policy, + realm_wildcard_mention_policy: page_params.realm_wildcard_mention_policy, realm_name_changes_disabled: page_params.realm_name_changes_disabled, realm_email_changes_disabled: page_params.realm_email_changes_disabled, realm_avatar_changes_disabled: page_params.realm_avatar_changes_disabled, diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.js index ff32476212..347838cb21 100644 --- a/static/js/server_events_dispatch.js +++ b/static/js/server_events_dispatch.js @@ -143,6 +143,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) { emails_restricted_to_domains: noop, video_chat_provider: compose.update_video_chat_button_display, waiting_period_threshold: noop, + wildcard_mention_policy: noop, }; if ( event.op === "update" && diff --git a/static/js/settings_config.js b/static/js/settings_config.js index 9f01bc9a68..d08d1b7783 100644 --- a/static/js/settings_config.js +++ b/static/js/settings_config.js @@ -137,6 +137,43 @@ exports.private_message_policy_values = { }, }; +exports.wildcard_mention_policy_values = { + by_everyone: { + order: 1, + code: 1, + description: i18n.t("Admins, members and guests"), + }, + by_members: { + order: 2, + code: 2, + description: i18n.t("Admins and members"), + }, + by_full_members: { + order: 3, + code: 3, + description: i18n.t("Admins and full members"), + }, + // Until we add stream administrators, we mislabel this choice + // (which we intend to be the long-term default) as "Admins only" + // and don't offer the long-term "Admins only" option. + by_stream_admins_only: { + order: 4, + code: 4, + // description: i18n.t("Organization and stream admins"), + description: i18n.t("Admins only"), + }, + // by_admins_only: { + // order: 5, + // code: 5, + // description: i18n.t("Admins only"), + // }, + nobody: { + order: 6, + code: 6, + description: i18n.t("Nobody"), + }, +}; + const time_limit_dropdown_values = new Map([ [ "any_time", diff --git a/static/js/settings_org.js b/static/js/settings_org.js index bb515a3395..79f33df646 100644 --- a/static/js/settings_org.js +++ b/static/js/settings_org.js @@ -87,6 +87,9 @@ exports.get_organization_settings_options = () => { options.private_message_policy_values = exports.get_sorted_options_list( settings_config.private_message_policy_values, ); + options.wildcard_mention_policy_values = exports.get_sorted_options_list( + settings_config.wildcard_mention_policy_values, + ); return options; }; @@ -203,6 +206,7 @@ const simple_dropdown_properties = [ "realm_private_message_policy", "realm_add_emoji_by_admins_only", "realm_user_invite_restriction", + "realm_wildcard_mention_policy", ]; function set_property_dropdown_value(property_name) { diff --git a/static/styles/settings.css b/static/styles/settings.css index 9bfef5e41f..f91d2e2aa4 100644 --- a/static/styles/settings.css +++ b/static/styles/settings.css @@ -1543,7 +1543,8 @@ body:not(.night-mode) #settings_page .custom_user_field .datepicker { #id_realm_invite_to_stream_policy, #id_realm_org_join_restrictions, #id_realm_bot_creation_policy, -#id_realm_user_invite_restriction { +#id_realm_user_invite_restriction, +#id_realm_wildcard_mention_policy { width: 100%; } diff --git a/static/templates/settings/organization_permissions_admin.hbs b/static/templates/settings/organization_permissions_admin.hbs index b686be8375..17f560f8f2 100644 --- a/static/templates/settings/organization_permissions_admin.hbs +++ b/static/templates/settings/organization_permissions_admin.hbs @@ -150,6 +150,13 @@ {{> dropdown_options_widget option_values=private_message_policy_values}} + +