Add join to funcNames, and use to build declerationFunctions

pull/3460/head
ebb-tide 2018-05-17 12:12:35 -07:00 committed by Andrew Watkins
parent 89a33a270d
commit 77f66c2175
2 changed files with 6 additions and 2 deletions

View File

@ -74,9 +74,9 @@ class BodyBuilder extends PureComponent<Props> {
private get newDeclarationFuncs(): string[] {
const {body} = this.props
const declarationFunctions = ['from']
const declarationFunctions = [funcNames.FROM]
if (body.length > 1) {
declarationFunctions.push('join')
declarationFunctions.push(funcNames.JOIN)
}
return declarationFunctions
}
@ -85,6 +85,9 @@ class BodyBuilder extends PureComponent<Props> {
if (name === funcNames.FROM) {
this.props.onAppendFrom()
}
if (name === funcNames.JOIN) {
this.props.onAppendJoin()
}
}
private get funcNames() {

View File

@ -1,2 +1,3 @@
export const FROM = 'from'
export const FILTER = 'filter'
export const JOIN = 'join'