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 PointerInput = ({
32 <GridItem lastColInRow={lastColInRow}>
36 data-test-id={`${value}`}
37 isValid={qgenericFieldInfo[value].isValid}
38 errorText={qgenericFieldInfo[value].errorText}
39 value={dataMap[value]}
40 onChange={val => onQDataChanged({ [value]: val })}
46 PointerInput.propTypes = {
47 label: PropTypes.string,
48 value: PropTypes.string
51 const PacketsBytes = ({
59 <GridSection title={title} hasLastColSet>
60 <GridItem colSpan={2}>
61 <div className="part-title-small packets">
65 <GridItem colSpan={2} lastColInRow>
66 <div className="part-title-small bytes">{i18n('Bytes')}</div>
68 {pointers.map((pointer, i) => {
74 qgenericFieldInfo={qgenericFieldInfo}
75 onQDataChanged={onQDataChanged}
77 lastColInRow={i === 3}
85 PacketsBytes.PropTypes = {
86 title: PropTypes.string,
87 pointers: PropTypes.array,
88 onQDataChanged: PropTypes.function,
89 dataMap: PropTypes.object,
90 qgenericFieldInfo: PropTypes.object
93 export default PacketsBytes;