-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cases] UI validation for total number of comment characters #161357
[Cases] UI validation for total number of comment characters #161357
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
x-pack/plugins/cases/public/components/add_comment/index.test.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works fine 👍 Left a couple of comments.
x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_footer.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/cases/public/components/markdown_editor/editable_markdown_renderer.test.tsx
Outdated
Show resolved
Hide resolved
@@ -174,6 +175,9 @@ export const AddComment = React.memo( | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
}, [focusOnContext]); | |||
|
|||
const isDisabled = | |||
isLoading || !comment?.trim().length || comment.trim().length > MAX_COMMENT_LENGTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not disable the button if the user does not touch the form, right? You have to use form.isValid
to check if the user has interacted with the form. If undefined
then the form validation has not been checked yet. We can do it when we address #161461.
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
This PR adds UI validation for comments maximum length.
It shows error message and disables save button when the comment exceeds 30k characters while
Checklist
Delete any items that are not applicable to this PR.
For maintainers
Release Notes
The total number of characters per comment is limited to 30000