settings: Rename admin-realm-time-limit-input class.

This commit renames admin-realm-time-limit-input class to
time-limit-custom-input such that there is no confusion
when it is used for stream settings also.
This commit is contained in:
Sahil Batra 2023-01-16 15:16:45 +05:30 committed by Tim Abbott
parent 565d133985
commit ba1188db05
5 changed files with 12 additions and 12 deletions

View File

@ -551,14 +551,14 @@ test("set_up", ({override, override_rewire}) => {
const $custom_edit_limit_input = $("#id_realm_message_content_edit_limit_minutes");
$stub_message_content_edit_limit_parent.set_find_results(
".admin-realm-time-limit-input",
".time-limit-custom-input",
$custom_edit_limit_input,
);
$custom_edit_limit_input.attr("id", "id_realm_message_content_edit_limit_minutes");
const $custom_delete_limit_input = $("#id_realm_message_content_delete_limit_minutes");
$stub_message_content_delete_limit_parent.set_find_results(
".admin-realm-time-limit-input",
".time-limit-custom-input",
$custom_delete_limit_input,
);
$custom_delete_limit_input.attr("id", "id_realm_message_content_delete_limit_minutes");
@ -586,7 +586,7 @@ test("set_up", ({override, override_rewire}) => {
$stub_realm_waiting_period_threshold_parent,
);
$stub_realm_waiting_period_threshold_parent.set_find_results(
".admin-realm-time-limit-input",
".time-limit-custom-input",
$realm_waiting_period_threshold_custom_input,
);
$realm_waiting_period_threshold_custom_input.attr(

View File

@ -281,7 +281,7 @@ function update_custom_value_input(property_name) {
const $dropdown_elem = $(`#id_${CSS.escape(property_name)}`);
const custom_input_elem_id = $dropdown_elem
.parent()
.find(".admin-realm-time-limit-input")
.find(".time-limit-custom-input")
.attr("id");
const show_custom_limit_input = $dropdown_elem.val() === "custom_period";
@ -312,7 +312,7 @@ function set_time_limit_setting(property_name) {
const $custom_input = $(`#id_${CSS.escape(property_name)}`)
.parent()
.find(".admin-realm-time-limit-input");
.find(".time-limit-custom-input");
$custom_input.val(get_realm_time_limits_in_minutes(property_name));
change_element_block_display_property(
@ -838,7 +838,7 @@ function get_time_limit_setting_value($input_elem, for_api_data = true) {
return Number.parseInt(select_elem_val, 10);
}
const $custom_input_elem = $input_elem.parent().find(".admin-realm-time-limit-input");
const $custom_input_elem = $input_elem.parent().find(".time-limit-custom-input");
if ($custom_input_elem.val().length === 0) {
// This handles the case where the initial setting value is "Any time" and then
// dropdown is changed to "Custom" where the input box is empty initially and
@ -965,7 +965,7 @@ function enable_or_disable_save_button($subsection_elem) {
let disable_save_btn = false;
for (const setting_elem of time_limit_settings) {
const dropdown_elem_val = $(setting_elem).find("select").val();
const $custom_input_elem = $(setting_elem).find(".admin-realm-time-limit-input");
const $custom_input_elem = $(setting_elem).find(".time-limit-custom-input");
const custom_input_elem_val = Number.parseInt(Number($custom_input_elem.val()), 10);
disable_save_btn =

View File

@ -1173,7 +1173,7 @@ $option_title_width: 180px;
overflow: hidden;
border-radius: 4px;
.admin-realm-time-limit-input {
.time-limit-custom-input {
width: 5ch;
text-align: right;
}

View File

@ -140,7 +140,7 @@
</label>
<input type="text"
name="email_notification_batching_period_edit_minutes"
class="email_notification_batching_period_edit_minutes admin-realm-time-limit-input"
class="email_notification_batching_period_edit_minutes time-limit-custom-input"
data-setting-widget-type="time-limit"
autocomplete="off"
id="{{prefix}}email_notification_batching_period_edit_minutes"/>

View File

@ -48,7 +48,7 @@
<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"
class="time-limit-custom-input"
value="{{ realm_waiting_period_threshold }}"/>
</div>
</div>
@ -171,7 +171,7 @@
</label>
<input type="text" id="id_realm_message_content_edit_limit_minutes"
name="realm_message_content_edit_limit_minutes"
class="admin-realm-time-limit-input"
class="time-limit-custom-input"
autocomplete="off"
value="{{ realm_message_content_edit_limit_minutes }}"
{{#unless realm_allow_message_editing}}disabled{{/unless}}/>
@ -238,7 +238,7 @@
</label>
<input type="text" id="id_realm_message_content_delete_limit_minutes"
name="realm_message_content_delete_limit_minutes"
class="admin-realm-time-limit-input"
class="time-limit-custom-input"
autocomplete="off"
value="{{ realm_message_content_delete_limit_minutes }}"/>
</div>