mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
stream_settings: Refactor code for stream message retention setting.
This commit refactors the code for stream message retentions setting to match it with the other time limit settings - - Rename the "Retain for N days after posting" option to "Custom". We also update the option value from "retain_for_period" to "custom_period". - Change the label of custom input to "Retention period (days)" as it is more descriptive and clear than just labelling it as "N". - The custom input is also moved to be below the dropdown and also has left margin as with the other time limit realm settings.
This commit is contained in:
@@ -226,7 +226,7 @@ function create_stream() {
|
||||
let message_retention_selection = $(
|
||||
"#stream_creation_form select[name=stream_message_retention_setting]",
|
||||
).val();
|
||||
if (message_retention_selection === "retain_for_period") {
|
||||
if (message_retention_selection === "custom_period") {
|
||||
message_retention_selection = Number.parseInt(
|
||||
$("#stream_creation_form input[name=stream-message-retention-days]").val(),
|
||||
10,
|
||||
@@ -323,7 +323,7 @@ export function show_new_stream_modal() {
|
||||
|
||||
// Add listener to .show stream-message-retention-days-input that we've hidden above
|
||||
$("#stream_creation_form .stream_message_retention_setting").on("change", (e) => {
|
||||
if (e.target.value === "retain_for_period") {
|
||||
if (e.target.value === "custom_period") {
|
||||
$("#stream_creation_form .stream-message-retention-days-input").show();
|
||||
} else {
|
||||
$("#stream_creation_form .stream-message-retention-days-input").hide();
|
||||
|
||||
Reference in New Issue
Block a user