1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-10 01:16:39 +02:00

feat: add menu item for insights (#6420)

This commit is contained in:
Tymoteusz Czech 2024-03-05 09:38:05 +01:00 committed by GitHub
parent de5a0f2825
commit 6678012b03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 20 deletions

View File

@ -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();
@ -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>

View File

@ -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),
@ -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",
},
]
`;

View File

@ -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',
@ -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',