Skip to content

Commit

Permalink
add feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Oct 27, 2022
1 parent c0f35b9 commit 1958a5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export const allowedExperimentalValues = Object.freeze({
* Enables endpoint package level rbac
*/
endpointRbacEnabled: false,

/**
* Enables the Guided Onboarding tour in security
*/
guidedOnboarding: false,
});

type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import React, { createContext, useCallback, useContext, useEffect, useMemo, useS
import useObservable from 'react-use/lib/useObservable';
import { catchError, of, timeout } from 'rxjs';
import { useLocation } from 'react-router-dom';
import { useIsExperimentalFeatureEnabled } from '../../hooks/use_experimental_features';
import { isDetectionsPath } from '../../../helpers';
import { useKibana } from '../../lib/kibana';
import { securityTourConfig, SecurityStepId } from './tour_config';
Expand Down Expand Up @@ -111,8 +112,9 @@ export const RealTourContextProvider = ({ children }: { children: ReactChild })

export const TourContextProvider = ({ children }: { children: ReactChild }) => {
const { pathname } = useLocation();
const isTourEnabled = useIsExperimentalFeatureEnabled('guidedOnboarding');

if (isDetectionsPath(pathname)) {
if (isDetectionsPath(pathname) && isTourEnabled) {
return <RealTourContextProvider>{children}</RealTourContextProvider>;
}

Expand Down

0 comments on commit 1958a5a

Please sign in to comment.