-
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
[RAC][Security Solution] Add to case actions in detail flyout #108057
[RAC][Security Solution] Add to case actions in detail flyout #108057
Conversation
We will keep the flyout open when a modal appears on top of to keep it consistent with the add exception actions. However, when a user completes the action, the flyout should close and the confirmation toast should be standalone
Screen.Recording.2021-08-10.at.11.37.11.AM.mov |
Hey @kqualters-elastic , thanks for the PR. I pulled and played around locally. Here are some observation I found:
|
Thanks for checking it out. Yes, for #1 we just need to add a conditional check like in x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#L137 . For #2, I'm working on how best to do this, the modal will have the same problem. |
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
useInsertTimeline: insertTimelineHook, | ||
casePermissions, | ||
appId: 'securitySolution', | ||
onClose: onCaseSelection, |
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: maybe naming: onCaseSelection: closePopoverHandler
or afterCaseSelection
savedObjects: { | ||
client: {}, | ||
}, | ||
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.
we can put this in a common timelines mock file so this and events_viewer can share it
createCaseUrl, | ||
isAllCaseModalOpen, | ||
isCreateCaseFlyoutOpen, | ||
} = useAddToCase({ ecsRowData, useInsertTimeline, casePermissions, appId, onClose }); |
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.
nice! 🎉
@@ -263,6 +71,8 @@ const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({ | |||
updateCase: onCaseSuccess, | |||
userCanCrud: casePermissions?.crud ?? false, | |||
owner: [appId], | |||
onClose: () => | |||
dispatch(tGridActions.setOpenAddToExistingCase({ id: eventId, isOpen: false })), |
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.
Any issue with moving closeCaseFlyoutOpen
up and using it here? And maybe we can keep the name a bit simpler with closeCaseFlyout
?
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.
these are 2 different actions, setOpenAddToExistingCase
here and setOpenAddToNewCase
below
import { AddToCaseActionProps } from './add_to_case_action'; | ||
import * as i18n from './translations'; | ||
|
||
const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({ |
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 you meant this to be Ignore me, I see the exports at the bottom. 👍🏾AddtoExistingCaseActionComponent
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsAPI count
API count missing comments
async chunk count
History
To update your PR or re-run it, just comment with: |
…c#108057) * add to case action in flyout * Fix most type errors * Use context menu item instead of empty button for popover items * Remove unused import * Fire action on case modal close * Update tests to use both components and remove console.log * Update mocks in unit tests * Use an onClose prop instead of closeCallbacks * Pr feedback, create shared mock and rename handler * Make app usable when timelines is not enabled * Remove unused translations
… (#108422) * add to case action in flyout * Fix most type errors * Use context menu item instead of empty button for popover items * Remove unused import * Fire action on case modal close * Update tests to use both components and remove console.log * Update mocks in unit tests * Use an onClose prop instead of closeCallbacks * Pr feedback, create shared mock and rename handler * Make app usable when timelines is not enabled * Remove unused translations
Summary
This pr breaks the existing add to case "action," the button, popover to select new or existing case, select existing case modal, and create new case flyout into 4 separate components. One for the existing case icon and popover, one for the button to launch the add to new case popover, one button to launch the add to existing case modal, and a component to render said modal or popover. State is shared between these 4 components via redux and the timelines plugin store. Note these changes are just to add the new functionality to the flyout, using in observability and the ux changes to the security solution table to be done in a forthcoming pr.

Checklist