Skip to content

Commit

Permalink
Merge pull request #39624 from rmm-fl/i-38293
Browse files Browse the repository at this point in the history
Handle max length for markdown description
  • Loading branch information
jasperhuangg authored Apr 12, 2024
2 parents dff9542 + 759a751 commit 568921f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pages/workspace/WorkspaceNewRoomPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 568921f

Please sign in to comment.