-
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] Refactor: Move cases action buttons out of timelines #126265
[Cases] Refactor: Move cases action buttons out of timelines #126265
Conversation
…5931) * showing agent policy creation error message on UI * mapping the error instead of showing from the backend Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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 LGTM. Just left a question about a TODO comment.
...ution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx
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.
Great job 🚀 ! Amazing as always. I tested and everything is working as expected.
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.
regardless of the ongoing context and plugin api discussion, this is still another step in the right direction. once @cnasikas 's suggestion about moving toaster usage into cases is done, lgtm 👍
The toast had been moved :) |
…on-buttons-out-of-timelines
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.
…on-buttons-out-of-timelines
const ruleId = alert.fields['kibana.alert.rule.uuid'] ?? null; | ||
const linkToRule = ruleId ? prepend(paths.management.ruleDetails(ruleId)) : null; | ||
|
||
const caseAttachments: CaseAttachments = useMemo(() => { |
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.
@academo As discussed I will create a separate ticket to move all these in a separate file once this PR is merged
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.
@mgiota of course I can help you move that code out when you start working on it. We can make it a custom hook.
Thanks for the report @mgiota This is now fixed. |
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.
@academo I confirm that Overview page is fixed after your latest changes!
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 latest changes and confirmed the actions work on the Observability Overview page for me too.
rangeTo={relativeTime.end} | ||
indexNames={indexNames} | ||
/> | ||
<CasesContext |
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.
@academo Thanks for the fix. We will make sure to create a wrapper component that contains cases context so that both alerts and overview page can share
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.
@mgiota I was thinking on putting the CasesContext
all the way up in the observability plugin. To have it available everywhere. What do you think?
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.
Yep exactly that was my thought as well. This will avoid us having to repeat the same code in multiple places
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.
why not take this line of reasoning 1 step further? 😬
💛 Build succeeded, but was flakyTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
To update your PR or re-run it, just comment with: cc @academo |
Summary
See epic: #123183
Follow up to #125782 and #125782
Closes #126069 and #126070
After #125782 and #125782 it is now required to remove the cases "add to new case" and "add to existing case" out of timelines.
No visual or ux changes.
Changes:
useAddToCase
and replace them for the new cases hooksMissing in this PR for follow up PRs:
Visually this is how the new flow for timelines action buttons related to cases work.

Checklist
Delete any items that are not applicable to this PR.