diff --git a/web/src/settings_notifications.ts b/web/src/settings_notifications.ts index fab3f49414..06ac5896e2 100644 --- a/web/src/settings_notifications.ts +++ b/web/src/settings_notifications.ts @@ -15,6 +15,7 @@ import * as dropdown_widget from "./dropdown_widget.ts"; import {$t, $t_html} from "./i18n.ts"; import * as message_notifications from "./message_notifications.ts"; import {page_params} from "./page_params.ts"; +import * as settings_banner from "./settings_banner.ts"; import * as settings_components from "./settings_components.ts"; import * as settings_config from "./settings_config.ts"; import type {SettingsPanel} from "./settings_preferences.ts"; @@ -56,6 +57,22 @@ const DESKTOP_NOTIFICATIONS_BANNER: banners.Banner = { custom_classes: "desktop-setting-notifications", }; +const MOBILE_PUSH_NOTIFICATION_BANNER: banners.Banner = { + intent: "warning", + label: $t({ + defaultMessage: "Mobile push notifications are not enabled on this server.", + }), + buttons: [ + { + label: $t({defaultMessage: "Learn more"}), + custom_classes: "banner-external-link", + attention: "quiet", + }, + ], + custom_classes: "mobile-push-notifications-banner", + close_button: false, +}; + function rerender_ui(): void { const $unmatched_streams_table = $("#stream-specific-notify-table"); if ($unmatched_streams_table.length === 0) { @@ -392,6 +409,11 @@ export function set_up(settings_panel: SettingsPanel): void { }); set_enable_digest_emails_visibility($container, for_realm_settings); + settings_banner.set_up_banner( + $(".mobile-push-notifications-banner-container"), + MOBILE_PUSH_NOTIFICATION_BANNER, + "/help/mobile-notifications#enabling-push-notifications-for-self-hosted-servers", + ); if (for_realm_settings) { // For the realm-level defaults page, we use the common diff --git a/web/styles/app_components.css b/web/styles/app_components.css index 24513caa34..80d1532cb9 100644 --- a/web/styles/app_components.css +++ b/web/styles/app_components.css @@ -555,6 +555,7 @@ input.settings_text_input { } .organization-upgrade-banner, +.mobile-push-notifications-banner, .admin-permissions-banner, .desktop-setting-notifications { margin-bottom: 10px; diff --git a/web/templates/settings/notification_settings.hbs b/web/templates/settings/notification_settings.hbs index 8dd27a9968..8016f33ae7 100644 --- a/web/templates/settings/notification_settings.hbs +++ b/web/templates/settings/notification_settings.hbs @@ -186,11 +186,7 @@ {{> settings_save_discard_widget section_name="mobile-message-settings" show_only_indicator=(not for_realm_settings) }} {{#unless realm_push_notifications_enabled}} -
- {{#tr}} - Mobile push notifications are not enabled on this server. Learn more - {{#*inline "z-link"}}{{> @partial-block}}{{/inline}} - {{/tr}} + {{/unless}}