[Cases] Refactor: Move cases action buttons out of timelines#126265
[Cases] Refactor: Move cases action buttons out of timelines#126265academo merged 94 commits intoelastic:mainfrom academo:refactor/cases-action-buttons-out-of-timelines
Conversation
* 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>
peteharverson
left a comment
There was a problem hiding this comment.
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
cnasikas
left a comment
There was a problem hiding this comment.
Great job 🚀 ! Amazing as always. I tested and everything is working as expected.
kqualters-elastic
left a comment
There was a problem hiding this comment.
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
…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.
@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.
@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. |
peteharverson
left a comment
There was a problem hiding this comment.
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.
@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.
@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.
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.
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:
useAddToCaseand 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.