Insert selected query template into text area
parent
29b4383321
commit
123b81053e
|
@ -47,6 +47,10 @@ const RawQueryEditor = React.createClass({
|
||||||
this.props.onUpdate(this.state.value)
|
this.props.onUpdate(this.state.value)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleChooseTemplate(template) {
|
||||||
|
this.setState({value: template.query})
|
||||||
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {query: {rawStatus}} = this.props
|
const {query: {rawStatus}} = this.props
|
||||||
const {value} = this.state
|
const {value} = this.state
|
||||||
|
@ -66,7 +70,7 @@ const RawQueryEditor = React.createClass({
|
||||||
/>
|
/>
|
||||||
<div style={{display: 'flex'}}>
|
<div style={{display: 'flex'}}>
|
||||||
{this.renderStatus(rawStatus)}
|
{this.renderStatus(rawStatus)}
|
||||||
<Dropdown items={QUERY_TEMPLATES} selected={'Query Templates'} onChoose={() => {}} />
|
<Dropdown items={QUERY_TEMPLATES} selected={'Query Templates'} onChoose={this.handleChooseTemplate} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue