Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Add UI for realm-level default of enter_sends settings.

Sahil Batraba1fe7799628
diff --git a/static/js/settings_config.ts b/static/js/settings_config.ts
index 764ff7e6973..dca63854717 100644
--- a/static/js/settings_config.ts
+++ b/static/js/settings_config.ts
@@ -411,6 +411,7 @@ export const realm_user_settings_defaults_labels = {
}),
realm_presence_enabled: $t({defaultMessage: "Display availability to other users when online"}),
+ realm_enter_sends: $t({defaultMessage: "Enter sends when composing a message"}),
};
// NOTIFICATIONS
diff --git a/static/js/settings_realm_user_settings_defaults.js b/static/js/settings_realm_user_settings_defaults.js
index f9289ca6ab0..75f0d2f55c7 100644
--- a/static/js/settings_realm_user_settings_defaults.js
+++ b/static/js/settings_realm_user_settings_defaults.js
@@ -36,5 +36,18 @@ export function set_up() {
);
});
+ container.find(".enter_sends").on("change", (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+
+ const data = {enter_sends: container.find(".enter_sends").prop("checked")};
+ settings_ui.do_settings_change(
+ channel.patch,
+ "/json/realm/user_settings_defaults",
+ data,
+ container.find(".other-setting-status").expectOne(),
+ );
+ });
+
maybe_disable_widgets();
}
diff --git a/static/templates/settings/organization_user_settings_defaults.hbs b/static/templates/settings/organization_user_settings_defaults.hbs
index a90576848e0..5b3c7395dcd 100644
--- a/static/templates/settings/organization_user_settings_defaults.hbs
+++ b/static/templates/settings/organization_user_settings_defaults.hbs
@@ -16,4 +16,14 @@
help_link="/help/status-and-availability"
prefix="realm_"}}
</div>
+
+ <div class="form-horizontal" class="other_settings">
+ <h3 class="inline-block">{{t "Other settings" }}</h3>
+ <div class="alert-notification other-setting-status"></div>
+ {{> settings_checkbox
+ setting_name="enter_sends"
+ is_checked=settings_object.enter_sends
+ label=settings_label.realm_enter_sends
+ prefix="realm_"}}
+ </div>
</div>
diff --git a/tools/lib/capitalization.py b/tools/lib/capitalization.py
index 1ca60ee6741..1f1ae139e72 100644
--- a/tools/lib/capitalization.py
+++ b/tools/lib/capitalization.py
@@ -118,6 +118,7 @@ IGNORED_PHRASES = [
# SPECIAL CASES
# Enter is usually capitalized
r"Press Enter to send",
+ r"Send message on pressing Enter",
# Because topics usually are lower-case, this would look weird if it were capitalized
r"more topics",
# For consistency with "more topics"