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 VendorItem from './VendorItem.jsx';
18 import CatalogList from '../CatalogList.jsx';
19 import CatalogItemDetails from '../CatalogItemDetails.jsx';
20 import { catalogItemTypes } from './OnboardingCatalogConstants.js';
21 import { filterCatalogItemsByType } from './OnboardingCatalogUtils.js';
27 licenseModelList = [],
28 vspOverlay: currentOverlay,
36 const showAddButtons = !isArchived;
37 const handeleSelectVSP = vsp => onSelectVSP(vsp, users);
38 const handleOnVspButtonClick = (hasVSP, vlm) =>
39 onVspOverlayChange(vlm.id === currentOverlay || !hasVSP ? null : vlm);
43 onAddVLM={showAddButtons ? onAddVLM : false}
44 onAddVSP={showAddButtons ? onAddVSP : false}>
45 {filterCatalogItemsByType({ items: licenseModelList, filter }).map(
51 onSelectVSP={handeleSelectVSP}
52 shouldShowOverlay={currentOverlay === vlm.id}
53 onVSPButtonClick={handleOnVspButtonClick}
54 onVendorSelect={onVendorSelect}
64 const SoftwareProductListByVendor = ({
75 const handleAddVsp = !isArchived
76 ? () => onAddVSP(selectedVendor.id)
78 const handleOnSelect = () => onSelectVLM(selectedVendor, users);
82 onAddVSP={handleAddVsp}
85 onBack: () => onVendorSelect(false)
88 key={selectedVendor.id}
89 onSelect={handleOnSelect}
90 catalogItemTypeClass={catalogItemTypes.LICENSE_MODEL}
92 catalogItemData={selectedVendor}
94 {filterCatalogItemsByType({
95 items: selectedVendor.softwareProductList,
100 catalogItemTypeClass={catalogItemTypes.SOFTWARE_PRODUCT}
101 onMigrate={onMigrate}
102 onSelect={() => onSelectVSP(vsp, users)}
103 catalogItemData={vsp}
111 class VendorCatalogView extends React.Component {
113 let { selectedVendor } = this.props;
114 return selectedVendor ? (
115 <SoftwareProductListByVendor {...this.props} />
117 <VendorList {...this.props} />
122 export default VendorCatalogView;