-
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] Remove alerts from cases #143457
[Cases] Remove alerts from cases #143457
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
const { comment } = userAction.payload; | ||
|
||
if (comment.type === CommentType.alert) { | ||
const alertLabel = |
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.
Just curious, would it be better to use a single translation for this? I suppose we'd need to force comment.alertId
to be an array for that to work though. I believe the translations can handle the plural vs singular.
<UserCommentPropertyActions | ||
isLoading={isLoading} | ||
commentContent={comment.comment} | ||
onEdit={() => handleManageMarkdownEditId(comment.id)} |
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.
Just a note, this will recreate the anonymous function on each render, is it worth creating a useCallback
for these? Probably not that much of a performance improvement though
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.
Unfortunately, this is not a hook so I cannot use useCallback
. I need to create another component that wraps the actions so I can use useCallback
. Do you mind if we leave it as it is and do the performance improvement if needed?
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.
Yeah that's fine, leave it as it is.
const builderArgs = getMockBuilderArgs(); | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('renders correctly a description', async () => { |
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.
nit: there's an extra space between correctly
and a
@peteharverson Fixed in 7a9fec0 |
790a691
to
7a9fec0
Compare
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @cnasikas |
Summary
This PR allows users to remove alerts from a case through the case activity. It also:
Screenshots
Checklist
Delete any items that are not applicable to this PR.
For maintainers
Release notes
Add the ability to remove alerts attached to a case