-
Notifications
You must be signed in to change notification settings - Fork 11
/
Editor.jsx
53 lines (45 loc) · 1.63 KB
/
Editor.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from 'react';
import ReactDOM from 'react-dom';
import URI from "urijs";
import brace from 'brace';
import AceEditor from 'react-ace';
import 'brace/mode/yaml';
import 'brace/theme/github';
import Orquesta from './components/Orquesta.jsx';
class EditorView extends React.Component {
constructor(props) {
super(props);
this.state = {
yamlSource: ''
};
}
render() {
return (
<div className="container-fluid pl-0 pr-0">
<div className="row ml-0 mr-0">
<div className="col-4 pl-0 pr-0">
<AceEditor
placeholder="Edit Orquesta workflow here"
value={this.state.yamlSource}
mode="yaml"
theme="github"
onChange={(newYAML) => {this.setState({ yamlSource: newYAML })}}
debounceChangePeriod={750}
name="uid"
editorProps={{$blockScrolling: true}}
height='1000px'
width='100%'
tabSize={2}
showPrintMargin={false}
/>
</div>
<div className="col-8 pr-0 pl-0">
<Orquesta yaml={this.state.yamlSource} />
</div>
</div>
</div>
);
}
}
var container = document.getElementById('container');
ReactDOM.render(<EditorView {...(container.dataset)}/>, container);