Skip to content

Commit 28801ea

Browse files
committed
fix(ui): hide + button when no custom tutorials exist
1 parent 4e20267 commit 28801ea

File tree

2 files changed

+5
-0
lines changed
  • redisinsight/ui/src/components/side-panels/panels/enablement-area/EnablementArea/components

2 files changed

+5
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export interface Props {
3636
isPageOpened?: boolean
3737
isShowActions?: boolean
3838
isShowFolder?: boolean
39+
hasChildren?: boolean
3940
}
4041

4142
const Group = (props: Props) => {
@@ -53,6 +54,7 @@ const Group = (props: Props) => {
5354
onDelete,
5455
isPageOpened,
5556
isShowFolder,
57+
hasChildren = true,
5658
} = props
5759
const { deleting: deletingCustomTutorials } = useSelector(
5860
workbenchCustomTutorialsSelector,
@@ -87,6 +89,7 @@ const Group = (props: Props) => {
8789
const actionsContent = (
8890
<>
8991
{actions?.includes(EAItemActions.Create) &&
92+
hasChildren &&
9093
(isGroupOpen || forceState === 'open') && (
9194
<OnboardingTour
9295
options={ONBOARDING_FEATURES.EXPLORE_CUSTOM_TUTORIALS}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ const Navigation = (props: Props) => {
156156
const currentManifestPath = `${manifestPath}/${key}`
157157

158158
const isCustomTutorials = id === CUSTOM_TUTORIALS_ID && level === 0
159+
const hasChildren = (children?.length ?? 0) > 0
159160

160161
switch (type) {
161162
case EnablementAreaComponent.Group:
@@ -171,6 +172,7 @@ const Navigation = (props: Props) => {
171172
onCreate={() => setIsCreateOpen((v) => !v)}
172173
onDelete={onDeleteCustomTutorial}
173174
isPageOpened={isInternalPageVisible}
175+
hasChildren={hasChildren}
174176
forceState={
175177
isCustomTutorials && isCustomTutorialsOnboarding
176178
? 'open'

0 commit comments

Comments
 (0)