user-profile: Add maxlength attribute to name inputs in edit form.

This commit adds maxlength attribute with value set to 100 to
name inputs in both "Manage user" and "Manage bot" modals since
we allow maximum 100 characters for both user and bot names.
This commit is contained in:
Sahil Batra
2025-07-18 18:53:26 +05:30
committed by Tim Abbott
parent b9e9697be2
commit 80b9caa5ac
3 changed files with 4 additions and 2 deletions

View File

@@ -815,6 +815,7 @@ export function show_edit_bot_info_modal(user_id: number, $container: JQuery): v
disable_role_dropdown: !current_user.is_admin || (bot.is_owner && !current_user.is_owner),
bot_avatar_url: bot.avatar_url,
is_incoming_webhook_bot: bot.bot_type === INCOMING_WEBHOOK_BOT_TYPE,
max_bot_name_length: people.MAX_USER_NAME_LENGTH,
});
$container.append($(html_body));
let avatar_widget: UploadWidget;
@@ -1125,6 +1126,7 @@ export function show_edit_user_info_modal(user_id: number, $container: JQuery):
disable_role_dropdown: person.is_owner && !current_user.is_owner,
is_active,
hide_deactivate_button,
max_user_name_length: people.MAX_USER_NAME_LENGTH,
});
$container.append($(html_body));

View File

@@ -4,7 +4,7 @@
<input type="hidden" name="is_full_name" value="true" />
<div class="input-group name_change_container">
<label for="edit_user_full_name" class="modal-field-label">{{t "Name" }}</label>
<input type="text" autocomplete="off" name="full_name" id="edit_user_full_name" class="modal_text_input" value="{{ full_name }}" />
<input type="text" autocomplete="off" name="full_name" id="edit_user_full_name" class="modal_text_input" value="{{ full_name }}" maxlength="{{max_user_name_length}}" />
</div>
{{#if email}}
<div class="input-group email_change_container">

View File

@@ -3,7 +3,7 @@
<div class="alert" id="bot-edit-form-error"></div>
<div class="input-group name_change_container">
<label for="edit_bot_full_name" class="modal-field-label">{{t "Name" }}</label>
<input type="text" autocomplete="off" name="full_name" id="edit_bot_full_name" class="modal_text_input" value="{{ full_name }}" />
<input type="text" autocomplete="off" name="full_name" id="edit_bot_full_name" class="modal_text_input" value="{{ full_name }}" maxlength="{{max_bot_name_length}}" />
</div>
<input type="hidden" name="is_full_name" value="true" />
<div class="input-group email_change_container">