Skip to content

Commit

Permalink
- Fixed props in QueryEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
amrith92 committed May 21, 2018
1 parent 2a700e6 commit e111d82
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/scripts/query-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,31 @@ export default class QueryEditor extends React.Component {

constructor(props) {
super(props);
this.state = {
this.state = {
dimensions: {
height: props.height,
width: props.width || 100
},
query: '{"query": {"match_all": {}}}',
query: [
'{',
'\t"query": {',
'\t\t"match_all": {}',
'\t}',
'}'
].join("\n"),
}
}

editorDidMount(editor, monaco) {
console.log('editorDidMount', editor);
editor.focus();
}

onChange(newValue, e) {
console.log('onChange', newValue, e);
}

render() {
const code = this.state.code;
const query = this.state.query;
const options = {
selectOnLineNumbers: true
};
Expand All @@ -36,7 +41,7 @@ export default class QueryEditor extends React.Component {
height={height}
language="json"
theme="vs-dark"
value={code}
value={query}
options={options}
onChange={onChange}
editorDidMount={editorDidMount}
Expand Down

0 comments on commit e111d82

Please sign in to comment.