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 i18n from 'nfvo-utils/i18n/i18n.js';
18 import DetailsCatalogView from 'sdc-app/onboarding/onboard/DetailsCatalogView.jsx';
19 import VendorCatalogView from './VendorCatalogView.jsx';
20 import { tabsMapping } from './OnboardingCatalogConstants.js';
21 import { tabsMapping as WCTabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
23 const CatalogHeader = () => (
24 <div className="catalog-header">
25 <div className="catalog-header-tabs">
26 <div className="catalog-header-tab active">
27 {i18n('ONBOARD CATALOG')}
33 class OnboardingCatalogView extends React.Component {
34 renderViewByTab(activeTab) {
39 onSelectSoftwareProduct,
40 onAddLicenseModelClick,
41 onAddSoftwareProductClick,
51 const { vlmList, vspList } = filteredItems;
54 case tabsMapping.ARCHIVE:
55 case tabsMapping.ACTIVE:
61 onAddVLM={!isArchived && onAddLicenseModelClick}
62 onAddVSP={!isArchived && onAddSoftwareProductClick}
63 onSelectVLM={(item, users) =>
70 onSelectVSP={(item, users) =>
71 onSelectSoftwareProduct(
82 case tabsMapping.BY_VENDOR:
86 isArchived={isArchived}
87 licenseModelList={vlmList}
89 onAddVSP={onAddSoftwareProductClick}
90 onAddVLM={onAddLicenseModelClick}
91 onSelectVSP={(item, users) =>
92 onSelectSoftwareProduct(
98 onSelectVLM={(item, users) =>
102 WCTabsMapping.CATALOG
105 vspOverlay={vspOverlay}
106 onVendorSelect={onVendorSelect}
107 selectedVendor={selectedVendor}
108 onVspOverlayChange={onVspOverlayChange}
109 onMigrate={onMigrate}
117 const { selectedVendor, catalogActiveTab: activeTab } = this.props;
119 <div className="catalog-wrapper">
120 {!selectedVendor && <CatalogHeader />}
121 {this.renderViewByTab(activeTab)}
127 export default OnboardingCatalogView;