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 InputOptions from 'nfvo-components/input/validation/InputOptions.jsx';
21 import GridSection from 'nfvo-components/grid/GridSection.jsx';
22 import GridItem from 'nfvo-components/grid/GridItem.jsx';
31 <GridSection title={i18n('Protocols')} hasLastColSet>
32 <GridItem colSpan={2}>
34 data-test-id="nic-protocols"
35 label={i18n('Protocols')}
38 isValid={qgenericFieldInfo['protocols/protocols'].isValid}
40 qgenericFieldInfo['protocols/protocols'].errorText
42 onInputChange={() => {}}
43 onEnumChange={protocols => {
44 onQDataChanged({ 'protocols/protocols': protocols });
46 multiSelectedEnum={dataMap['protocols/protocols']}
48 values={qgenericFieldInfo['protocols/protocols'].enum}
51 <GridItem colSpan={2} lastColInRow>
53 data-test-id="nic-protocolWithHighestTrafficProfile"
54 label={i18n('Protocol with Highest Traffic Profile')}
56 groupClassName="bootstrap-input-options"
57 className="input-options-select"
60 'protocols/protocolWithHighestTrafficProfile'
65 'protocols/protocolWithHighestTrafficProfile'
69 dataMap['protocols/protocolWithHighestTrafficProfile']
72 const selectedIndex = e.target.selectedIndex;
73 const val = e.target.options[selectedIndex].value;
75 'protocols/protocolWithHighestTrafficProfile': val
78 {protocols.length === 0 && (
80 key={'You must select protocols first...'}
82 {i18n('You must select protocols first...')}
85 {protocols.map(protocol => (
86 <option key={protocol} value={protocol}>
96 Protocols.propTypes = {
97 protocols: PropTypes.array,
98 onQDataChanged: PropTypes.func,
99 dataMap: PropTypes.object,
100 qgenericFieldInfo: PropTypes.object
103 export default Protocols;