From b5f4a351eb8d81e9af7997c03dfbad7ddbbe864d Mon Sep 17 00:00:00 2001 From: kwasniew Date: Wed, 18 Sep 2024 15:42:19 +0200 Subject: [PATCH] feat: personal dashboard route --- .../NavigationSidebar/NavigationList.tsx | 14 ++++++++++++++ frontend/src/component/menu/routes.ts | 9 +++++++++ .../personalDashboard/PersonalDashboard.tsx | 3 +++ frontend/src/interfaces/uiConfig.ts | 1 + src/lib/types/experimental.ts | 7 ++++++- 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 frontend/src/component/personalDashboard/PersonalDashboard.tsx diff --git a/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationList.tsx b/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationList.tsx index a9dea5745fb4..73c333ed9a0e 100644 --- a/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationList.tsx +++ b/frontend/src/component/layout/MainLayout/NavigationSidebar/NavigationList.tsx @@ -15,6 +15,7 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; import SearchIcon from '@mui/icons-material/Search'; import PlaygroundIcon from '@mui/icons-material/AutoFixNormal'; import InsightsIcon from '@mui/icons-material/Insights'; +import PersonalDashboardIcon from '@mui/icons-material/DashboardOutlined'; import Accordion from '@mui/material/Accordion'; import AccordionDetails from '@mui/material/AccordionDetails'; import AccordionSummary from '@mui/material/AccordionSummary'; @@ -23,6 +24,7 @@ import FlagIcon from '@mui/icons-material/OutlinedFlag'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview'; import { ProjectIcon } from 'component/common/ProjectIcon/ProjectIcon'; +import { useUiFlag } from 'hooks/useUiFlag'; const StyledBadgeContainer = styled('div')(({ theme }) => ({ paddingLeft: theme.spacing(2), @@ -155,10 +157,22 @@ export const PrimaryNavigationList: FC<{ activeItem?: string; }> = ({ mode, onClick, activeItem }) => { const DynamicListItem = mode === 'mini' ? MiniListItem : FullListItem; + const personalDashboardUIEnabled = useUiFlag('personalDashboardUI'); const { isOss } = useUiConfig(); return ( + {personalDashboardUIEnabled ? ( + onClick('/personal')} + selected={activeItem === '/personal'} + > + + + ) : null} + { + return <>Personal Dashboard; +}; diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index 9c62909e2e01..eee1ecbf974e 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -91,6 +91,7 @@ export type UiFlags = { projectListImprovements?: boolean; onboardingUI?: boolean; eventTimeline?: boolean; + personalDashboardUI?: boolean; }; export interface IVersionInfo { diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index f72544ea73d1..b087f1ed994c 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -64,7 +64,8 @@ export type IFlagKey = | 'onboardingMetrics' | 'onboardingUI' | 'projectRoleAssignment' - | 'eventTimeline'; + | 'eventTimeline' + | 'personalDashboardUI'; export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>; @@ -317,6 +318,10 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_EVENT_TIMELINE, false, ), + personalDashboardUI: parseEnvVarBoolean( + process.env.UNLEASH_EXPERIMENTAL_PERSONAL_DASHBOARD_UI, + false, + ), }; export const defaultExperimentalOptions: IExperimentalOptions = {