compose: Avoid hardcoding maxlength for stream/topic names.

Note that previously, the limit for stream names was 30, even though
stream names have been up to 60 characters in length for years.
This commit is contained in:
jai2201 2022-07-15 06:31:24 +05:30 committed by Tim Abbott
parent 96be6678e4
commit 3853a65a4c
2 changed files with 4 additions and 2 deletions

View File

@ -209,6 +209,8 @@ function initialize_compose_box() {
: "End", : "End",
narrow_to_compose_recipients_key_html: narrow_to_compose_recipients_key_html:
(common.has_mac_keyboard() ? "⌘" : "Ctrl") + " + .", (common.has_mac_keyboard() ? "⌘" : "Ctrl") + " + .",
max_stream_name_length: page_params.max_stream_name_length,
max_topic_length: page_params.max_topic_length,
}), }),
); );
$(`.enter_sends_${user_settings.enter_sends}`).show(); $(`.enter_sends_${user_settings.enter_sends}`).show();

View File

@ -79,9 +79,9 @@
</span> </span>
<a role="button" class="narrow_to_compose_recipients zulip-icon zulip-icon-arrow-left-circle order-1" data-tooltip-template-id="narrow_to_compose_recipients_tooltip" tabindex="0"> <a role="button" class="narrow_to_compose_recipients zulip-icon zulip-icon-arrow-left-circle order-1" data-tooltip-template-id="narrow_to_compose_recipients_tooltip" tabindex="0">
</a> </a>
<input type="text" class="recipient_box" name="stream_message_recipient_stream" id="stream_message_recipient_stream" maxlength="30" value="" placeholder="{{t 'Stream' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Stream' }}" /> <input type="text" class="recipient_box" name="stream_message_recipient_stream" id="stream_message_recipient_stream" maxlength="{{ max_stream_name_length }}" value="" placeholder="{{t 'Stream' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Stream' }}" />
<i class="fa fa-angle-right" aria-hidden="true"></i> <i class="fa fa-angle-right" aria-hidden="true"></i>
<input type="text" class="recipient_box" name="stream_message_recipient_topic" id="stream_message_recipient_topic" maxlength="60" value="" placeholder="{{t 'Topic' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Topic' }}" /> <input type="text" class="recipient_box" name="stream_message_recipient_topic" id="stream_message_recipient_topic" maxlength="{{ max_topic_length }}" value="" placeholder="{{t 'Topic' }}" autocomplete="off" tabindex="0" aria-label="{{t 'Topic' }}" />
</div> </div>
</div> </div>
<div id="private-message" class="order-1"> <div id="private-message" class="order-1">