Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
settings: Rename IDs of waiting-period-threshold setting elements.
Sahil Batrabc5f0e881e11
diff --git a/docs/tutorials/new-feature-tutorial.md b/docs/tutorials/new-feature-tutorial.mdindex c4605f0254c..0cebbc6c7b5 100644--- a/docs/tutorials/new-feature-tutorial.md+++ b/docs/tutorials/new-feature-tutorial.md@@ -597,8 +597,8 @@ manually handle such situations in a couple key functions:- `settings_org.update_dependent_subsettings`: This handles settingswhose value and state depend on other elements. For example,- `realm_waiting_period_threshold` is only shown for with the right- state of `realm_waiting_period_setting`.+ `realm_waiting_period_threshold_custom_input` is only shown for with+ the right state of `realm_waiting_period_threshold`.Finally, update `server_events_dispatch.js` to handle related events coming fromthe server. There is an object, `realm_settings`, in the function@@ -646,9 +646,9 @@ Here are few important cases you should consider when testing your changes:- If your setting is dependent on another setting, carefully checkthat both are properly synchronized. For example, the input element- for `realm_waiting_period_threshold` is shown only when we have- selected the custom time limit option in the- `realm_waiting_period_setting` dropdown.+ for `realm_waiting_period_threshold_custom_input` is shown only when+ we have selected the custom time limit option in the+ `realm_waiting_period_threshold` dropdown.- Do some manual testing for the real-time synchronization of inputelements across the browsers and just like "Discard changes" button,diff --git a/frontend_tests/puppeteer_tests/admin.ts b/frontend_tests/puppeteer_tests/admin.tsindex 20124da36d4..e42d58c6508 100644--- a/frontend_tests/puppeteer_tests/admin.ts+++ b/frontend_tests/puppeteer_tests/admin.ts@@ -154,18 +154,18 @@ async function submit_joining_organization_change(page: Page): Promise<void> {async function test_set_new_user_threshold_to_three_days(page: Page): Promise<void> {console.log("Test setting new user threshold to three days.");- await page.waitForSelector("#id_realm_waiting_period_setting", {visible: true});- await page.select("#id_realm_waiting_period_setting", "three_days");+ await page.waitForSelector("#id_realm_waiting_period_threshold", {visible: true});+ await page.select("#id_realm_waiting_period_threshold", "three_days");await submit_joining_organization_change(page);}async function test_set_new_user_threshold_to_N_days(page: Page): Promise<void> {console.log("Test setting new user threshold to three days.");- await page.waitForSelector("#id_realm_waiting_period_setting", {visible: true});- await page.select("#id_realm_waiting_period_setting", "custom_period");+ await page.waitForSelector("#id_realm_waiting_period_threshold", {visible: true});+ await page.select("#id_realm_waiting_period_threshold", "custom_period");const N = "10";- await common.clear_and_type(page, "#id_realm_waiting_period_threshold", N);+ await common.clear_and_type(page, "#id_realm_waiting_period_threshold_custom_input", N);await submit_joining_organization_change(page);}diff --git a/static/js/settings_org.js b/static/js/settings_org.jsindex 865268f248c..0ce7b305af7 100644--- a/static/js/settings_org.js+++ b/static/js/settings_org.js@@ -168,7 +168,7 @@ function get_property_value(property_name, for_realm_default_settings, sub) {return sub[property_name];}- if (property_name === "realm_waiting_period_setting") {+ if (property_name === "realm_waiting_period_threshold") {if (page_params.realm_waiting_period_threshold === 0) {return "none";}@@ -246,10 +246,10 @@ export function change_element_block_display_property(elem_id, show_element) {}function set_realm_waiting_period_dropdown() {- const value = get_property_value("realm_waiting_period_setting");- $("#id_realm_waiting_period_setting").val(value);+ const value = get_property_value("realm_waiting_period_threshold");+ $("#id_realm_waiting_period_threshold").val(value);change_element_block_display_property(- "id_realm_waiting_period_threshold",+ "id_realm_waiting_period_threshold_custom_input",value === "custom_period",);}@@ -1084,7 +1084,7 @@ export function register_save_discard_widget_handlers(break;}- const waiting_period_threshold = $("#id_realm_waiting_period_setting").val();+ const waiting_period_threshold = $("#id_realm_waiting_period_threshold").val();switch (waiting_period_threshold) {case "none":data.waiting_period_threshold = 0;@@ -1094,7 +1094,7 @@ export function register_save_discard_widget_handlers(break;case "custom_period":data.waiting_period_threshold = $(- "#id_realm_waiting_period_threshold",+ "#id_realm_waiting_period_threshold_custom_input",).val();break;}@@ -1190,7 +1190,7 @@ export function build_page() {);});- $("#id_realm_waiting_period_setting").on("change", function () {+ $("#id_realm_waiting_period_threshold").on("change", function () {const waiting_period_threshold = this.value;change_element_block_display_property("id_realm_waiting_period_threshold",diff --git a/static/styles/settings.css b/static/styles/settings.cssindex a334a09575e..f18b16d6117 100644--- a/static/styles/settings.css+++ b/static/styles/settings.css@@ -1440,7 +1440,7 @@ $option_title_width: 180px;/* These have enough space for all the options in German. */.setting_desktop_icon_count_display,-#id_realm_waiting_period_setting,+#id_realm_waiting_period_threshold,#id_realm_create_public_stream_policy,#id_realm_create_private_stream_policy,#id_realm_invite_to_stream_policy,diff --git a/static/templates/settings/organization_permissions_admin.hbs b/static/templates/settings/organization_permissions_admin.hbsindex 03397e6d60c..0a20ec0e425 100644--- a/static/templates/settings/organization_permissions_admin.hbs+++ b/static/templates/settings/organization_permissions_admin.hbs@@ -36,20 +36,20 @@</div></div><div class="input-group">- <label for="realm_waiting_period_setting" class="dropdown-title">+ <label for="realm_waiting_period_threshold" class="dropdown-title">{{t "Waiting period before new members turn into full members" }}{{> ../help_link_widget link="/help/restrict-permissions-of-new-members" }}</label>- <select name="realm_waiting_period_setting" id="id_realm_waiting_period_setting" class="prop-element">+ <select name="realm_waiting_period_threshold" id="id_realm_waiting_period_threshold" class="prop-element"><option value="none">{{t "None" }}</option><option value="three_days">{{t "3 days" }}</option><option value="custom_period">{{t "Custom" }}</option></select>{{!-- This setting is hidden unless `custom_period` --}}<div class="dependent-settings-block">- <label for="id_realm_waiting_period_threshold" class="inline-block">{{t "Waiting period (days)" }}:</label>- <input type="text" id="id_realm_waiting_period_threshold"- name="realm_waiting_period_threshold"+ <label for="id_realm_waiting_period_threshold_custom_input" class="inline-block">{{t "Waiting period (days)" }}:</label>+ <input type="text" id="id_realm_waiting_period_threshold_custom_input"+ name="realm_waiting_period_threshold_custom_input"class="admin-realm-time-limit-input prop-element"value="{{ realm_waiting_period_threshold }}"/></div>