blob: 8441c7d1d630ccbc2681f812999fd4a04b024eed [file] [log] [blame]
Michael Landoefa037d2017-02-19 12:57:33 +02001import React, {Component} from 'react';
2import i18n from 'nfvo-utils/i18n/i18n.js';
3import Input from 'nfvo-components/input/validation/ValidationInput.jsx';
4import Form from 'nfvo-components/input/validation/ValidationForm.jsx';
5
6class FlowsEditorModalView extends Component {
7
8 render() {
9 let {onCancel, onDataChanged, currentFlow} = this.props;
10 let {artifactName, description} = currentFlow;
11 return (
12 <Form onSubmit={() => this.onSaveClicked()} onReset={onCancel}>
13 <Input
14 type='text'
15 name='name'
16 label={i18n('Name')}
17 validations={{required: true}}
18 value={artifactName}
19 onChange={artifactName => onDataChanged({artifactName})}/>
20 <Input
21 type='textarea'
22 name='description'
23 label={i18n('Description')}
24 validations={{required: true}}
25 value={description}
26 onChange={description => onDataChanged({description})}/>
27 </Form>
28 );
29 }
30
31 onSaveClicked() {
32 let {currentFlow, onSubmit} = this.props;
33 if (onSubmit) {
34 onSubmit(currentFlow);
35 }
36 }
37
38}
39
40export default FlowsEditorModalView;