1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: environments route should be hidden from menu for open-source (#8397)

This commit is contained in:
Tymoteusz Czech 2024-10-09 14:45:02 +02:00 committed by GitHub
parent 23b0401381
commit 178940ce7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 4 deletions

View File

@ -28,6 +28,11 @@ export const filterByConfig =
return Boolean(config[r.configFlag]);
}
const isOss = !config?.versionInfo?.current?.enterprise;
if (isOss && r.enterprise) {
return false;
}
return true;
};

View File

@ -511,6 +511,7 @@ export const getCondensedRoutes = (routes: IRoute[]): INavigationMenuItem[] => {
menu: route.menu,
configFlag: route.configFlag,
notFlag: route.notFlag,
enterprise: route.enterprise,
};
});
};

View File

@ -230,10 +230,14 @@ const ProjectEnvironmentList = () => {
initialValue={globalFilter}
onChange={setGlobalFilter}
/>
<PageHeader.Divider />
<Link component={RouterLink} to='/environments'>
Configure environments
</Link>
{!isOss() ? (
<>
<PageHeader.Divider />
<Link component={RouterLink} to='/environments'>
Configure environments
</Link>
</>
) : null}
</>
}
/>

View File

@ -25,6 +25,7 @@ export interface INavigationMenuItem {
notFlag?: keyof UiFlags;
configFlag?: keyof IUiConfig;
group?: string;
enterprise?: boolean;
}
interface IRouteMenu {