Exclude links that don't work in cloud

pull/13002/head
Brandon Farmer 2019-03-28 16:54:06 -07:00
parent 0b1b566aac
commit cc2c826be6
4 changed files with 54 additions and 29 deletions

View File

@ -4,10 +4,6 @@ import {Link} from 'react-router'
import classnames from 'classnames'
import {get} from 'lodash'
// Components
import NavMenuSubItem from 'src/pageLayout/components/NavMenuSubItem'
import {Select} from 'src/clockface'
// Types
import {IconFont} from 'src/clockface'
@ -43,7 +39,7 @@ const NavMenuItem: SFC<Props> = ({
<Link className="nav--item-header" to={link}>
{title}
</Link>
<Select type={NavMenuSubItem}>{children}</Select>
{children}
</div>
</div>
)

View File

@ -12,6 +12,7 @@ import {AppState} from 'src/types'
import {IconFont} from 'src/clockface'
import {ErrorHandling} from 'src/shared/decorators/errors'
import CloudExclude from 'src/shared/components/cloud/CloudExclude'
interface OwnProps {
isHidden: boolean
@ -80,6 +81,7 @@ class SideNav extends PureComponent<Props> {
location={location.pathname}
highlightPaths={['configuration']}
>
<CloudExclude>
<NavMenu.SubItem
title="Buckets"
link="/configuration/buckets_tab"
@ -104,6 +106,7 @@ class SideNav extends PureComponent<Props> {
location={location.pathname}
highlightPaths={['variables_tab']}
/>
</CloudExclude>
<NavMenu.SubItem
title="Profile"
link="/configuration/settings_tab"

View File

@ -0,0 +1,13 @@
import {PureComponent} from 'react'
export default class extends PureComponent {
render() {
const {children} = this.props
if (process.env.CLOUD !== 'true') {
return children
}
return null
}
}

View File

@ -0,0 +1,13 @@
import {PureComponent} from 'react'
export default class extends PureComponent {
render() {
const {children} = this.props
if (process.env.CLOUD === 'true') {
return children
}
return null
}
}