Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
notification_settings: Add tooltip to checkboxes in the triggers table.
Sayam Samale2485b7ee8b4
diff --git a/web/src/settings_config.ts b/web/src/settings_config.tsindex 034e34ff125..d32622ec336 100644--- a/web/src/settings_config.ts+++ b/web/src/settings_config.ts@@ -771,6 +771,7 @@ type NotificationSettingCheckbox = {setting_name: string;is_disabled: boolean;is_checked: boolean;+ is_mobile_checkbox: boolean;};export function get_notifications_table_row_data(@@ -784,6 +785,7 @@ export function get_notifications_table_row_data(setting_name: "",is_disabled: true,is_checked: false,+ is_mobile_checkbox: false,};}@@ -796,9 +798,11 @@ export function get_notifications_table_row_data(setting_name,is_disabled: false,is_checked: checked,+ is_mobile_checkbox: false,};if (column === "mobile") {checkbox.is_disabled = !page_params.realm_push_notifications_enabled;+ checkbox.is_mobile_checkbox = true;}return checkbox;});diff --git a/web/templates/settings/notification_settings.hbs b/web/templates/settings/notification_settings.hbsindex 161485c06ba..a0a8802909d 100644--- a/web/templates/settings/notification_settings.hbs+++ b/web/templates/settings/notification_settings.hbs@@ -34,6 +34,7 @@setting_name=this.setting_nameis_checked=this.is_checkedis_disabled=this.is_disabled+ is_mobile_checkbox=this.is_mobile_checkboxprefix=../../prefix }}{{/each}}</tr>diff --git a/web/templates/settings/notification_settings_checkboxes.hbs b/web/templates/settings/notification_settings_checkboxes.hbsindex 841b6456cbf..7327c4f757a 100644--- a/web/templates/settings/notification_settings_checkboxes.hbs+++ b/web/templates/settings/notification_settings_checkboxes.hbs@@ -1,9 +1,11 @@<td>- <label class="checkbox">- <input type="checkbox" name="{{setting_name}}" id="{{prefix}}{{setting_name}}"- {{#if is_disabled}} disabled {{/if}}- {{#if is_checked}}checked="checked"{{/if}} data-setting-widget-type="boolean"- class="{{setting_name}}{{#unless is_disabled}} prop-element{{/unless}}"/>- <span></span>- </label>+ <span {{#if (and is_mobile_checkbox (not realm_push_notifications_enabled))}} class="tippy-zulip-tooltip" data-tooltip-template-id="mobile-push-notification-tooltip-template"{{/if}}>+ <label class="checkbox">+ <input type="checkbox" name="{{setting_name}}" id="{{prefix}}{{setting_name}}"+ {{#if is_disabled}} disabled {{/if}}+ {{#if is_checked}}checked="checked"{{/if}} data-setting-widget-type="boolean"+ class="{{setting_name}}{{#unless is_disabled}} prop-element{{/unless}}"/>+ <span></span>+ </label>+ </span></td>diff --git a/web/tests/settings_config.test.js b/web/tests/settings_config.test.jsindex ff613322b21..b5a197219af 100644--- a/web/tests/settings_config.test.js+++ b/web/tests/settings_config.test.js@@ -48,26 +48,31 @@ run_test("all_notifications", () => {{is_checked: false,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_stream_desktop_notifications",},{is_checked: true,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_stream_audible_notifications",},{is_checked: true,is_disabled: true,+ is_mobile_checkbox: true,setting_name: "enable_stream_push_notifications",},{is_checked: false,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_stream_email_notifications",},{is_checked: false,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "wildcard_mentions_notify",},],@@ -78,26 +83,31 @@ run_test("all_notifications", () => {{is_checked: false,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_desktop_notifications",},{is_checked: true,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_sounds",},{is_checked: false,is_disabled: true,+ is_mobile_checkbox: true,setting_name: "enable_offline_push_notifications",},{is_checked: true,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_offline_email_notifications",},{is_checked: false,is_disabled: true,+ is_mobile_checkbox: false,setting_name: "",},],@@ -108,26 +118,31 @@ run_test("all_notifications", () => {{is_checked: false,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_followed_topic_desktop_notifications",},{is_checked: true,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_followed_topic_audible_notifications",},{is_checked: false,is_disabled: true,+ is_mobile_checkbox: true,setting_name: "enable_followed_topic_push_notifications",},{is_checked: true,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_followed_topic_email_notifications",},{is_checked: false,is_disabled: false,+ is_mobile_checkbox: false,setting_name: "enable_followed_topic_wildcard_mentions_notify",},],