Skip to content

Commit

Permalink
Handle max length for markdown description
Browse files Browse the repository at this point in the history
  • Loading branch information
rmm-fl committed Apr 11, 2024
1 parent c5b84fd commit 759a751
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 759a751

Please sign in to comment.