diff --git a/src/components/App/TopNav.js b/src/components/App/TopNav.js index b943ab67ce..0c33291ba5 100644 --- a/src/components/App/TopNav.js +++ b/src/components/App/TopNav.js @@ -20,6 +20,7 @@ import { Dropdown, Menu } from 'semantic-ui-react'; import TraceIDSearchInput from './TraceIDSearchInput'; import type { ConfigMenuItem, ConfigMenuGroup } from '../../types/config'; +import getConfig from '../../utils/config/get-config'; import prefixUrl from '../../utils/prefix-url'; import './TopNav.css'; @@ -56,11 +57,6 @@ function CustomNavDropdown({ label, items }: ConfigMenuGroup) { } const NAV_LINKS = [ - { - key: 'dependencies', - to: prefixUrl('/dependencies'), - text: 'Dependencies', - }, { key: 'search', to: prefixUrl('/search'), @@ -68,6 +64,14 @@ const NAV_LINKS = [ }, ]; +if (getConfig().depsMenuEnabled === true) { + NAV_LINKS.push({ + key: 'dependencies', + to: prefixUrl('/dependencies'), + text: 'Dependencies', + }); +} + export default function TopNav(props: TopNavProps) { const { menuConfig } = props; const menuItems = Array.isArray(menuConfig) ? menuConfig : []; @@ -79,11 +83,11 @@ export default function TopNav(props: TopNavProps) {
- {NAV_LINKS.map(({ key, to, text }) => + {NAV_LINKS.map(({ key, to, text }) => ( {text} - )} + ))}
{menuItems.map(item => { if (item.items) { diff --git a/src/constants/default-config.js b/src/constants/default-config.js index 4570544801..794bc7a5bc 100644 --- a/src/constants/default-config.js +++ b/src/constants/default-config.js @@ -46,4 +46,5 @@ export default deepFreeze({ ], }, ], + depsMenuEnabled: true, });