diff --git a/ui/src/variables/components/UpdateVariableOverlay.tsx b/ui/src/variables/components/UpdateVariableOverlay.tsx index da819541ef..a74ef38ff1 100644 --- a/ui/src/variables/components/UpdateVariableOverlay.tsx +++ b/ui/src/variables/components/UpdateVariableOverlay.tsx @@ -3,10 +3,13 @@ import React, {PureComponent, ChangeEvent, FormEvent} from 'react' import _ from 'lodash' // Components -import {Form, Input, Button} from '@influxdata/clockface' +import {Form, Input, Button, Grid} from '@influxdata/clockface' import {Overlay} from 'src/clockface' import FluxEditor from 'src/shared/components/FluxEditor' +// Utils +import {validateVariableName} from 'src/variables/utils/validation' + // Types import {IVariable as Variable} from '@influxdata/influx' import { @@ -17,26 +20,25 @@ import { interface Props { variable: Variable + variables: Variable[] onCloseOverlay: () => void onUpdateVariable: (variable: Variable) => Promise } interface State { variable: Variable - nameErrorMessage: string - nameInputStatus: ComponentStatus + isFormValid: boolean } export default class UpdateVariableOverlay extends PureComponent { public state: State = { variable: this.props.variable, - nameInputStatus: ComponentStatus.Default, - nameErrorMessage: '', + isFormValid: true, } public render() { const {onCloseOverlay} = this.props - const {variable, nameInputStatus, nameErrorMessage} = this.state + const {variable, isFormValid} = this.state return ( @@ -44,60 +46,74 @@ export default class UpdateVariableOverlay extends PureComponent { title="Edit Variable" onDismiss={this.props.onCloseOverlay} /> - -
- -
- - - -
- - -
- -
-
- - -