Skip to content

Commit c88b5f2

Browse files
committed
#RI-6347 - fix onboarding custom tutorials step
1 parent 0c07ff6 commit c88b5f2

File tree

2 files changed

+10
-2
lines changed
  • redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components

2 files changed

+10
-2
lines changed

redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components/Group/Group.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ const Group = (props: Props) => {
7373
}
7474

7575
const handleOpen = (isOpen: boolean) => {
76+
if (forceState === 'open') return
77+
7678
setIsGroupOpen(isOpen)
7779
onToggle?.(isOpen)
7880
}
7981

8082
const actionsContent = (
8183
<>
82-
{actions?.includes(EAItemActions.Create) && isGroupOpen && (
84+
{actions?.includes(EAItemActions.Create) && (isGroupOpen || forceState === 'open') && (
8385
<OnboardingTour
8486
options={ONBOARDING_FEATURES.EXPLORE_CUSTOM_TUTORIALS}
8587
anchorPosition="downLeft"

redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components/Navigation/Navigation.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import cx from 'classnames'
33
import { EuiListGroup } from '@elastic/eui'
44
import { isArray } from 'lodash'
55
import { useParams } from 'react-router-dom'
6-
import { useDispatch } from 'react-redux'
6+
import { useDispatch, useSelector } from 'react-redux'
77
import { EnablementAreaComponent, IEnablementAreaItem } from 'uiSrc/slices/interfaces'
88

99
import { ApiEndpoints, EAItemActions, EAManifestFirstKey } from 'uiSrc/constants'
@@ -15,6 +15,8 @@ import {
1515
} from 'uiSrc/slices/workbench/wb-custom-tutorials'
1616

1717
import UploadWarning from 'uiSrc/components/upload-warning'
18+
import { appFeatureOnboardingSelector } from 'uiSrc/slices/app/features'
19+
import { OnboardingSteps } from 'uiSrc/constants/onboarding'
1820
import {
1921
FormValues
2022
} from '../UploadTutorialForm/UploadTutorialForm'
@@ -45,12 +47,15 @@ const PATHS = {
4547

4648
const Navigation = (props: Props) => {
4749
const { tutorials, customTutorials, isInternalPageVisible } = props
50+
const { currentStep, isActive } = useSelector(appFeatureOnboardingSelector)
4851

4952
const [isCreateOpen, setIsCreateOpen] = useState(false)
5053

5154
const dispatch = useDispatch()
5255
const { instanceId = '' } = useParams<{ instanceId: string }>()
5356

57+
const isCustomTutorialsOnboarding = currentStep === OnboardingSteps.CustomTutorials && isActive
58+
5459
useEffect(() => () => {
5560
dispatch(setWbCustomTutorialsState())
5661
}, [])
@@ -122,6 +127,7 @@ const Navigation = (props: Props) => {
122127
onCreate={() => setIsCreateOpen((v) => !v)}
123128
onDelete={onDeleteCustomTutorial}
124129
isPageOpened={isInternalPageVisible}
130+
forceState={isCustomTutorials && isCustomTutorialsOnboarding ? 'open' : undefined}
125131
{...args}
126132
>
127133
{isCustomTutorials && actions?.includes(EAItemActions.Create) && (

0 commit comments

Comments
 (0)