diff --git a/frontend_tests/node_tests/dispatch.js b/frontend_tests/node_tests/dispatch.js index 792759a79b..1be02e65cb 100644 --- a/frontend_tests/node_tests/dispatch.js +++ b/frontend_tests/node_tests/dispatch.js @@ -384,6 +384,9 @@ run_test("realm settings", ({override}) => { event = event_fixtures.realm__update__invite_to_realm_policy; test_realm_integer(event, "realm_invite_to_realm_policy"); + event = event_fixtures.realm__update__want_advertise_in_communities_directory; + test_realm_boolean(event, "realm_want_advertise_in_communities_directory"); + event = event_fixtures.realm__update__name; test_electron_dispatch(event, (key, val) => { diff --git a/frontend_tests/node_tests/lib/events.js b/frontend_tests/node_tests/lib/events.js index 4168509c8a..f552baae93 100644 --- a/frontend_tests/node_tests/lib/events.js +++ b/frontend_tests/node_tests/lib/events.js @@ -356,6 +356,13 @@ exports.fixtures = { value: 41, }, + realm__update__want_advertise_in_communities_directory: { + type: "realm", + op: "update", + property: "want_advertise_in_communities_directory", + value: false, + }, + realm__update_dict__default: { type: "realm", op: "update_dict", diff --git a/static/js/admin.js b/static/js/admin.js index 5e1dd389d6..a19e5d0ceb 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -17,6 +17,10 @@ import * as settings_sections from "./settings_sections"; import * as settings_toggle from "./settings_toggle"; const admin_settings_label = { + // Organization profile + realm_want_advertise_in_communities_directory: $t({ + defaultMessage: "Advertise organization in the Zulip communities directory", + }), // Organization settings realm_allow_edit_history: $t({defaultMessage: "Enable message edit history"}), realm_mandatory_topics: $t({defaultMessage: "Require topics in stream messages"}), @@ -164,6 +168,10 @@ export function build_page() { can_sort_by_email: settings_data.show_email(), realm_push_notifications_enabled: page_params.realm_push_notifications_enabled, realm_org_type_values: settings_org.get_org_type_dropdown_options(), + realm_want_advertise_in_communities_directory: + page_params.realm_want_advertise_in_communities_directory, + disable_want_advertise_in_communities_directory: + !page_params.server_web_public_streams_enabled, }; if (options.realm_logo_source !== "D" && options.realm_night_logo_source === "D") { diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.js index 5ff2601852..707d158ef6 100644 --- a/static/js/server_events_dispatch.js +++ b/static/js/server_events_dispatch.js @@ -224,6 +224,7 @@ export function dispatch_normal_event(event) { video_chat_provider: compose.update_video_chat_button_display, giphy_rating: giphy.update_giphy_rating, waiting_period_threshold: noop, + want_advertise_in_communities_directory: noop, wildcard_mention_policy: noop, }; switch (event.op) { diff --git a/static/templates/settings/organization_profile_admin.hbs b/static/templates/settings/organization_profile_admin.hbs index 66c141925b..735cc6077b 100644 --- a/static/templates/settings/organization_profile_admin.hbs +++ b/static/templates/settings/organization_profile_admin.hbs @@ -25,6 +25,13 @@ {{> dropdown_options_widget option_values=realm_org_type_values}} + {{> settings_checkbox + setting_name="realm_want_advertise_in_communities_directory" + prefix="id_" + is_checked=realm_want_advertise_in_communities_directory + is_disabled=disable_want_advertise_in_communities_directory + label=admin_settings_label.realm_want_advertise_in_communities_directory + help_link="/help/communities-directory"}}