mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-18 00:19:49 +01:00
feat: personal dashboard route (#8173)
This commit is contained in:
parent
d5076f0772
commit
8e037a335f
frontend/src
component
layout/MainLayout/NavigationSidebar
menu
personalDashboard
interfaces
src/lib/types
@ -15,6 +15,7 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
|||||||
import SearchIcon from '@mui/icons-material/Search';
|
import SearchIcon from '@mui/icons-material/Search';
|
||||||
import PlaygroundIcon from '@mui/icons-material/AutoFixNormal';
|
import PlaygroundIcon from '@mui/icons-material/AutoFixNormal';
|
||||||
import InsightsIcon from '@mui/icons-material/Insights';
|
import InsightsIcon from '@mui/icons-material/Insights';
|
||||||
|
import PersonalDashboardIcon from '@mui/icons-material/DashboardOutlined';
|
||||||
import Accordion from '@mui/material/Accordion';
|
import Accordion from '@mui/material/Accordion';
|
||||||
import AccordionDetails from '@mui/material/AccordionDetails';
|
import AccordionDetails from '@mui/material/AccordionDetails';
|
||||||
import AccordionSummary from '@mui/material/AccordionSummary';
|
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 { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
||||||
import { ProjectIcon } from 'component/common/ProjectIcon/ProjectIcon';
|
import { ProjectIcon } from 'component/common/ProjectIcon/ProjectIcon';
|
||||||
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
|
|
||||||
const StyledBadgeContainer = styled('div')(({ theme }) => ({
|
const StyledBadgeContainer = styled('div')(({ theme }) => ({
|
||||||
paddingLeft: theme.spacing(2),
|
paddingLeft: theme.spacing(2),
|
||||||
@ -155,10 +157,22 @@ export const PrimaryNavigationList: FC<{
|
|||||||
activeItem?: string;
|
activeItem?: string;
|
||||||
}> = ({ mode, onClick, activeItem }) => {
|
}> = ({ mode, onClick, activeItem }) => {
|
||||||
const DynamicListItem = mode === 'mini' ? MiniListItem : FullListItem;
|
const DynamicListItem = mode === 'mini' ? MiniListItem : FullListItem;
|
||||||
|
const personalDashboardUIEnabled = useUiFlag('personalDashboardUI');
|
||||||
const { isOss } = useUiConfig();
|
const { isOss } = useUiConfig();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<List>
|
<List>
|
||||||
|
{personalDashboardUIEnabled ? (
|
||||||
|
<DynamicListItem
|
||||||
|
href='/personal'
|
||||||
|
text='Personal Dahsboard'
|
||||||
|
onClick={() => onClick('/personal')}
|
||||||
|
selected={activeItem === '/personal'}
|
||||||
|
>
|
||||||
|
<PersonalDashboardIcon />
|
||||||
|
</DynamicListItem>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<DynamicListItem
|
<DynamicListItem
|
||||||
href='/projects'
|
href='/projects'
|
||||||
text='Projects'
|
text='Projects'
|
||||||
|
@ -10,6 +10,15 @@ exports[`returns all baseRoutes 1`] = `
|
|||||||
"title": "Unleash",
|
"title": "Unleash",
|
||||||
"type": "protected",
|
"type": "protected",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"component": [Function],
|
||||||
|
"menu": {
|
||||||
|
"mobile": true,
|
||||||
|
},
|
||||||
|
"path": "/personal",
|
||||||
|
"title": "Personal Dashboard",
|
||||||
|
"type": "protected",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
"$$typeof": Symbol(react.lazy),
|
"$$typeof": Symbol(react.lazy),
|
||||||
|
@ -47,6 +47,7 @@ import { FeedbackList } from '../feedbackNew/FeedbackList';
|
|||||||
import { Application } from 'component/application/Application';
|
import { Application } from 'component/application/Application';
|
||||||
import { Signals } from 'component/signals/Signals';
|
import { Signals } from 'component/signals/Signals';
|
||||||
import { LazyCreateProject } from '../project/Project/CreateProject/LazyCreateProject';
|
import { LazyCreateProject } from '../project/Project/CreateProject/LazyCreateProject';
|
||||||
|
import { PersonalDashboard } from '../personalDashboard/PersonalDashboard';
|
||||||
|
|
||||||
export const routes: IRoute[] = [
|
export const routes: IRoute[] = [
|
||||||
// Splash
|
// Splash
|
||||||
@ -58,6 +59,14 @@ export const routes: IRoute[] = [
|
|||||||
menu: {},
|
menu: {},
|
||||||
isStandalone: true,
|
isStandalone: true,
|
||||||
},
|
},
|
||||||
|
// Personal Dashboard
|
||||||
|
{
|
||||||
|
path: '/personal',
|
||||||
|
title: 'Personal Dashboard',
|
||||||
|
component: PersonalDashboard,
|
||||||
|
type: 'protected',
|
||||||
|
menu: { mobile: true },
|
||||||
|
},
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
export const PersonalDashboard = () => {
|
||||||
|
return <>Personal Dashboard</>;
|
||||||
|
};
|
@ -91,6 +91,7 @@ export type UiFlags = {
|
|||||||
projectListImprovements?: boolean;
|
projectListImprovements?: boolean;
|
||||||
onboardingUI?: boolean;
|
onboardingUI?: boolean;
|
||||||
eventTimeline?: boolean;
|
eventTimeline?: boolean;
|
||||||
|
personalDashboardUI?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IVersionInfo {
|
export interface IVersionInfo {
|
||||||
|
@ -64,7 +64,8 @@ export type IFlagKey =
|
|||||||
| 'onboardingMetrics'
|
| 'onboardingMetrics'
|
||||||
| 'onboardingUI'
|
| 'onboardingUI'
|
||||||
| 'projectRoleAssignment'
|
| 'projectRoleAssignment'
|
||||||
| 'eventTimeline';
|
| 'eventTimeline'
|
||||||
|
| 'personalDashboardUI';
|
||||||
|
|
||||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
||||||
|
|
||||||
@ -317,6 +318,10 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_EVENT_TIMELINE,
|
process.env.UNLEASH_EXPERIMENTAL_EVENT_TIMELINE,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
|
personalDashboardUI: parseEnvVarBoolean(
|
||||||
|
process.env.UNLEASH_EXPERIMENTAL_PERSONAL_DASHBOARD_UI,
|
||||||
|
false,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExperimentalOptions: IExperimentalOptions = {
|
export const defaultExperimentalOptions: IExperimentalOptions = {
|
||||||
|
Loading…
Reference in New Issue
Block a user