mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	settings_org: Add frontend to change wildcard_mention_policy.
We add dropdown for wildcard_mention_policy in organization permissions page.
This commit is contained in:
		@@ -59,6 +59,7 @@ exports.build_page = function () {
 | 
				
			|||||||
        realm_user_group_edit_policy: page_params.realm_user_group_edit_policy,
 | 
					        realm_user_group_edit_policy: page_params.realm_user_group_edit_policy,
 | 
				
			||||||
        USER_GROUP_EDIT_POLICY_MEMBERS: 1,
 | 
					        USER_GROUP_EDIT_POLICY_MEMBERS: 1,
 | 
				
			||||||
        realm_private_message_policy: page_params.realm_private_message_policy,
 | 
					        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_name_changes_disabled: page_params.realm_name_changes_disabled,
 | 
				
			||||||
        realm_email_changes_disabled: page_params.realm_email_changes_disabled,
 | 
					        realm_email_changes_disabled: page_params.realm_email_changes_disabled,
 | 
				
			||||||
        realm_avatar_changes_disabled: page_params.realm_avatar_changes_disabled,
 | 
					        realm_avatar_changes_disabled: page_params.realm_avatar_changes_disabled,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -143,6 +143,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
 | 
				
			|||||||
                emails_restricted_to_domains: noop,
 | 
					                emails_restricted_to_domains: noop,
 | 
				
			||||||
                video_chat_provider: compose.update_video_chat_button_display,
 | 
					                video_chat_provider: compose.update_video_chat_button_display,
 | 
				
			||||||
                waiting_period_threshold: noop,
 | 
					                waiting_period_threshold: noop,
 | 
				
			||||||
 | 
					                wildcard_mention_policy: noop,
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            if (
 | 
					            if (
 | 
				
			||||||
                event.op === "update" &&
 | 
					                event.op === "update" &&
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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([
 | 
					const time_limit_dropdown_values = new Map([
 | 
				
			||||||
    [
 | 
					    [
 | 
				
			||||||
        "any_time",
 | 
					        "any_time",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -87,6 +87,9 @@ exports.get_organization_settings_options = () => {
 | 
				
			|||||||
    options.private_message_policy_values = exports.get_sorted_options_list(
 | 
					    options.private_message_policy_values = exports.get_sorted_options_list(
 | 
				
			||||||
        settings_config.private_message_policy_values,
 | 
					        settings_config.private_message_policy_values,
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					    options.wildcard_mention_policy_values = exports.get_sorted_options_list(
 | 
				
			||||||
 | 
					        settings_config.wildcard_mention_policy_values,
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
    return options;
 | 
					    return options;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -203,6 +206,7 @@ const simple_dropdown_properties = [
 | 
				
			|||||||
    "realm_private_message_policy",
 | 
					    "realm_private_message_policy",
 | 
				
			||||||
    "realm_add_emoji_by_admins_only",
 | 
					    "realm_add_emoji_by_admins_only",
 | 
				
			||||||
    "realm_user_invite_restriction",
 | 
					    "realm_user_invite_restriction",
 | 
				
			||||||
 | 
					    "realm_wildcard_mention_policy",
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function set_property_dropdown_value(property_name) {
 | 
					function set_property_dropdown_value(property_name) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1543,7 +1543,8 @@ body:not(.night-mode) #settings_page .custom_user_field .datepicker {
 | 
				
			|||||||
#id_realm_invite_to_stream_policy,
 | 
					#id_realm_invite_to_stream_policy,
 | 
				
			||||||
#id_realm_org_join_restrictions,
 | 
					#id_realm_org_join_restrictions,
 | 
				
			||||||
#id_realm_bot_creation_policy,
 | 
					#id_realm_bot_creation_policy,
 | 
				
			||||||
#id_realm_user_invite_restriction {
 | 
					#id_realm_user_invite_restriction,
 | 
				
			||||||
 | 
					#id_realm_wildcard_mention_policy {
 | 
				
			||||||
    width: 100%;
 | 
					    width: 100%;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -150,6 +150,13 @@
 | 
				
			|||||||
                        {{> dropdown_options_widget option_values=private_message_policy_values}}
 | 
					                        {{> dropdown_options_widget option_values=private_message_policy_values}}
 | 
				
			||||||
                    </select>
 | 
					                    </select>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                <div class="input-group">
 | 
				
			||||||
 | 
					                    <label for="realm_wildcard_mention_policy" class="dropdown-title">{{t "Who can use wildcard mentions in large streams" }}</label>
 | 
				
			||||||
 | 
					                    <select name="realm_wildcard_mention_policy" id="id_realm_wildcard_mention_policy" class="prop-element" data-setting-widget-type="number">
 | 
				
			||||||
 | 
					                        {{> dropdown_options_widget option_values=wildcard_mention_policy_values}}
 | 
				
			||||||
 | 
					                    </select>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </form>
 | 
					    </form>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,8 +49,38 @@ notification. Silent mentions start with `@_` instead of `@`.
 | 
				
			|||||||
## Mention everyone on a stream
 | 
					## Mention everyone on a stream
 | 
				
			||||||
 | 
					
 | 
				
			||||||
You can mention everyone on a stream with the `@**all**` mention. Use
 | 
					You can mention everyone on a stream with the `@**all**` mention. Use
 | 
				
			||||||
sparingly!  Note that this will not notify anyone who has muted the
 | 
					sparingly! Used improperly, wildcard mentions can be annoying.
 | 
				
			||||||
stream, and users can disable receiving email/push notifications for
 | 
					
 | 
				
			||||||
these wildcard mentions, either
 | 
					Note that this will not notify anyone who has muted the stream, and
 | 
				
			||||||
 | 
					users can disable receiving email/push notifications for these
 | 
				
			||||||
 | 
					wildcard mentions, either
 | 
				
			||||||
[globally](/help/pm-mention-alert-notifications) or for [individual
 | 
					[globally](/help/pm-mention-alert-notifications) or for [individual
 | 
				
			||||||
streams](/help/stream-notifications).
 | 
					streams](/help/stream-notifications).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Restrictions on wildcard mentions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Organization administrators can set a policy for which users are
 | 
				
			||||||
 | 
					allowed to use wildcard mentions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Zulip allows anyone to use wildcard mentions in streams with at most
 | 
				
			||||||
 | 
					15 subscribers.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Organizations administrators can configure a policy for which classes
 | 
				
			||||||
 | 
					of users are allowed to use wildcard mentions in streams with more
 | 
				
			||||||
 | 
					than 15 subscribers.  The default allows only organization
 | 
				
			||||||
 | 
					administrators to use wildcard mentions in large streams.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Users permitted to use wildcard mentions by the organization's policy
 | 
				
			||||||
 | 
					are warned that wildcard mentions result in everyone receiving email
 | 
				
			||||||
 | 
					and mobile push notifications.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{start_tabs}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{settings_tab|organization-permissions}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					2. Under **Organization permissions**, configure
 | 
				
			||||||
 | 
					   **Who can use wildcard mentions in large streams**.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{!save-changes.md!}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{end_tabs}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,8 @@ Zulip has many features designed to simplify moderation:
 | 
				
			|||||||
  new users can take disruptive actions.
 | 
					  new users can take disruptive actions.
 | 
				
			||||||
* [Restrict email visibility](/help/restrict-visibility-of-email-addresses)
 | 
					* [Restrict email visibility](/help/restrict-visibility-of-email-addresses)
 | 
				
			||||||
  to reduce the likelihood of off-platform spam.
 | 
					  to reduce the likelihood of off-platform spam.
 | 
				
			||||||
 | 
					* [Restrict wildcard mentions](/help/mention-a-user-or-group#restrictions-on-wildcard-mentions)
 | 
				
			||||||
 | 
					  so only moderators can mention everyone in your organization.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Response
 | 
					## Response
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user