mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: hide insights from sidebar for oss and kill switch (#7270)
This commit is contained in:
parent
1a0a7c18f3
commit
9cb015a7db
@ -19,6 +19,8 @@ import AccordionDetails from '@mui/material/AccordionDetails';
|
||||
import AccordionSummary from '@mui/material/AccordionSummary';
|
||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||
import FlagIcon from '@mui/icons-material/OutlinedFlag';
|
||||
import { useUiFlag } from 'hooks/useUiFlag';
|
||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||
|
||||
const StyledBadgeContainer = styled('div')(({ theme }) => ({
|
||||
paddingLeft: theme.spacing(2),
|
||||
@ -150,6 +152,8 @@ export const PrimaryNavigationList: FC<{
|
||||
activeItem?: string;
|
||||
}> = ({ mode, onClick, activeItem }) => {
|
||||
const DynamicListItem = mode === 'mini' ? MiniListItem : FullListItem;
|
||||
const killInsightsDashboard = useUiFlag('killInsightsUI');
|
||||
const { isOss } = useUiConfig();
|
||||
|
||||
return (
|
||||
<List>
|
||||
@ -177,14 +181,19 @@ export const PrimaryNavigationList: FC<{
|
||||
>
|
||||
<PlaygroundIcon />
|
||||
</DynamicListItem>
|
||||
<DynamicListItem
|
||||
href='/insights'
|
||||
text='Insights'
|
||||
onClick={() => onClick('/insights')}
|
||||
selected={activeItem === '/insights'}
|
||||
>
|
||||
<InsightsIcon />
|
||||
</DynamicListItem>
|
||||
<ConditionallyRender
|
||||
condition={!killInsightsDashboard && !isOss()}
|
||||
show={
|
||||
<DynamicListItem
|
||||
href='/insights'
|
||||
text='Insights'
|
||||
onClick={() => onClick('/insights')}
|
||||
selected={activeItem === '/insights'}
|
||||
>
|
||||
<InsightsIcon />
|
||||
</DynamicListItem>
|
||||
}
|
||||
/>
|
||||
</List>
|
||||
);
|
||||
};
|
||||
|
@ -7,9 +7,9 @@ import { listItemButtonClasses as classes } from '@mui/material/ListItemButton';
|
||||
import {
|
||||
type LastViewedFlag,
|
||||
useLastViewedFlags,
|
||||
} from '../../../../hooks/useLastViewedFlags';
|
||||
} from 'hooks/useLastViewedFlags';
|
||||
import { type FC, useEffect } from 'react';
|
||||
import { useLastViewedProject } from '../../../../hooks/useLastViewedProject';
|
||||
import { useLastViewedProject } from 'hooks/useLastViewedProject';
|
||||
|
||||
beforeEach(() => {
|
||||
window.localStorage.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user