From 759a751ff8c88962d23bf7013b73a637aaa7124c Mon Sep 17 00:00:00 2001 From: rmm-fl <143930462+rmm-fl@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:49:40 +0530 Subject: [PATCH] Handle max length for markdown description --- src/pages/workspace/WorkspaceNewRoomPage.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/workspace/WorkspaceNewRoomPage.tsx b/src/pages/workspace/WorkspaceNewRoomPage.tsx index 06ad1d2943c9..46a5b533372a 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.tsx +++ b/src/pages/workspace/WorkspaceNewRoomPage.tsx @@ -183,6 +183,14 @@ function WorkspaceNewRoomPage({policies, reports, formState, session, activePoli ErrorUtils.addErrorMessage(errors, 'roomName', ['common.error.characterLimitExceedCounter', {length: values.roomName.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } + const descriptionLength = ReportUtils.getCommentLength(values.reportDescription); + if (descriptionLength > CONST.REPORT_DESCRIPTION.MAX_LENGTH) { + ErrorUtils.addErrorMessage(errors, 'reportDescription', [ + 'common.error.characterLimitExceedCounter', + {length: descriptionLength, limit: CONST.REPORT_DESCRIPTION.MAX_LENGTH}, + ]); + } + if (!values.policyID) { errors.policyID = 'newRoomPage.pleaseSelectWorkspace'; }