2021-03-11 05:43:45 +01:00
|
|
|
import $ from "jquery";
|
2024-05-30 21:51:29 +02:00
|
|
|
import * as tippy from "tippy.js";
|
2021-03-11 05:43:45 +01:00
|
|
|
|
2021-04-24 20:39:08 +02:00
|
|
|
import render_admin_tab from "../templates/settings/admin_tab.hbs";
|
2021-02-28 01:23:35 +01:00
|
|
|
import render_settings_organization_settings_tip from "../templates/settings/organization_settings_tip.hbs";
|
2020-08-01 03:43:15 +02:00
|
|
|
|
2024-11-12 03:59:37 +01:00
|
|
|
import * as bot_data from "./bot_data.ts";
|
|
|
|
import * as demo_organizations_ui from "./demo_organizations_ui.ts";
|
|
|
|
import {$t, get_language_name, language_list} from "./i18n.ts";
|
|
|
|
import {page_params} from "./page_params.ts";
|
|
|
|
import * as people from "./people.ts";
|
|
|
|
import {realm_user_settings_defaults} from "./realm_user_settings_defaults.ts";
|
|
|
|
import * as settings from "./settings.js";
|
|
|
|
import * as settings_bots from "./settings_bots.ts";
|
|
|
|
import * as settings_components from "./settings_components.ts";
|
|
|
|
import * as settings_config from "./settings_config.ts";
|
|
|
|
import * as settings_data from "./settings_data.ts";
|
|
|
|
import * as settings_invites from "./settings_invites.ts";
|
|
|
|
import * as settings_org from "./settings_org.ts";
|
|
|
|
import * as settings_panel_menu from "./settings_panel_menu.js";
|
|
|
|
import * as settings_sections from "./settings_sections.js";
|
|
|
|
import * as settings_toggle from "./settings_toggle.js";
|
|
|
|
import * as settings_users from "./settings_users.ts";
|
|
|
|
import {current_user, realm} from "./state_data.ts";
|
2020-07-24 06:02:07 +02:00
|
|
|
|
2019-11-02 00:06:25 +01:00
|
|
|
const admin_settings_label = {
|
2022-04-22 18:45:30 +02:00
|
|
|
// Organization profile
|
|
|
|
realm_want_advertise_in_communities_directory: $t({
|
|
|
|
defaultMessage: "Advertise organization in the Zulip communities directory",
|
|
|
|
}),
|
2018-05-30 19:03:39 +02:00
|
|
|
// Organization settings
|
2021-04-13 06:51:54 +02:00
|
|
|
realm_allow_edit_history: $t({defaultMessage: "Enable message edit history"}),
|
2024-04-18 15:20:36 +02:00
|
|
|
realm_mandatory_topics: $t({defaultMessage: "Require topics in channel messages"}),
|
|
|
|
realm_new_stream_announcements_stream: $t({defaultMessage: "New channel announcements"}),
|
2024-02-07 17:11:43 +01:00
|
|
|
realm_signup_announcements_stream: $t({defaultMessage: "New user announcements"}),
|
2024-01-26 14:45:37 +01:00
|
|
|
realm_zulip_update_announcements_stream: $t({defaultMessage: "Zulip update announcements"}),
|
2023-11-18 17:17:09 +01:00
|
|
|
realm_inline_image_preview: $t({
|
|
|
|
defaultMessage: "Show previews of uploaded and linked images and videos",
|
|
|
|
}),
|
2021-04-13 06:51:54 +02:00
|
|
|
realm_inline_url_embed_preview: $t({defaultMessage: "Show previews of linked websites"}),
|
|
|
|
realm_send_welcome_emails: $t({defaultMessage: "Send emails introducing Zulip to new users"}),
|
|
|
|
realm_message_content_allowed_in_email_notifications: $t({
|
2021-04-20 23:27:25 +02:00
|
|
|
defaultMessage: "Allow message content in message notification emails",
|
2021-04-13 06:51:54 +02:00
|
|
|
}),
|
2021-10-03 14:16:07 +02:00
|
|
|
realm_enable_spectator_access: $t({
|
2024-04-18 15:20:36 +02:00
|
|
|
defaultMessage: "Allow creating web-public channels (visible to anyone on the Internet)",
|
2021-10-03 14:16:07 +02:00
|
|
|
}),
|
2021-04-13 06:51:54 +02:00
|
|
|
realm_digest_emails_enabled: $t({
|
|
|
|
defaultMessage: "Send weekly digest emails to inactive users",
|
|
|
|
}),
|
2022-03-16 00:08:41 +01:00
|
|
|
realm_default_code_block_language: $t({defaultMessage: "Default language for code blocks"}),
|
2018-05-30 19:03:39 +02:00
|
|
|
|
|
|
|
// Organization permissions
|
2024-03-11 20:02:05 +01:00
|
|
|
realm_require_unique_names: $t({defaultMessage: "Require unique names"}),
|
2021-04-13 06:51:54 +02:00
|
|
|
realm_name_changes_disabled: $t({defaultMessage: "Prevent users from changing their name"}),
|
|
|
|
realm_email_changes_disabled: $t({
|
|
|
|
defaultMessage: "Prevent users from changing their email address",
|
|
|
|
}),
|
|
|
|
realm_avatar_changes_disabled: $t({defaultMessage: "Prevent users from changing their avatar"}),
|
2021-05-23 21:40:20 +02:00
|
|
|
realm_invite_required: $t({
|
|
|
|
defaultMessage: "Invitations are required for joining this organization",
|
|
|
|
}),
|
2022-06-27 22:34:52 +02:00
|
|
|
realm_default_language: $t({
|
|
|
|
defaultMessage: "Language for automated messages and invitation emails",
|
|
|
|
}),
|
2022-04-12 09:56:58 +02:00
|
|
|
realm_allow_message_editing: $t({defaultMessage: "Allow message editing"}),
|
2022-09-24 12:34:41 +02:00
|
|
|
realm_enable_read_receipts: $t({defaultMessage: "Enable read receipts"}),
|
|
|
|
realm_enable_read_receipts_parens_text: $t({
|
|
|
|
defaultMessage: "Users can always disable their personal read receipts.",
|
|
|
|
}),
|
2023-09-13 13:17:00 +02:00
|
|
|
realm_enable_guest_user_indicator: $t({
|
|
|
|
defaultMessage: "Display “(guest)” after names of guest users",
|
|
|
|
}),
|
2018-05-30 19:03:39 +02:00
|
|
|
};
|
|
|
|
|
settings: Call insert_tip_box from admin.build_page and move it to admin.js.
The organization_settings_tip is not visible if organization settings
overlay is opened with any section other than organization profile,
settings and permissions. This is because insert_tip_box is called from
settings_org.build_page, which is called only when we open any of the
above three sections after opening the overlay and not others.
We should call insert_tip_box function from admin.build_page instead
of settings_org.build_page because we need to insert the admin tips
each time the organization settings overlay is opened, irrespective
of the section which opens first.
The function insert_tip_box is moved to admin.js from settings_org.js,
because settings_org.js file handles the organization profile,
settings and permissions page only, while we display the tips in many
other sections including bots, custom emoji, etc.
Thus, it makes sense to move insert_tip_box function to admin.js, which
renders the complete organization settings overlay using render_admin_tab.
2020-06-28 16:27:54 +02:00
|
|
|
function insert_tip_box() {
|
2024-02-13 02:08:16 +01:00
|
|
|
if (current_user.is_admin) {
|
settings: Call insert_tip_box from admin.build_page and move it to admin.js.
The organization_settings_tip is not visible if organization settings
overlay is opened with any section other than organization profile,
settings and permissions. This is because insert_tip_box is called from
settings_org.build_page, which is called only when we open any of the
above three sections after opening the overlay and not others.
We should call insert_tip_box function from admin.build_page instead
of settings_org.build_page because we need to insert the admin tips
each time the organization settings overlay is opened, irrespective
of the section which opens first.
The function insert_tip_box is moved to admin.js from settings_org.js,
because settings_org.js file handles the organization profile,
settings and permissions page only, while we display the tips in many
other sections including bots, custom emoji, etc.
Thus, it makes sense to move insert_tip_box function to admin.js, which
renders the complete organization settings overlay using render_admin_tab.
2020-06-28 16:27:54 +02:00
|
|
|
return;
|
|
|
|
}
|
2024-04-04 00:18:17 +02:00
|
|
|
const tip_box_html = render_settings_organization_settings_tip({
|
|
|
|
is_admin: current_user.is_admin,
|
|
|
|
});
|
2020-07-15 00:34:28 +02:00
|
|
|
$(".organization-box")
|
2024-05-30 11:28:49 +02:00
|
|
|
.find(".settings-section, .user-settings-section")
|
settings: Call insert_tip_box from admin.build_page and move it to admin.js.
The organization_settings_tip is not visible if organization settings
overlay is opened with any section other than organization profile,
settings and permissions. This is because insert_tip_box is called from
settings_org.build_page, which is called only when we open any of the
above three sections after opening the overlay and not others.
We should call insert_tip_box function from admin.build_page instead
of settings_org.build_page because we need to insert the admin tips
each time the organization settings overlay is opened, irrespective
of the section which opens first.
The function insert_tip_box is moved to admin.js from settings_org.js,
because settings_org.js file handles the organization profile,
settings and permissions page only, while we display the tips in many
other sections including bots, custom emoji, etc.
Thus, it makes sense to move insert_tip_box function to admin.js, which
renders the complete organization settings overlay using render_admin_tab.
2020-06-28 16:27:54 +02:00
|
|
|
.not("#emoji-settings")
|
|
|
|
.not("#organization-auth-settings")
|
2022-07-28 23:54:59 +02:00
|
|
|
.not("#admin-bot-list")
|
|
|
|
.not("#admin-invites-list")
|
2024-05-30 11:28:49 +02:00
|
|
|
.not("#admin-user-list")
|
2024-04-04 00:18:17 +02:00
|
|
|
.prepend($(tip_box_html));
|
settings: Call insert_tip_box from admin.build_page and move it to admin.js.
The organization_settings_tip is not visible if organization settings
overlay is opened with any section other than organization profile,
settings and permissions. This is because insert_tip_box is called from
settings_org.build_page, which is called only when we open any of the
above three sections after opening the overlay and not others.
We should call insert_tip_box function from admin.build_page instead
of settings_org.build_page because we need to insert the admin tips
each time the organization settings overlay is opened, irrespective
of the section which opens first.
The function insert_tip_box is moved to admin.js from settings_org.js,
because settings_org.js file handles the organization profile,
settings and permissions page only, while we display the tips in many
other sections including bots, custom emoji, etc.
Thus, it makes sense to move insert_tip_box function to admin.js, which
renders the complete organization settings overlay using render_admin_tab.
2020-06-28 16:27:54 +02:00
|
|
|
}
|
|
|
|
|
2021-08-26 21:03:27 +02:00
|
|
|
function get_realm_level_notification_settings(options) {
|
|
|
|
const all_notifications_settings = settings_config.all_notifications(
|
|
|
|
realm_user_settings_defaults,
|
|
|
|
);
|
|
|
|
|
2021-09-28 10:03:43 +02:00
|
|
|
// We remove enable_marketing_emails and enable_login_emails
|
|
|
|
// setting from all_notification_settings, since there are no
|
|
|
|
// realm-level defaults for these setting.
|
|
|
|
all_notifications_settings.settings.other_email_settings = ["enable_digest_emails"];
|
2021-08-26 21:03:27 +02:00
|
|
|
|
|
|
|
options.general_settings = all_notifications_settings.general_settings;
|
|
|
|
options.notification_settings = all_notifications_settings.settings;
|
2024-10-20 21:21:20 +02:00
|
|
|
options.disabled_notification_settings =
|
|
|
|
all_notifications_settings.disabled_notification_settings;
|
2021-08-26 21:03:27 +02:00
|
|
|
}
|
|
|
|
|
2021-02-28 01:23:35 +01:00
|
|
|
export function build_page() {
|
2019-11-02 00:06:25 +01:00
|
|
|
const options = {
|
2024-02-13 02:08:24 +01:00
|
|
|
custom_profile_field_types: realm.custom_profile_field_types,
|
2024-02-13 02:08:16 +01:00
|
|
|
full_name: current_user.full_name,
|
2024-10-24 08:10:56 +02:00
|
|
|
profile_picture: people.small_avatar_url_for_person(current_user),
|
2024-02-13 02:08:24 +01:00
|
|
|
realm_name: realm.realm_name,
|
|
|
|
realm_org_type: realm.realm_org_type,
|
|
|
|
realm_available_video_chat_providers: realm.realm_available_video_chat_providers,
|
|
|
|
server_jitsi_server_url: realm.server_jitsi_server_url,
|
|
|
|
giphy_rating_options: realm.giphy_rating_options,
|
|
|
|
giphy_api_key_empty: realm.giphy_api_key === "",
|
|
|
|
realm_description: realm.realm_description,
|
|
|
|
realm_inline_image_preview: realm.realm_inline_image_preview,
|
|
|
|
server_inline_image_preview: realm.server_inline_image_preview,
|
|
|
|
realm_inline_url_embed_preview: realm.realm_inline_url_embed_preview,
|
|
|
|
server_inline_url_embed_preview: realm.server_inline_url_embed_preview,
|
|
|
|
realm_authentication_methods: realm.realm_authentication_methods,
|
|
|
|
realm_name_changes_disabled: realm.realm_name_changes_disabled,
|
2024-03-11 20:02:05 +01:00
|
|
|
realm_require_unique_names: realm.realm_require_unique_names,
|
2024-02-13 02:08:24 +01:00
|
|
|
realm_email_changes_disabled: realm.realm_email_changes_disabled,
|
|
|
|
realm_avatar_changes_disabled: realm.realm_avatar_changes_disabled,
|
2021-05-17 19:32:35 +02:00
|
|
|
can_add_emojis: settings_data.user_can_add_custom_emoji(),
|
2022-09-16 12:40:13 +02:00
|
|
|
can_create_new_bots: settings_bots.can_create_new_bots(),
|
2023-10-09 23:29:16 +02:00
|
|
|
realm_message_content_edit_limit_minutes:
|
|
|
|
settings_components.get_realm_time_limits_in_minutes(
|
|
|
|
"realm_message_content_edit_limit_seconds",
|
|
|
|
),
|
|
|
|
realm_message_content_delete_limit_minutes:
|
|
|
|
settings_components.get_realm_time_limits_in_minutes(
|
|
|
|
"realm_message_content_delete_limit_seconds",
|
|
|
|
),
|
2024-02-13 02:08:24 +01:00
|
|
|
realm_message_retention_days: realm.realm_message_retention_days,
|
|
|
|
realm_allow_edit_history: realm.realm_allow_edit_history,
|
|
|
|
realm_allow_message_editing: realm.realm_allow_message_editing,
|
2021-06-18 02:48:45 +02:00
|
|
|
language_list,
|
2024-02-13 02:08:24 +01:00
|
|
|
realm_default_language_name: get_language_name(realm.realm_default_language),
|
|
|
|
realm_default_language_code: realm.realm_default_language,
|
|
|
|
realm_waiting_period_threshold: realm.realm_waiting_period_threshold,
|
2024-02-07 12:13:02 +01:00
|
|
|
realm_new_stream_announcements_stream_id: realm.realm_new_stream_announcements_stream_id,
|
2024-02-07 17:11:43 +01:00
|
|
|
realm_signup_announcements_stream_id: realm.realm_signup_announcements_stream_id,
|
2024-01-26 14:45:37 +01:00
|
|
|
realm_zulip_update_announcements_stream_id:
|
|
|
|
realm.realm_zulip_update_announcements_stream_id,
|
2024-02-13 02:08:16 +01:00
|
|
|
is_admin: current_user.is_admin,
|
|
|
|
is_guest: current_user.is_guest,
|
|
|
|
is_owner: current_user.is_owner,
|
2020-06-17 07:43:53 +02:00
|
|
|
user_can_change_logo: settings_data.user_can_change_logo(),
|
2024-02-13 02:08:24 +01:00
|
|
|
realm_icon_source: realm.realm_icon_source,
|
|
|
|
realm_icon_url: realm.realm_icon_url,
|
|
|
|
realm_logo_source: realm.realm_logo_source,
|
|
|
|
realm_logo_url: realm.realm_logo_url,
|
|
|
|
realm_night_logo_source: realm.realm_night_logo_source,
|
|
|
|
realm_night_logo_url: realm.realm_night_logo_url,
|
|
|
|
realm_mandatory_topics: realm.realm_mandatory_topics,
|
|
|
|
realm_send_welcome_emails: realm.realm_send_welcome_emails,
|
2019-01-14 14:04:08 +01:00
|
|
|
realm_message_content_allowed_in_email_notifications:
|
2024-02-13 02:08:24 +01:00
|
|
|
realm.realm_message_content_allowed_in_email_notifications,
|
|
|
|
realm_enable_spectator_access: realm.realm_enable_spectator_access,
|
|
|
|
settings_send_digest_emails: realm.settings_send_digest_emails,
|
|
|
|
realm_digest_emails_enabled: realm.realm_digest_emails_enabled,
|
|
|
|
realm_digest_weekday: realm.realm_digest_weekday,
|
2018-08-03 22:52:21 +02:00
|
|
|
development: page_params.development_environment,
|
2024-02-13 02:08:24 +01:00
|
|
|
zulip_plan_is_not_limited: realm.zulip_plan_is_not_limited,
|
|
|
|
upgrade_text_for_wide_organization_logo: realm.upgrade_text_for_wide_organization_logo,
|
|
|
|
realm_default_external_accounts: realm.realm_default_external_accounts,
|
2020-12-22 00:37:36 +01:00
|
|
|
admin_settings_label,
|
|
|
|
msg_edit_limit_dropdown_values: settings_config.msg_edit_limit_dropdown_values,
|
|
|
|
msg_delete_limit_dropdown_values: settings_config.msg_delete_limit_dropdown_values,
|
2022-12-22 19:14:23 +01:00
|
|
|
msg_move_limit_dropdown_values: settings_config.msg_move_limit_dropdown_values,
|
2020-12-22 00:37:36 +01:00
|
|
|
bot_creation_policy_values: settings_bots.bot_creation_policy_values,
|
|
|
|
email_address_visibility_values: settings_config.email_address_visibility_values,
|
2022-12-12 18:21:08 +01:00
|
|
|
waiting_period_threshold_dropdown_values:
|
|
|
|
settings_config.waiting_period_threshold_dropdown_values,
|
2023-08-03 16:06:40 +02:00
|
|
|
can_create_multiuse_invite: settings_data.user_can_create_multiuse_invite(),
|
2023-06-26 23:38:08 +02:00
|
|
|
can_invite_users_by_email: settings_data.user_can_invite_users_by_email(),
|
2024-02-13 02:08:24 +01:00
|
|
|
realm_invite_required: realm.realm_invite_required,
|
2023-08-08 16:15:49 +02:00
|
|
|
can_create_user_groups: settings_data.user_can_create_user_groups(),
|
2021-06-03 15:47:03 +02:00
|
|
|
policy_values: settings_config.common_policy_values,
|
2020-12-22 00:37:36 +01:00
|
|
|
...settings_org.get_organization_settings_options(),
|
2021-08-17 14:43:29 +02:00
|
|
|
demote_inactive_streams_values: settings_config.demote_inactive_streams_values,
|
2023-03-08 02:27:45 +01:00
|
|
|
web_mark_read_on_scroll_policy_values:
|
|
|
|
settings_config.web_mark_read_on_scroll_policy_values,
|
2024-07-03 12:43:47 +02:00
|
|
|
web_channel_default_view_values: settings_config.web_channel_default_view_values,
|
2022-08-12 22:41:06 +02:00
|
|
|
user_list_style_values: settings_config.user_list_style_values,
|
2023-04-25 13:37:16 +02:00
|
|
|
web_stream_unreads_count_display_policy_values:
|
|
|
|
settings_config.web_stream_unreads_count_display_policy_values,
|
2024-07-21 15:23:56 +02:00
|
|
|
web_animate_image_previews_values: settings_config.web_animate_image_previews_values,
|
2021-08-17 14:43:29 +02:00
|
|
|
color_scheme_values: settings_config.color_scheme_values,
|
2023-10-23 09:02:57 +02:00
|
|
|
web_home_view_values: settings_config.web_home_view_values,
|
2021-08-17 14:43:29 +02:00
|
|
|
settings_object: realm_user_settings_defaults,
|
2024-07-11 08:39:46 +02:00
|
|
|
information_section_checkbox_group: settings_config.information_section_checkbox_group,
|
2024-03-06 17:25:31 +01:00
|
|
|
information_density_settings: settings_config.get_information_density_preferences(),
|
2024-07-11 07:51:19 +02:00
|
|
|
settings_render_only: settings_config.get_settings_render_only(),
|
2021-08-26 21:03:27 +02:00
|
|
|
settings_label: settings_config.realm_user_settings_defaults_labels,
|
|
|
|
desktop_icon_count_display_values: settings_config.desktop_icon_count_display_values,
|
|
|
|
enable_sound_select:
|
|
|
|
realm_user_settings_defaults.enable_sounds ||
|
|
|
|
realm_user_settings_defaults.enable_stream_audible_notifications,
|
|
|
|
email_notifications_batching_period_values:
|
|
|
|
settings_config.email_notifications_batching_period_values,
|
2023-01-14 20:36:37 +01:00
|
|
|
realm_name_in_email_notifications_policy_values:
|
|
|
|
settings_config.realm_name_in_email_notifications_policy_values,
|
2021-09-17 18:11:37 +02:00
|
|
|
twenty_four_hour_time_values: settings_config.twenty_four_hour_time_values,
|
2022-05-26 11:43:42 +02:00
|
|
|
disable_enable_spectator_access_setting:
|
2024-02-13 02:08:24 +01:00
|
|
|
!realm.server_web_public_streams_enabled || !realm.zulip_plan_is_not_limited,
|
|
|
|
realm_push_notifications_enabled: realm.realm_push_notifications_enabled,
|
2022-04-12 17:41:07 +02:00
|
|
|
realm_org_type_values: settings_org.get_org_type_dropdown_options(),
|
2022-04-22 18:45:30 +02:00
|
|
|
realm_want_advertise_in_communities_directory:
|
2024-02-13 02:08:24 +01:00
|
|
|
realm.realm_want_advertise_in_communities_directory,
|
|
|
|
disable_want_advertise_in_communities_directory: !realm.realm_push_notifications_enabled,
|
2022-06-01 16:52:40 +02:00
|
|
|
is_business_type_org:
|
2024-02-13 02:08:24 +01:00
|
|
|
realm.realm_org_type === settings_config.all_org_type_values.business.code,
|
|
|
|
realm_enable_read_receipts: realm.realm_enable_read_receipts,
|
2021-10-26 15:43:39 +02:00
|
|
|
allow_sorting_deactivated_users_list_by_email:
|
|
|
|
settings_users.allow_sorting_deactivated_users_list_by_email(),
|
2023-01-24 22:33:40 +01:00
|
|
|
has_bots: bot_data.get_all_bots_for_current_user().length > 0,
|
2023-01-20 18:29:34 +01:00
|
|
|
user_has_email_set: !settings_data.user_email_not_configured(),
|
2023-08-20 01:28:15 +02:00
|
|
|
automatically_follow_topics_policy_values:
|
|
|
|
settings_config.automatically_follow_or_unmute_topics_policy_values,
|
|
|
|
automatically_unmute_topics_in_muted_streams_policy_values:
|
|
|
|
settings_config.automatically_follow_or_unmute_topics_policy_values,
|
2024-02-13 02:08:24 +01:00
|
|
|
realm_enable_guest_user_indicator: realm.realm_enable_guest_user_indicator,
|
2024-04-05 19:11:54 +02:00
|
|
|
active_user_list_dropdown_widget_name: settings_users.active_user_list_dropdown_widget_name,
|
|
|
|
deactivated_user_list_dropdown_widget_name:
|
|
|
|
settings_users.deactivated_user_list_dropdown_widget_name,
|
2015-08-20 02:38:32 +02:00
|
|
|
};
|
2016-12-03 01:12:52 +01:00
|
|
|
|
2020-07-15 01:29:15 +02:00
|
|
|
if (options.realm_logo_source !== "D" && options.realm_night_logo_source === "D") {
|
2021-11-26 10:29:05 +01:00
|
|
|
// If no dark theme logo is specified but a light theme one is,
|
|
|
|
// use the light theme one. See also similar code in realm_logo.js.
|
2019-02-21 02:55:48 +01:00
|
|
|
options.realm_night_logo_url = options.realm_logo_url;
|
|
|
|
}
|
|
|
|
|
2021-05-19 20:56:53 +02:00
|
|
|
options.giphy_help_link = "/help/animated-gifs-from-giphy";
|
|
|
|
if (options.giphy_api_key_empty) {
|
|
|
|
options.giphy_help_link =
|
|
|
|
"https://zulip.readthedocs.io/en/latest/production/giphy-gif-integration.html";
|
|
|
|
}
|
|
|
|
|
2021-08-26 21:03:27 +02:00
|
|
|
get_realm_level_notification_settings(options);
|
|
|
|
|
2019-11-02 00:06:25 +01:00
|
|
|
const rendered_admin_tab = render_admin_tab(options);
|
2018-03-22 22:10:08 +01:00
|
|
|
$("#settings_content .organization-box").html(rendered_admin_tab);
|
2017-03-23 20:37:08 +01:00
|
|
|
$("#settings_content .alert").removeClass("show");
|
2014-01-27 21:48:23 +01:00
|
|
|
|
2023-03-03 14:14:01 +01:00
|
|
|
settings_bots.update_bot_settings_tip($("#admin-bot-settings-tip"), true);
|
2023-06-13 09:47:53 +02:00
|
|
|
settings_invites.update_invite_user_panel();
|
settings: Call insert_tip_box from admin.build_page and move it to admin.js.
The organization_settings_tip is not visible if organization settings
overlay is opened with any section other than organization profile,
settings and permissions. This is because insert_tip_box is called from
settings_org.build_page, which is called only when we open any of the
above three sections after opening the overlay and not others.
We should call insert_tip_box function from admin.build_page instead
of settings_org.build_page because we need to insert the admin tips
each time the organization settings overlay is opened, irrespective
of the section which opens first.
The function insert_tip_box is moved to admin.js from settings_org.js,
because settings_org.js file handles the organization profile,
settings and permissions page only, while we display the tips in many
other sections including bots, custom emoji, etc.
Thus, it makes sense to move insert_tip_box function to admin.js, which
renders the complete organization settings overlay using render_admin_tab.
2020-06-28 16:27:54 +02:00
|
|
|
insert_tip_box();
|
|
|
|
|
2024-02-13 02:08:24 +01:00
|
|
|
if (realm.demo_organization_scheduled_deletion_date && current_user.is_admin) {
|
2021-09-16 18:51:42 +02:00
|
|
|
demo_organizations_ui.insert_demo_organization_warning();
|
|
|
|
demo_organizations_ui.handle_demo_organization_conversion();
|
|
|
|
}
|
|
|
|
|
2024-02-13 02:08:24 +01:00
|
|
|
$("#id_realm_bot_creation_policy").val(realm.realm_bot_creation_policy);
|
2018-01-29 16:10:54 +01:00
|
|
|
|
2019-03-31 12:13:42 +02:00
|
|
|
$("#id_realm_digest_weekday").val(options.realm_digest_weekday);
|
2023-11-22 12:33:48 +01:00
|
|
|
|
2024-02-13 02:08:24 +01:00
|
|
|
const is_plan_plus = realm.realm_plan_type === 10;
|
|
|
|
const is_plan_self_hosted = realm.realm_plan_type === 1;
|
2024-02-13 02:08:16 +01:00
|
|
|
if (current_user.is_admin && !(is_plan_plus || is_plan_self_hosted)) {
|
2023-11-22 12:33:48 +01:00
|
|
|
$("#realm_can_access_all_users_group_widget").prop("disabled", true);
|
|
|
|
const opts = {
|
|
|
|
content: $t({
|
|
|
|
defaultMessage: "This feature is available on Zulip Cloud Plus. Upgrade to access.",
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
|
2024-05-30 21:51:29 +02:00
|
|
|
tippy.default($("#realm_can_access_all_users_group_widget_container")[0], opts);
|
2023-11-22 12:33:48 +01:00
|
|
|
}
|
2021-02-28 01:23:35 +01:00
|
|
|
}
|
2018-12-06 19:56:28 +01:00
|
|
|
|
2024-05-30 11:28:49 +02:00
|
|
|
export function launch(section, user_settings_tab) {
|
2018-12-08 19:28:26 +01:00
|
|
|
settings_sections.reset_sections();
|
2016-06-10 09:03:36 +02:00
|
|
|
|
2023-03-16 09:44:16 +01:00
|
|
|
settings.open_settings_overlay();
|
2024-05-30 11:16:13 +02:00
|
|
|
if (section !== "") {
|
|
|
|
settings_panel_menu.org_settings.set_current_tab(section);
|
|
|
|
}
|
2024-05-30 11:28:49 +02:00
|
|
|
if (section === "users") {
|
|
|
|
settings_panel_menu.org_settings.set_user_settings_tab(user_settings_tab);
|
|
|
|
}
|
2024-06-12 09:37:00 +02:00
|
|
|
settings_toggle.goto("organization");
|
2021-02-28 01:23:35 +01:00
|
|
|
}
|