@@ -169,33 +236,12 @@ class AdminInfluxDBPage extends Component {
{users ? (
-
-
u.isEditing)}
- isEditingRoles={roles.some(r => r.isEditing)}
- onUpdateRoleUsers={this.handleUpdateRoleUsers}
- onUpdateUserRoles={this.handleUpdateUserRoles}
- onUpdateUserPassword={this.handleUpdateUserPassword}
- onUpdateRolePermissions={this.handleUpdateRolePermissions}
- onUpdateUserPermissions={this.handleUpdateUserPermissions}
- />
-
+
) : (
@@ -239,6 +285,9 @@ AdminInfluxDBPage.propTypes = {
updateUserRoles: func,
updateUserPassword: func,
notify: func.isRequired,
+ params: shape({
+ tab: string,
+ }).isRequired,
}
const mapStateToProps = ({adminInfluxDB: {users, roles, permissions}}) => ({
diff --git a/ui/src/dashboards/components/template_variables/RowValues.js b/ui/src/dashboards/components/template_variables/RowValues.js
index dc77afb51d..bc0a915de0 100644
--- a/ui/src/dashboards/components/template_variables/RowValues.js
+++ b/ui/src/dashboards/components/template_variables/RowValues.js
@@ -20,7 +20,7 @@ const RowValues = ({
onStartEdit={onStartEdit}
autoFocusTarget={autoFocusTarget}
spellCheck={false}
- autoComplete={false}
+ autoComplete="false"
/>
)
}
diff --git a/ui/src/index.tsx b/ui/src/index.tsx
index 10ffc7dec0..5f8572b98f 100644
--- a/ui/src/index.tsx
+++ b/ui/src/index.tsx
@@ -147,7 +147,7 @@ class Root extends PureComponent<{}, State> {
component={KapacitorPage}
/>
-
+
diff --git a/ui/src/shared/components/SubSections.tsx b/ui/src/shared/components/SubSections.tsx
new file mode 100644
index 0000000000..f6fe764226
--- /dev/null
+++ b/ui/src/shared/components/SubSections.tsx
@@ -0,0 +1,65 @@
+import React, {Component, ReactNode} from 'react'
+import uuid from 'uuid'
+import {withRouter, InjectedRouter} from 'react-router'
+
+import SubSectionsTab from 'src/shared/components/SubSectionsTab'
+import {ErrorHandling} from 'src/shared/decorators/errors'
+import {PageSection} from 'src/types/shared'
+
+interface Props {
+ sections: PageSection[]
+ activeSection: string
+ sourceID: string
+ router: InjectedRouter
+ parentUrl: string
+}
+
+@ErrorHandling
+class SubSections extends Component {
+ constructor(props) {
+ super(props)
+ }
+
+ public render() {
+ const {sections, activeSection} = this.props
+
+ return (
+
+
+
+ {sections.map(
+ section =>
+ section.enabled && (
+
+ )
+ )}
+
+
+
+ {this.activeSectionComponent}
+
+
+ )
+ }
+
+ private get activeSectionComponent(): ReactNode {
+ const {sections, activeSection} = this.props
+ const {component} = sections.find(section => section.url === activeSection)
+ return component
+ }
+
+ public handleTabClick = url => () => {
+ const {router, sourceID, parentUrl} = this.props
+ router.push(`/sources/${sourceID}/${parentUrl}/${url}`)
+ }
+}
+
+export default withRouter(SubSections)
diff --git a/ui/src/shared/components/SubSectionsTab.tsx b/ui/src/shared/components/SubSectionsTab.tsx
new file mode 100644
index 0000000000..399a46a41d
--- /dev/null
+++ b/ui/src/shared/components/SubSectionsTab.tsx
@@ -0,0 +1,25 @@
+import React, {SFC} from 'react'
+import {PageSection} from 'src/types/shared'
+
+interface TabProps {
+ handleClick: () => void
+ section: PageSection
+ activeSection: string
+}
+
+const SubSectionsTab: SFC = ({
+ handleClick,
+ section,
+ activeSection,
+}) => (
+
+ {section.name}
+
+)
+
+export default SubSectionsTab
diff --git a/ui/src/side_nav/components/NavItems.tsx b/ui/src/side_nav/components/NavItems.tsx
index 927f0ff59c..db51eeb4c9 100644
--- a/ui/src/side_nav/components/NavItems.tsx
+++ b/ui/src/side_nav/components/NavItems.tsx
@@ -1,6 +1,7 @@
import React, {PureComponent, SFC, ReactNode, ReactElement} from 'react'
import {Link} from 'react-router'
import classnames from 'classnames'
+import _ from 'lodash'
interface NavListItemProps {
link: string
@@ -62,17 +63,14 @@ interface NavBlockProps {
icon: string
location?: string
className?: string
- matcher?: string
+ highlightWhen: string[]
}
class NavBlock extends PureComponent {
public render() {
- const {location, className} = this.props
- const isActive = React.Children.toArray(this.props.children).find(
- (child: ReactElement) => {
- return location.startsWith(child.props.link) // if location is undefined, this will fail silently
- }
- )
+ const {location, className, highlightWhen} = this.props
+ const {length} = _.intersection(_.split(location, '/'), highlightWhen)
+ const isActive = !!length
const children = React.Children.map(
this.props.children,
diff --git a/ui/src/side_nav/containers/SideNav.tsx b/ui/src/side_nav/containers/SideNav.tsx
index dc17ddbb07..1f53c64a52 100644
--- a/ui/src/side_nav/containers/SideNav.tsx
+++ b/ui/src/side_nav/containers/SideNav.tsx
@@ -62,19 +62,26 @@ class SideNav extends PureComponent {