Fix FROM db dropdown
parent
a375cbe453
commit
dd8cabb512
|
@ -10,6 +10,7 @@ interface Props {
|
|||
argKey: string
|
||||
value: string
|
||||
bodyID: string
|
||||
declarationID: string
|
||||
onChangeArg: OnChangeArg
|
||||
}
|
||||
|
||||
|
@ -56,12 +57,13 @@ class From extends PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
private handleChooseDatabase = (item: DropdownItem): void => {
|
||||
const {argKey, funcID, onChangeArg, bodyID} = this.props
|
||||
const {argKey, funcID, onChangeArg, bodyID, declarationID} = this.props
|
||||
onChangeArg({
|
||||
funcID,
|
||||
key: argKey,
|
||||
value: item.text,
|
||||
bodyID,
|
||||
declarationID,
|
||||
generate: true,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ class FuncArg extends PureComponent<Props> {
|
|||
funcID={funcID}
|
||||
value={this.value}
|
||||
bodyID={bodyID}
|
||||
declarationID={declarationID}
|
||||
onChangeArg={onChangeArg}
|
||||
/>
|
||||
)
|
||||
|
|
|
@ -182,8 +182,14 @@ export class IFQLPage extends PureComponent<Props, State> {
|
|||
private get bodyToScript(): string {
|
||||
return this.state.body.reduce((acc, b) => {
|
||||
if (b.declarations.length) {
|
||||
const funcs = _.get(b, 'declarations.0.funcs', [])
|
||||
return `${acc}${this.funcsToScript(funcs)}\n\n`
|
||||
const declaration = _.get(b, 'declarations.0', false)
|
||||
if (!declaration) {
|
||||
return acc
|
||||
}
|
||||
|
||||
return `${acc}${declaration.name} = ${this.funcsToScript(
|
||||
declaration.funcs
|
||||
)}\n\n`
|
||||
}
|
||||
|
||||
return `${acc}${this.funcsToScript(b.funcs)}\n\n`
|
||||
|
|
Loading…
Reference in New Issue