diff --git a/web/src/realm_user_settings_defaults.ts b/web/src/realm_user_settings_defaults.ts index b0961449bc..ac95efeda3 100644 --- a/web/src/realm_user_settings_defaults.ts +++ b/web/src/realm_user_settings_defaults.ts @@ -21,6 +21,11 @@ export type RealmDefaultSettings = { enable_stream_desktop_notifications: boolean; enable_stream_email_notifications: boolean; enable_stream_push_notifications: boolean; + enable_followed_topic_desktop_notifications: boolean; + enable_followed_topic_audible_notifications: boolean; + enable_followed_topic_push_notifications: boolean; + enable_followed_topic_email_notifications: boolean; + enable_followed_topic_wildcard_mentions_notify: boolean; enter_sends: boolean; escape_navigates_to_default_view: boolean; fluid_layout_width: boolean; diff --git a/web/src/settings.js b/web/src/settings.js index 1d3d0a7130..531b80b968 100644 --- a/web/src/settings.js +++ b/web/src/settings.js @@ -80,6 +80,7 @@ export function build_page() { full_name: people.my_full_name(), date_joined_text: get_parsed_date_of_joining(), page_params, + development: page_params.development_environment, enable_sound_select: user_settings.enable_sounds || user_settings.enable_stream_audible_notifications, zuliprc: "zuliprc", diff --git a/web/src/settings_config.ts b/web/src/settings_config.ts index 1f25171f22..0fead18e4d 100644 --- a/web/src/settings_config.ts +++ b/web/src/settings_config.ts @@ -5,6 +5,7 @@ import {page_params} from "./page_params"; import type {RealmDefaultSettings} from "./realm_user_settings_defaults"; import type {StreamSpecificNotificationSettings} from "./sub_store"; import type { + FollowedTopicNotificationSettings, PmNotificationSettings, StreamNotificationSettings, UserSettings, @@ -649,6 +650,14 @@ export const pm_mention_notification_settings: (keyof PmNotificationSettings)[] "enable_offline_email_notifications", ]; +export const followed_topic_notification_settings: (keyof FollowedTopicNotificationSettings)[] = [ + "enable_followed_topic_desktop_notifications", + "enable_followed_topic_audible_notifications", + "enable_followed_topic_push_notifications", + "enable_followed_topic_email_notifications", + "enable_followed_topic_wildcard_mentions_notify", +]; + const desktop_notification_settings = ["pm_content_in_desktop_notifications"]; const mobile_notification_settings = ["enable_online_push_notifications"]; @@ -716,6 +725,7 @@ const other_notification_settings = [ ]; export const all_notification_settings = [ + ...followed_topic_notification_settings, ...other_notification_settings, ...pm_mention_notification_settings, ...stream_notification_settings, @@ -790,6 +800,13 @@ export const all_notifications = (settings_object: Settings): AllNotifications = settings_object, ), }, + { + label: $t({defaultMessage: "Followed topics"}), + notification_settings: get_notifications_table_row_data( + followed_topic_notification_settings, + settings_object, + ), + }, ], settings: { desktop_notification_settings, diff --git a/web/src/user_settings.ts b/web/src/user_settings.ts index a6dbb61cf5..1f09d78821 100644 --- a/web/src/user_settings.ts +++ b/web/src/user_settings.ts @@ -13,7 +13,17 @@ export type PmNotificationSettings = { enable_offline_email_notifications: boolean; }; -export type UserSettings = (StreamNotificationSettings & PmNotificationSettings) & { +export type FollowedTopicNotificationSettings = { + enable_followed_topic_desktop_notifications: boolean; + enable_followed_topic_audible_notifications: boolean; + enable_followed_topic_push_notifications: boolean; + enable_followed_topic_email_notifications: boolean; + enable_followed_topic_wildcard_mentions_notify: boolean; +}; + +export type UserSettings = (StreamNotificationSettings & + PmNotificationSettings & + FollowedTopicNotificationSettings) & { color_scheme: number; default_language: string; default_view: string; diff --git a/web/templates/settings/notification_settings.hbs b/web/templates/settings/notification_settings.hbs index 266216393d..7583a772cc 100644 --- a/web/templates/settings/notification_settings.hbs +++ b/web/templates/settings/notification_settings.hbs @@ -28,16 +28,18 @@
{{#each general_settings}} -