2 * Copyright © 2016-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.
17 import React from 'react';
18 import i18n from 'nfvo-utils/i18n/i18n.js';
20 import Form from 'nfvo-components/input/validation/Form.jsx';
21 import Input from 'nfvo-components/input/validation/Input.jsx';
22 import GridSection from 'nfvo-components/grid/GridSection.jsx';
23 import GridItem from 'nfvo-components/grid/GridItem.jsx';
24 import { forms } from '../SoftwareProductComponentsConstants.js';
26 class ComponentCreationView extends React.Component {
34 let { displayName, description } = data;
37 {genericFieldInfo && (
41 onSubmit={() => this.submit()}
42 onReset={() => onCancel()}
43 submitButtonText={i18n('Create')}
45 isValid={this.props.isFormValid}
46 formReady={this.props.formReady}
48 this.props.onValidateForm(forms.CREATE_FORM)
50 btnClassName="sdc-modal__footer">
51 <GridSection hasLastColSet>
52 <GridItem colSpan={4} lastColInRow>
55 onChange={displayName =>
56 onDataChanged({ displayName })
61 genericFieldInfo.displayName.isValid
64 genericFieldInfo.displayName.errorText
70 <GridItem colSpan={4} lastColInRow>
72 label={i18n('Description')}
73 onChange={description =>
74 onDataChanged({ description })
78 genericFieldInfo.description.isValid
81 genericFieldInfo.description.errorText
83 data-test-id="description"
85 groupClassName="no-bottom-margin"
96 const { onSubmit, data } = this.props;
101 export default ComponentCreationView;