streams: Pass max-length parameters to stream info modal.

We were not passing max_stream_description_length and
max_stream_name_length parameters to change_stream_info_modal
template and thus the maxlength attribute was not being set
correctly for the stream name and description input.

This commit updates the code to pass these parameters to
change_stream_info_modal template. We also remove these
parameters from the data passed to stream_types template,
since these parameters are not required there.
This commit is contained in:
Sahil Batra 2022-11-28 16:24:18 +05:30 committed by Tim Abbott
parent 38a4751b7b
commit 038880338f
1 changed files with 2 additions and 2 deletions

View File

@ -513,8 +513,6 @@ export function initialize() {
is_business_type_org:
page_params.realm_org_type === settings_config.all_org_type_values.business.code,
is_stream_edit: true,
max_stream_name_length: page_params.max_stream_name_length,
max_stream_description_length: page_params.max_stream_description_length,
};
const change_privacy_modal = render_stream_types(template_data);
@ -554,6 +552,8 @@ export function initialize() {
const template_data = {
stream_name: stream.name,
stream_description: stream.description,
max_stream_name_length: page_params.max_stream_name_length,
max_stream_description_length: page_params.max_stream_description_length,
};
const change_stream_info_modal = render_change_stream_info_modal(template_data);
dialog_widget.launch({