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.

user-groups: Define max_user_group_name_length in user_groups.ts.

Sahil Batra42fe2690e397
diff --git a/web/src/user_group_edit.ts b/web/src/user_group_edit.ts
index 216b4389eed..76d764575ad 100644
--- a/web/src/user_group_edit.ts
+++ b/web/src/user_group_edit.ts
@@ -658,11 +658,6 @@ export function open_group_edit_panel_for_row(group_row: HTMLElement): void {
show_group_settings(group);
}
-// Ideally this should be included in page params.
-// Like we have realm.max_stream_name_length` and
-// `realm.max_stream_description_length` for streams.
-export const max_user_group_name_length = 100;
-
export function set_up_click_handlers(): void {
$("#groups_overlay").on("click", ".left #clear_search_group_name", (e) => {
const $input = $("#groups_overlay .left #search_group_name");
@@ -1042,7 +1037,7 @@ export function setup_page(callback: () => void): void {
upgrade_text_for_wide_organization_logo: realm.upgrade_text_for_wide_organization_logo,
is_business_type_org:
realm.realm_org_type === settings_config.all_org_type_values.business.code,
- max_user_group_name_length,
+ max_user_group_name_length: user_groups.max_user_group_name_length,
};
const groups_overlay_html = render_user_group_settings_overlay(template_data);
@@ -1223,7 +1218,7 @@ export function initialize(): void {
const template_data = {
group_name: user_group.name,
group_description: user_group.description,
- max_user_group_name_length,
+ max_user_group_name_length: user_groups.max_user_group_name_length,
};
const change_user_group_info_modal = render_change_user_group_info_modal(template_data);
dialog_widget.launch({
diff --git a/web/src/user_groups.ts b/web/src/user_groups.ts
index fccbd908c1d..1aa70a845df 100644
--- a/web/src/user_groups.ts
+++ b/web/src/user_groups.ts
@@ -41,6 +41,11 @@ export function init(): void {
// WE INITIALIZE DATA STRUCTURES HERE!
init();
+// Ideally this should be included in page params.
+// Like we have realm.max_stream_name_length` and
+// `realm.max_stream_description_length` for streams.
+export const max_user_group_name_length = 100;
+
export function add(user_group_raw: UserGroupRaw): UserGroup {
// Reformat the user group members structure to be a set.
const user_group = {