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.
16 import React from 'react';
17 import PropTypes from 'prop-types';
18 import i18n from 'nfvo-utils/i18n/i18n.js';
19 import Input from 'nfvo-components/input/validation/Input.jsx';
20 import GridSection from 'nfvo-components/grid/GridSection.jsx';
21 import GridItem from 'nfvo-components/grid/GridItem.jsx';
23 const NameAndPurpose = ({
31 <GridSection hastLastColSet>
32 <GridItem colSpan={2}>
36 data-test-id="nic-name"
39 onChange={name => onDataChanged({ name })}
40 isValid={genericFieldInfo['name'].isValid}
41 errorText={genericFieldInfo['name'].errorText}
45 <GridItem colSpan={2} lastColInRow>
47 label={i18n('Purpose of NIC')}
49 data-test-id="nic-description"
50 onChange={description => onDataChanged({ description })}
51 disabled={isReadOnlyMode}
59 NameAndPurpose.propTypes = {
60 name: PropTypes.string,
61 description: PropTypes.string,
62 onDataChanged: PropTypes.func,
63 isReadOnlyMode: PropTypes.bool
66 export default NameAndPurpose;