2 * Copyright © 2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 import React, { Component } from 'react';
17 import { I18n } from 'react-redux-i18n';
18 import { Input, Button } from 'onap-ui-react';
19 import PropTypes from 'prop-types';
21 import Description from 'shared/components/Description';
23 class WorkflowDetails extends Component {
24 handleSubmitForm = e => {
26 const { description } = this.props;
27 this.props.updateWorkflow(description);
34 workflowDetailsChanged,
38 <div className="workflow-details">
39 <form onSubmit={this.handleSubmitForm}>
44 label={I18n.t('workflow.general.name')}
50 description={description}
51 onDataChange={workflowDetailsChanged}
53 <div className="save-description">
54 <Button disabled={isArchive} btnType="primary">
55 {I18n.t('buttons.saveBtn')}
64 WorkflowDetails.propTypes = {
65 name: PropTypes.string,
66 created: PropTypes.string,
67 modified: PropTypes.string,
68 description: PropTypes.string,
69 defaultDescription: PropTypes.string,
70 updateWorkflow: PropTypes.func,
71 workflowDetailsChanged: PropTypes.func,
72 isArchive: PropTypes.bool
75 export default WorkflowDetails;