Einav Weiss Keidar | 1801b24 | 2018-08-13 16:19:46 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2016-2018 European Support Limited |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 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 | * |
Einav Weiss Keidar | 1801b24 | 2018-08-13 16:19:46 +0300 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 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, |
Einav Weiss Keidar | 1801b24 | 2018-08-13 16:19:46 +0300 | [diff] [blame] | 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. |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 15 | */ |
| 16 | import React from 'react'; |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 17 | import PropTypes from 'prop-types'; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 18 | import classNames from 'classnames'; |
| 19 | |
Einav Weiss Keidar | 1801b24 | 2018-08-13 16:19:46 +0300 | [diff] [blame] | 20 | import { selectedButton } from './LicenseModelOverviewConstants.js'; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 21 | |
| 22 | import SummaryView from './SummaryView.jsx'; |
| 23 | import VLMListView from './VLMListView.jsx'; |
| 24 | import ListButtons from './summary/ListButtons.jsx'; |
| 25 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 26 | class LicenseModelOverviewView extends React.Component { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 27 | static propTypes = { |
| 28 | isDisplayModal: PropTypes.bool, |
| 29 | isReadOnlyMode: PropTypes.bool, |
| 30 | licenseModelId: PropTypes.string, |
| 31 | licensingDataList: PropTypes.array, |
| 32 | orphanDataList: PropTypes.array, |
| 33 | modalHeader: PropTypes.string, |
| 34 | selectedTab: PropTypes.string, |
| 35 | onTabSelect: PropTypes.func, |
| 36 | onCallVCAction: PropTypes.func, |
| 37 | onClose: PropTypes.func |
| 38 | }; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 39 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 40 | render() { |
| 41 | let { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 42 | licensingDataList, |
| 43 | selectedTab, |
| 44 | onTabSelect, |
| 45 | orphanDataList, |
| 46 | isReadOnlyMode |
| 47 | } = this.props; |
| 48 | let selectedInUse = selectedTab !== selectedButton.NOT_IN_USE; |
| 49 | let dataList = selectedInUse ? licensingDataList : orphanDataList; |
| 50 | return ( |
| 51 | <div className="license-model-overview"> |
| 52 | <SummaryView isReadOnlyMode={isReadOnlyMode} /> |
| 53 | <div |
| 54 | className={classNames( |
| 55 | 'overview-list-section ', |
| 56 | !selectedInUse ? 'overview-list-orphans' : '' |
| 57 | )}> |
| 58 | <div className="vlm-list-tab-panel"> |
| 59 | <ListButtons |
| 60 | onTabSelect={onTabSelect} |
| 61 | selectedTab={selectedTab} |
| 62 | hasOrphans={orphanDataList.length > 0} |
| 63 | hasLicensing={licensingDataList.length > 0} |
| 64 | /> |
| 65 | </div> |
| 66 | <VLMListView |
| 67 | licensingDataList={dataList} |
| 68 | showInUse={selectedInUse} |
| 69 | /> |
| 70 | </div> |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 71 | </div> |
| 72 | ); |
| 73 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 74 | } |
| 75 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 76 | export default LicenseModelOverviewView; |