Rename 'Analyze' to 'Validate'

pull/10616/head
Alex P 2018-06-14 10:27:46 -07:00
parent 56733cd152
commit 29dc7bb479
5 changed files with 18 additions and 18 deletions

View File

@ -25,7 +25,7 @@ interface Props {
onSubmitScript: OnSubmitScript
onAppendFrom: () => void
onAppendJoin: () => void
onAnalyze: () => void
onValidate: () => void
}
interface Body extends FlatBody {
@ -87,7 +87,7 @@ class TimeMachine extends PureComponent<Props> {
script,
status,
service,
onAnalyze,
onValidate,
suggestions,
onChangeScript,
onSubmitScript,
@ -100,11 +100,11 @@ class TimeMachine extends PureComponent<Props> {
headerOrientation: HANDLE_VERTICAL,
headerButtons: [
<div
key="analyze"
className="btn btn-default btn-xs analyze--button"
onClick={onAnalyze}
key="validate"
className="btn btn-default btn-xs validate--button"
onClick={onValidate}
>
Analyze
Validate
</div>,
],
menuOptions: [],

View File

@ -7,7 +7,7 @@ import {ErrorHandling} from 'src/shared/decorators/errors'
import KeyboardShortcuts from 'src/shared/components/KeyboardShortcuts'
import {
analyzeSuccess,
validateSuccess,
fluxTimeSeriesError,
fluxResponseTruncatedError,
} from 'src/shared/copy/notifications'
@ -109,7 +109,7 @@ export class FluxPage extends PureComponent<Props, State> {
status={status}
service={this.service}
suggestions={suggestions}
onAnalyze={this.handleAnalyze}
onValidate={this.handleValidate}
onAppendFrom={this.handleAppendFrom}
onAppendJoin={this.handleAppendJoin}
onChangeScript={this.handleChangeScript}
@ -581,14 +581,14 @@ export class FluxPage extends PureComponent<Props, State> {
}, '')
}
private handleAnalyze = async () => {
private handleValidate = async () => {
const {links, notify, script} = this.props
try {
const ast = await getAST({url: links.ast, body: script})
const body = bodyNodes(ast, this.state.suggestions)
const status = {type: 'success', text: ''}
notify(analyzeSuccess)
notify(validateSuccess())
this.setState({ast, body, status})
} catch (error) {

View File

@ -660,10 +660,10 @@ export const notifyKapacitorNotFound = () => ({
})
// Flux notifications
export const analyzeSuccess = {
export const validateSuccess = () => ({
...defaultSuccessNotification,
message: 'No errors found. Happy Happy Joy Joy!',
}
})
export const notifyCopyToClipboardSuccess = text => ({
...defaultSuccessNotification,

View File

@ -157,13 +157,17 @@ $threesizer-shadow-stop: fade-out($g0-obsidian, 1);
letter-spacing: 0.05em;
color: $g11-sidewalk;
padding-left: 4px;
padding-right: 6px;
padding-right: 2px;
}
.threesizer--header-controls {
display: flex;
align-items: center;
flex-wrap: nowrap;
> * {
margin-left: 4px;
}
}
.threesizer--body {
@ -185,10 +189,6 @@ $threesizer-shadow-stop: fade-out($g0-obsidian, 1);
margin-top: 10px;
}
.analyze--button {
margin-right: 3px
}
.dash-graph-context--button {
width: 24px;
height: 24px;

View File

@ -12,7 +12,7 @@ const setup = () => {
suggestions: [],
onSubmitScript: () => {},
onChangeScript: () => {},
onAnalyze: () => {},
onValidate: () => {},
onAppendFrom: () => {},
onAppendJoin: () => {},
status: {type: '', text: ''},