Skip to content

Commit

Permalink
feat: personal dashboard route (#8173)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Sep 19, 2024
1 parent d5076f0 commit 8e037a3
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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),
Expand Down Expand Up @@ -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 (
<List>
{personalDashboardUIEnabled ? (
<DynamicListItem
href='/personal'
text='Personal Dahsboard'
onClick={() => onClick('/personal')}
selected={activeItem === '/personal'}
>
<PersonalDashboardIcon />
</DynamicListItem>
) : null}

<DynamicListItem
href='/projects'
text='Projects'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ exports[`returns all baseRoutes 1`] = `
"title": "Unleash",
"type": "protected",
},
{
"component": [Function],
"menu": {
"mobile": true,
},
"path": "/personal",
"title": "Personal Dashboard",
"type": "protected",
},
{
"component": {
"$$typeof": Symbol(react.lazy),
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/component/menu/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { FeedbackList } from '../feedbackNew/FeedbackList';
import { Application } from 'component/application/Application';
import { Signals } from 'component/signals/Signals';
import { LazyCreateProject } from '../project/Project/CreateProject/LazyCreateProject';
import { PersonalDashboard } from '../personalDashboard/PersonalDashboard';

export const routes: IRoute[] = [
// Splash
Expand All @@ -58,6 +59,14 @@ export const routes: IRoute[] = [
menu: {},
isStandalone: true,
},
// Personal Dashboard
{
path: '/personal',
title: 'Personal Dashboard',
component: PersonalDashboard,
type: 'protected',
menu: { mobile: true },
},

// Project
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const PersonalDashboard = () => {
return <>Personal Dashboard</>;
};
1 change: 1 addition & 0 deletions frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export type UiFlags = {
projectListImprovements?: boolean;
onboardingUI?: boolean;
eventTimeline?: boolean;
personalDashboardUI?: boolean;
};

export interface IVersionInfo {
Expand Down
7 changes: 6 additions & 1 deletion src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export type IFlagKey =
| 'onboardingMetrics'
| 'onboardingUI'
| 'projectRoleAssignment'
| 'eventTimeline';
| 'eventTimeline'
| 'personalDashboardUI';

export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;

Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 8e037a3

Please sign in to comment.