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 'sdc-ui/lib/react';
19 import PropTypes from 'prop-types';
21 import Description from 'shared/components/Description';
22 import { VersionInfo, LabeledValue } from 'shared/components/VersionInfo';
24 class WorkflowDetails extends Component {
32 workflowDetailsChanged = val => {
33 this.setState({ editWorkflow: val });
36 handleSubmitForm = e => {
38 this.props.updateWorkflow(this.state.editWorkflow);
42 const { name, description, workflowId, versionId } = this.props;
44 <div className="workflow-details">
45 <form onSubmit={this.handleSubmitForm}>
50 label={I18n.t('workflow.general.name')}
56 this.state.editWorkflow.description || description
58 onDataChange={this.workflowDetailsChanged}
60 <div className="save-description">
61 <Button btnType="primary">
62 {I18n.t('buttons.saveBtn')}
68 <LabeledValue title="UUID" value={versionId} />
70 <LabeledValue title="Invariant UUID" value={workflowId} />
77 WorkflowDetails.propTypes = {
78 name: PropTypes.string,
79 created: PropTypes.string,
80 modified: PropTypes.string,
81 description: PropTypes.string,
82 workflowId: PropTypes.string,
83 versionId: PropTypes.string,
84 updateWorkflow: PropTypes.func
87 export default WorkflowDetails;