[Security solution] Guided onboarding unhappy path fixes#144178
[Security solution] Guided onboarding unhappy path fixes#144178stephmilovic merged 11 commits intoelastic:mainfrom
Conversation
| const StyledTourStep = styled(EuiTourStep)<EuiTourStepProps & { stepId: SecurityStepId }>` | ||
| &.euiPopover__panel[data-popover-open] { | ||
| z-index: ${({ step, stepId }) => | ||
| isStepExternallyMounted(stepId, step) ? '9000 !important' : '1000 !important'}; |
| ); | ||
|
|
||
| const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); | ||
| const showTimeline = useShallowEqualSelector( |
|
|
||
| const onExpandEvent = useCallback(() => { | ||
| if (isTourAnchor) { | ||
| const isStep2Active = activeStep === 2 && isTourShown(SecurityStepId.alertsCases); |
There was a problem hiding this comment.
use the enum here instead of 2 and maybe isExpandEventStepActive ?
| attachments: caseAttachments, | ||
| ...(isTourShown(SecurityStepId.alertsCases) && activeStep === 4 | ||
| // activeStep will be 4 on first render because not yet incremented | ||
| // if the user closes the flyout without completing the form and comes back, we will be at step 5 |
| activeStep: number; | ||
| endTourStep: (stepId: SecurityStepId) => void; | ||
| incrementStep: (stepId: SecurityStepId, step?: number) => void; | ||
| incrementStep: (stepId: SecurityStepId) => void; |
There was a problem hiding this comment.
never used/implemented
There was a problem hiding this comment.
Is it going to be used in the future or should we just remove it?
| import { GuidedOnboardingTourStep, SecurityTourStep } from './tour_step'; | ||
| import { SecurityStepId } from './tour_config'; | ||
| import { useTourContext } from './tour'; | ||
| import { mockGlobalState, SUB_PLUGINS_REDUCER, TestProviders } from '../../mock'; |
There was a problem hiding this comment.
need this now since we have timeline state in the component
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
| return anchor != null ? ( | ||
| <> | ||
| <EuiTourStep {...commonProps} anchor={anchor} /> | ||
| <StyledTourStep stepId={stepId} {...commonProps} anchor={anchor} /> |
There was a problem hiding this comment.
NIT: In this case where we have the anchor, do we need to render the TourStep if we don't have children?
I am asking because if we don't have to render anything if children is not passed, then we could create an exit case (if !children return null) much earlier in the component, and avoid checking it on every return, and this double ternary condition as well.
There was a problem hiding this comment.
Yes, step 5 is only the tour step, no children passed
x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx
Show resolved
Hide resolved
semd
left a comment
There was a problem hiding this comment.
Tested locally, All the problems mentioned are solved.
The only change I would do is to use constants in the components for the steps, instead of the sequence number, as discussed. But besides that, it LGTM.
michaelolo24
left a comment
There was a problem hiding this comment.
Tested locally, just one UX change for the flyout header, but everything else looks good...just some nits. Thanks for doing this work!
@michaelolo24 I have a PR with design fixes coming up next so I will clear this problem up there. thanks! |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |






Summary
Follow up to #143598
Fixes unhappy path behavior on the
SecurityStepId.alertsCasestour. Details on the fixes are in the code!To test
Add to your dev yml:
xpack.cloud.id: test(this is new since the original PR)Follow instructions from original PR #143598
Known issues left unresolved
If you have a flyout guide step open, close the flyout, open the Setup guide menu, and click "Continue", the user needs to manually open the flyout to get back to the step. Here is an issue to add a callback that will allow us to automate this click. FWIW, this only happens if the user is on the alerts page. If they go to an unrelated page (non-detections), open the Setup guide menu, and click "Continue", they are redirected to the Alerts page and reset to step 1.