Skip to content

Commit

Permalink
feat: add menu item for insights (#6420)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Mar 5, 2024
1 parent de5a0f2 commit 6678012
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
7 changes: 7 additions & 0 deletions frontend/src/component/menu/Header/Header.tsx
Expand Up @@ -166,6 +166,7 @@ const Header: VFC = () => {

const increaseUnleashWidth = useUiFlag('increaseUnleashWidth');
const celebatoryUnleash = useUiFlag('celebrateUnleash');
const insightsDashboard = useUiFlag('executiveDashboard');

const routes = getRoutes();
const adminRoutes = useAdminRoutes();
Expand Down Expand Up @@ -247,6 +248,12 @@ const Header: VFC = () => {

<StyledNav>
<StyledLinks>
<ConditionallyRender
condition={insightsDashboard}
show={
<StyledLink to='/insights'>Insights</StyledLink>
}
/>
<StyledLink to='/projects'>Projects</StyledLink>
<StyledLink to={'/search'}>Search</StyledLink>
<StyledLink to='/playground'>Playground</StyledLink>
Expand Down
Expand Up @@ -10,6 +10,18 @@ exports[`returns all baseRoutes 1`] = `
"title": "Unleash",
"type": "protected",
},
{
"component": [Function],
"enterprise": false,
"flag": "executiveDashboard",
"menu": {
"advanced": true,
"mobile": true,
},
"path": "/insights",
"title": "Insights",
"type": "protected",
},
{
"component": {
"$$typeof": Symbol(react.lazy),
Expand Down Expand Up @@ -423,14 +435,5 @@ exports[`returns all baseRoutes 1`] = `
"title": "Profile",
"type": "protected",
},
{
"component": [Function],
"enterprise": true,
"flag": "executiveDashboard",
"menu": {},
"path": "/dashboard",
"title": "Executive dashboard",
"type": "protected",
},
]
`;
22 changes: 11 additions & 11 deletions frontend/src/component/menu/routes.ts
Expand Up @@ -60,6 +60,17 @@ export const routes: IRoute[] = [
isStandalone: true,
},

// Insights - previously "Executive dashboard"
{
path: '/insights',
title: 'Insights',
component: ExecutiveDashboard,
type: 'protected',
menu: { mobile: true, advanced: true },
flag: 'executiveDashboard',
enterprise: false,
},

// Project
{
path: '/projects/create',
Expand Down Expand Up @@ -439,17 +450,6 @@ export const routes: IRoute[] = [
menu: {},
},

// Executive dashboard
{
path: '/dashboard',
title: 'Executive dashboard',
component: ExecutiveDashboard,
type: 'protected',
menu: {},
flag: 'executiveDashboard',
enterprise: true,
},

/* If you update this route path, make sure you update the path in SWRProvider.tsx */
{
path: '/login',
Expand Down

0 comments on commit 6678012

Please sign in to comment.