settings: Rename class of notification settings elements.

We rename class of notification settings except checkboxes
by prefixing them with 'setting_' for clarity.

We do not change class of checkboxes because settings_checkbox
is used by other templates also and if we only change class
of those using notification_settings_checkboxes then live
update code will break and will need to add separate condition
for differentiating between which partial template is used.
This commit is contained in:
Sahil Batra 2021-08-10 16:26:28 +05:30 committed by Tim Abbott
parent d05730a199
commit fef825d56f
4 changed files with 9 additions and 9 deletions

View File

@ -365,7 +365,7 @@ async function test_notifications_section(page: Page): Promise<void> {
// At the beginning, "PMs, mentions, and alerts"(checkbox name=enable_sounds) audio will be on
// and "Streams"(checkbox name=enable_stream_audible_notifications) audio will be off by default.
const notification_sound_enabled = ".notification_sound:enabled";
const notification_sound_enabled = ".setting_notification_sound:enabled";
await page.waitForSelector(notification_sound_enabled, {visible: true});
await common.fill_form(page, ".notification-settings-form", {
@ -382,7 +382,7 @@ async function test_notifications_section(page: Page): Promise<void> {
all audio notifications. But this seems flaky in tests.
TODO: Find the right fix and enable this.
const notification_sound_disabled = ".notification_sound:disabled";
const notification_sound_disabled = ".setting_notification_sound:disabled";
await page.waitForSelector(notification_sound_disabled);
*/
}

View File

@ -51,7 +51,7 @@ function change_notification_setting(setting, value, status_element) {
}
function update_desktop_icon_count_display() {
$("#user-notification-settings .desktop_icon_count_display").val(
$("#user-notification-settings .setting_desktop_icon_count_display").val(
user_settings.desktop_icon_count_display,
);
unread_ui.update_unread_counts();
@ -107,7 +107,7 @@ export function set_up() {
}
});
const notification_sound_dropdown = container.find(".notification_sound");
const notification_sound_dropdown = container.find(".setting_notification_sound");
notification_sound_dropdown.val(user_settings.notification_sound);
container.find(".enable_sounds, .enable_stream_audible_notifications").on("change", () => {

View File

@ -128,7 +128,7 @@ h3 .fa-question-circle-o {
padding: 0 20px;
}
.notification_sound,
.setting_notification_sound,
.play_notification_sound {
display: inline;
margin-right: 4px;
@ -139,7 +139,7 @@ h3 .fa-question-circle-o {
}
}
.notification_sound {
.setting_notification_sound {
text-transform: capitalize;
}
@ -1561,7 +1561,7 @@ body:not(.night-mode) #settings_page .custom_user_field .datepicker {
}
/* These have enough space for "Admins and full members" in German. */
.desktop_icon_count_display,
.setting_desktop_icon_count_display,
#id_realm_waiting_period_setting,
#id_realm_create_stream_policy,
#id_realm_invite_to_stream_policy,

View File

@ -66,7 +66,7 @@
</label>
<div class="input-group {{#unless enable_sound_select}}control-label-disabled{{/unless}}">
<select name="notification_sound" class="notification_sound" data-setting-widget-type="string"
<select name="notification_sound" class="setting_notification_sound" data-setting-widget-type="string"
{{#unless enable_sound_select}}
disabled
{{/unless}}>
@ -82,7 +82,7 @@
<div class="input-group">
<label for="desktop_icon_count_display" class="dropdown-title">{{ settings_label.desktop_icon_count_display }}</label>
<select name="desktop_icon_count_display" class="desktop_icon_count_display prop-element"
<select name="desktop_icon_count_display" class="setting_desktop_icon_count_display prop-element"
data-setting-widget-type="number">
{{> dropdown_options_widget option_values=desktop_icon_count_display_values}}
</select>