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 classNames from 'classnames';
20 import { selectedButton } from './LicenseModelOverviewConstants.js';
22 import SummaryView from './SummaryView.jsx';
23 import VLMListView from './VLMListView.jsx';
24 import ListButtons from './summary/ListButtons.jsx';
26 class LicenseModelOverviewView extends React.Component {
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
48 let selectedInUse = selectedTab !== selectedButton.NOT_IN_USE;
49 let dataList = selectedInUse ? licensingDataList : orphanDataList;
51 <div className="license-model-overview">
52 <SummaryView isReadOnlyMode={isReadOnlyMode} />
54 className={classNames(
55 'overview-list-section ',
56 !selectedInUse ? 'overview-list-orphans' : ''
58 <div className="vlm-list-tab-panel">
60 onTabSelect={onTabSelect}
61 selectedTab={selectedTab}
62 hasOrphans={orphanDataList.length > 0}
63 hasLicensing={licensingDataList.length > 0}
67 licensingDataList={dataList}
68 showInUse={selectedInUse}
76 export default LicenseModelOverviewView;