diff --git a/frontend_tests/node_tests/settings_org.js b/frontend_tests/node_tests/settings_org.js index b488d2f0c6..5e8a51f902 100644 --- a/frontend_tests/node_tests/settings_org.js +++ b/frontend_tests/node_tests/settings_org.js @@ -761,6 +761,7 @@ run_test('set_up', () => { $("#id_realm_message_content_delete_limit_minutes").set_parent($.create('')); $("#message_content_in_email_notifications_label").set_parent($.create('')); $("#enable_digest_emails_label").set_parent($.create('')); + $("#id_realm_digest_weekday").set_parent($.create('')); $("#id_realm_msg_edit_limit_setting").change = noop; $('#id_realm_msg_delete_limit_setting').change = noop; const waiting_period_parent_elem = $.create('waiting-period-parent-stub'); diff --git a/static/js/settings_org.js b/static/js/settings_org.js index f202e27d6e..7e7494c650 100644 --- a/static/js/settings_org.js +++ b/static/js/settings_org.js @@ -282,6 +282,14 @@ function set_enable_digest_emails_visibility() { } } +function set_digest_emails_weekday_visibility() { + if (page_params.realm_digest_emails_enabled) { + $('#id_realm_digest_weekday').parent().show(); + } else { + $('#id_realm_digest_weekday').parent().hide(); + } +} + exports.populate_realm_domains = function (realm_domains) { if (!meta.loaded) { return; @@ -430,6 +438,7 @@ function update_dependent_subsettings(property_name) { set_message_content_in_email_notifications_visiblity(); } else if (property_name === 'realm_digest_emails_enabled') { set_enable_digest_emails_visibility(); + set_digest_emails_weekday_visibility(); } } @@ -593,6 +602,7 @@ exports.build_page = function () { set_user_invite_restriction_dropdown(); set_message_content_in_email_notifications_visiblity(); set_enable_digest_emails_visibility(); + set_digest_emails_weekday_visibility(); function check_property_changed(elem) { elem = $(elem);