blob: 99709698846732ee829af66cc1c762f56aa09ad6 [file] [log] [blame]
Michael Landoefa037d2017-02-19 12:57:33 +02001import React, {Component, PropTypes} from 'react';
2import Button from 'react-bootstrap/lib/Button.js';
3import Sequencer from 'dox-sequence-diagram-ui';
4
5import i18n from 'nfvo-utils/i18n/i18n.js';
6
7class SequenceDiagram extends Component {
8
9 static propTypes = {
10 onSave: PropTypes.func.isRequired,
11 onClose: PropTypes.func.isRequired,
12 model: PropTypes.object.isRequired
13 };
14
15 onSave() {
16 this.props.onSave(this.refs.sequencer.getModel());
17 }
18
19 render() {
20 return (
21 <div className='sequence-diagram'>
22 <div className='sequence-diagram-sequencer'>
23 <Sequencer ref='sequencer' options={{useHtmlSelect: true}} model={this.props.model} />
24 </div>
25 <div className='sequence-diagram-action-buttons'>
26 <Button className='primary-btn' onClick={() => this.onSave()}>{i18n('Save')}</Button>
27 <Button className='primary-btn' onClick={this.props.onClose}>{i18n('Close')}</Button>
28 </div>
29 </div>
30 );
31 }
32
33}
34
35export default SequenceDiagram;