diff --git a/src/assets/icons/dataQuality.tsx b/src/assets/icons/dataQuality.tsx index e53b5c35..99739ba6 100644 --- a/src/assets/icons/dataQuality.tsx +++ b/src/assets/icons/dataQuality.tsx @@ -1,19 +1,10 @@ import * as React from 'react'; const SvgComponent = (props: any) => ( - - - - - - - - - + + ); export default SvgComponent; diff --git a/src/components/SideDrawer/SideDrawer.tsx b/src/components/SideDrawer/SideDrawer.tsx index 75188de4..a4776a02 100644 --- a/src/components/SideDrawer/SideDrawer.tsx +++ b/src/components/SideDrawer/SideDrawer.tsx @@ -186,7 +186,9 @@ export const SideDrawer = ({ openMenu, setOpenMenu }: any) => { const getList = ( {sideMenu.map((item) => { - const hasChildren = sideMenu.filter((sideItem) => sideItem.parent === item.index); + const hasUnhiddenChildren = sideMenu.filter( + (sideItem) => sideItem.parent === item.index && !sideItem.hide + ); const itemColor = selectedIndex === item.index ? 'primary' : 'inherit'; if (item.hide) return null; return ( @@ -206,7 +208,7 @@ export const SideDrawer = ({ openMenu, setOpenMenu }: any) => { handleListItemClick(item); }} > - {hasChildren.length > 0 && openMenu && ( + {hasUnhiddenChildren.length > 0 && openMenu && ( { )} - {hasChildren.length > 0 && ( + {hasUnhiddenChildren.length > 0 && ( { unmountOnExit > - {hasChildren.map((subitem) => { + {hasUnhiddenChildren.map((subitem) => { if (subitem.hide) { return null; } diff --git a/src/config/constant.ts b/src/config/constant.ts index d5efb4a3..fc51988d 100644 --- a/src/config/constant.ts +++ b/src/config/constant.ts @@ -1,8 +1,12 @@ export const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL; export const websocketUrl = process.env.NEXT_PUBLIC_WEBSOCKET_URL; -export const showElementaryMenu = process.env.NEXT_PUBLIC_SHOW_ELEMENTARY_MENU === 'true'; -export const showDataInsightsTab = process.env.NEXT_PUBLIC_SHOW_DATA_INSIGHTS_TAB === 'true'; +export const showElementaryMenu = process.env.NEXT_PUBLIC_SHOW_ELEMENTARY_MENU === 'true'; // Data quality +export const showDataInsightsTab = process.env.NEXT_PUBLIC_SHOW_DATA_INSIGHTS_TAB === 'true'; //Data insights in UI4T lower pane. +export const showDataAnalysisTab = process.env.NEXT_PUBLIC_SHOW_DATA_ANALYSIS_TAB === 'true'; // Data Analysis +export const showSupersetUsageTab = process.env.NEXT_PUBLIC_SHOW_SUPERSET_USAGE_TAB === 'true'; // Usage +export const showSupersetAnalysisTab = + process.env.NEXT_PUBLIC_SHOW_SUPERSET_ANALYSIS_TAB === 'true'; // Analysis. export const defaultLoadMoreLimit = parseInt( process.env.NEXT_PUBLIC_DEFAULT_LOAD_MORE_LIMIT || '3' ); diff --git a/src/config/menu.tsx b/src/config/menu.tsx index 51036fae..32a7cbc4 100644 --- a/src/config/menu.tsx +++ b/src/config/menu.tsx @@ -11,7 +11,12 @@ import { primaryColor } from './theme'; import Settings from '@/assets/icons/settings'; import User from '@/assets/icons/manage_accounts'; import AiSettings from '@/assets/icons/aisettings'; - +import { + showDataAnalysisTab, + showElementaryMenu, + showSupersetAnalysisTab, + showSupersetUsageTab, +} from './constant'; export const drawerWidth = 250; const getColor = (selected: boolean) => (selected ? primaryColor : ''); @@ -26,6 +31,7 @@ export const getSideMenu = () => { icon: (selected: boolean) => , className: 'analysis_walkthrough', minimize: false, + hide: !showSupersetAnalysisTab, }, { index: 0.1, @@ -35,6 +41,7 @@ export const getSideMenu = () => { parent: 0, className: 'usage_walkthrough', minimize: false, + hide: !showSupersetUsageTab, }, { index: 0.2, @@ -44,6 +51,7 @@ export const getSideMenu = () => { parent: 0, className: 'data_analysis', minimize: false, + hide: !showDataAnalysisTab, }, { index: 1, @@ -90,7 +98,7 @@ export const getSideMenu = () => { path: '/data-quality', icon: (selected: boolean) => , className: 'data_quality_walkthrough', - // hide: !showElementaryMenu, + hide: !showElementaryMenu, minimize: false, }, {