2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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
13 * or implied. See the License for the specific language governing
14 * permissions and limitations under the License.
16 import React from 'react';
17 import i18n from 'nfvo-utils/i18n/i18n.js';
18 import Input from 'nfvo-components/input/validation/Input.jsx';
19 import GridSection from 'nfvo-components/grid/GridSection.jsx';
20 import GridItem from 'nfvo-components/grid/GridItem.jsx';
23 const GuestOs = ({qgenericFieldInfo, dataMap, onQDataChanged}) => {
26 <GridSection title={i18n('Guest OS')} >
28 <div className='vertical-flex'>
29 <label key='label' className='control-label'>{i18n('OS Bit Size')}</label>
30 <div className='radio-options-content-row'>
31 {qgenericFieldInfo['compute/guestOS/bitSize'].enum.map(bitSize => (
33 data-test-id='guestOS-bitSize'
36 name={'compute/guestOS/bitSize'}
37 className='radio-field'
40 onChange={(bit) => onQDataChanged({'compute/guestOS/bitSize' : Number(bit)})}
41 isValid={qgenericFieldInfo['compute/guestOS/bitSize'].isValid}
42 errorText={qgenericFieldInfo['compute/guestOS/bitSize'].errorText}
43 checked={dataMap['compute/guestOS/bitSize'] === bitSize.enum} /> )) }
47 <GridItem colSpan={2}/>
48 <GridItem colSpan={2}>
50 data-test-id='guestOS-name'
51 label={i18n('Guest OS')}
53 onChange={(tools) => onQDataChanged({'compute/guestOS/name' : tools})}
54 isValid={qgenericFieldInfo['compute/guestOS/name'].isValid}
55 errorText={qgenericFieldInfo['compute/guestOS/name'].errorText}
56 value={dataMap['compute/guestOS/name']} />
58 <GridItem colSpan={2}>
60 data-test-id='guestOS-tools'
62 label={i18n('Guest OS Tools:')}
63 onChange={(tools) => onQDataChanged({'compute/guestOS/tools' : tools})}
64 isValid={qgenericFieldInfo['compute/guestOS/tools'].isValid}
65 errorText={qgenericFieldInfo['compute/guestOS/tools'].errorText}
66 value={dataMap['compute/guestOS/tools']} />
75 export default GuestOs;