-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make dependencies tab configurable #122
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,18 +57,21 @@ function CustomNavDropdown({ label, items }: ConfigMenuGroup) { | |
} | ||
|
||
const NAV_LINKS = [ | ||
{ | ||
key: 'dependencies', | ||
to: prefixUrl('/dependencies'), | ||
text: 'Dependencies', | ||
}, | ||
{ | ||
key: 'search', | ||
to: prefixUrl('/search'), | ||
text: 'Search', | ||
}, | ||
]; | ||
|
||
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) { | |
<div className="ui input"> | ||
<TraceIDSearchInput /> | ||
</div> | ||
{NAV_LINKS.map(({ key, to, text }) => | ||
{NAV_LINKS.map(({ key, to, text }) => ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
does this change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pavolloffay I don't follow... can you elaborate? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that this changes it done automatically via git hooks not by me |
||
<Link key={key} to={to} className="item"> | ||
{text} | ||
</Link> | ||
)} | ||
))} | ||
<div className="right menu"> | ||
{menuItems.map(item => { | ||
if (item.items) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,5 @@ export default deepFreeze({ | |
], | ||
}, | ||
], | ||
depsMenuEnabled: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be renamed to |
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can just be
Or is there a reason to fail if truthy but not strictly
true
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, updated