From be35f698d69dd1262869ec7197dfb466800cd32b Mon Sep 17 00:00:00 2001 From: Davis Plumlee Date: Tue, 13 Feb 2024 11:01:16 -0500 Subject: [PATCH] addresses comments --- .../rule_details/rule_details_flyout.tsx | 3 ++ .../upgrade_prebuilt_rules_table_context.tsx | 2 + .../upgrade_prebuilt_rules_tour.tsx | 52 ++++--------------- 3 files changed, 14 insertions(+), 43 deletions(-) diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx index c2d00c819253a..d6507115bcd48 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx @@ -109,6 +109,7 @@ interface RuleDetailsFlyoutProps { size?: EuiFlyoutProps['size']; extraTabs?: EuiTabbedContentTab[]; dataTestSubj?: string; + id?: string; closeFlyout: () => void; } @@ -118,6 +119,7 @@ export const RuleDetailsFlyout = ({ size = 'm', extraTabs = [], dataTestSubj, + id, closeFlyout, }: RuleDetailsFlyoutProps) => { const { expandedOverviewSections, toggleOverviewSection } = useOverviewTabSections(); @@ -181,6 +183,7 @@ export const RuleDetailsFlyout = ({ return ( { [storage] ); - const [tourSteps, tourActions, tourState] = useEuiTour(stepsConfig, restoredState); + const [tourSteps, , tourState] = useEuiTour(stepsConfig, restoredState); useEffect(() => { const { isTourActive, currentTourStep } = tourState; storage.set(TOUR_STORAGE_KEY, { isTourActive, currentTourStep }); }, [tourState, storage]); - const shouldShowRuleUpgradeTour = useIsElementMounted(PER_FIELD_UPGRADE_TOUR_ANCHOR); + const isTourAnchorMounted = useIsElementMounted(PER_FIELD_UPGRADE_TOUR_ANCHOR); + const isFlyoutOpen = useIsElementMounted(PREBUILT_RULE_UPDATE_FLYOUT_ANCHOR); + const shouldShowRuleUpgradeTour = isTourAnchorMounted && !isFlyoutOpen; const enhancedSteps = useMemo( () => - tourSteps.map((item, index) => ({ + tourSteps.map((item) => ({ ...item, - content: ( - <> - {item.content} - {tourSteps.length > 1 && ( - <> - - - - - - - - - - - )} - - ), + content: item.content, })), - [tourSteps, tourActions] + [tourSteps] ); return shouldShowRuleUpgradeTour ? (