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,
52 const { vlmList, vspList } = filteredItems;
55 case tabsMapping.ARCHIVE:
56 case tabsMapping.ACTIVE:
62 onAddVLM={!isArchived && onAddLicenseModelClick}
63 onAddVSP={!isArchived && onAddSoftwareProductClick}
64 onSelectVLM={(item, users) =>
71 onSelectVSP={(item, users) =>
72 onSelectSoftwareProduct(
78 activeTabName={activeTabName}
84 case tabsMapping.BY_VENDOR:
88 isArchived={isArchived}
89 licenseModelList={vlmList}
91 onAddVSP={onAddSoftwareProductClick}
92 onAddVLM={onAddLicenseModelClick}
93 onSelectVSP={(item, users) =>
94 onSelectSoftwareProduct(
100 onSelectVLM={(item, users) =>
101 onSelectLicenseModel(
104 WCTabsMapping.CATALOG
107 vspOverlay={vspOverlay}
108 onVendorSelect={onVendorSelect}
109 selectedVendor={selectedVendor}
110 onVspOverlayChange={onVspOverlayChange}
111 onMigrate={onMigrate}
112 activeTabName={activeTabName}
120 const { selectedVendor, catalogActiveTab: activeTab } = this.props;
122 <div className="catalog-wrapper">
123 {!selectedVendor && <CatalogHeader />}
124 {this.renderViewByTab(activeTab)}
130 export default OnboardingCatalogView;