mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
user-groups: Define max_user_group_name_length in user_groups.ts.
"max_user_group_name_length" is now defined in user_groups.ts instead of user_group_edit.ts because we would use that value in further commits in user_group_create.ts and importing it from user_group_edit.ts would result in import cycle.
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user