[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-ui / src / sdc-app / onboarding / licenseModel / overview / listItems / FeatureGroup.jsx
1 /*!
2  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 import React, {Component} from 'react';
17 import {overviewEditorHeaders} from '../LicenseModelOverviewConstants.js';
18 import ArrowCol from './listItemsComponents/ArrowCol.jsx';
19 import ItemInfo from './listItemsComponents/ItemInfo.jsx';
20 import IconCol from './listItemsComponents/IconCol.jsx';
21
22 class FeatureGroup extends Component {
23         render() {
24                 let {fgData: {name, description, children = []}, isCollapsed, onClick} = this.props;
25                 return (
26                         <div onClick={e => onClick(e)} className='vlm-list-item vlm-list-item-fg' data-test-id='vlm-list-item-fg'>
27                                 <ArrowCol isCollapsed={isCollapsed} length={children.length} />
28                                 <IconCol className='fg-icon'/>
29                                 <ItemInfo name={name} description={description}>
30                                         <div className='children-count'>
31                                                 <span className='count-value'>
32                                                         Entitlement Pools:
33                                                         <span data-test-id='vlm-list-ep-count-value'>
34                                                                 {`${children.filter(child => child.itemType === overviewEditorHeaders.ENTITLEMENT_POOL).length}`}
35                                                         </span>
36                                                 </span>
37                                                 <span className='count-value'>
38                                                                 License Key Groups:
39                                                                 <span data-test-id='vlm-list-lkg-count-value'>
40                                                                         {`${children.filter(child => child.itemType === overviewEditorHeaders.LICENSE_KEY_GROUP).length}`}
41                                                                 </span>
42                                                 </span>
43                                         </div>
44                                 </ItemInfo>
45                         </div>
46                 );
47         }
48 }
49
50 export default FeatureGroup;