summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx52
1 files changed, 29 insertions, 23 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx
index 02f8d50c5c..ec45258eb9 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx
@@ -1,17 +1,17 @@
-/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+/*
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing
- * permissions and limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
import React from 'react';
import VendorItem from './VendorItem.jsx';
@@ -30,24 +30,27 @@ const VendorList = ({
onVendorSelect,
filter,
onMigrate,
- users
+ users,
+ isArchived
}) => {
+ const showAddButtons = !isArchived;
+ const handeleSelectVSP = vsp => onSelectVSP(vsp, users);
+ const handleOnVspButtonClick = (hasVSP, vlm) =>
+ onVspOverlayChange(vlm.id === currentOverlay || !hasVSP ? null : vlm);
+
return (
- <CatalogList onAddVLM={onAddVLM} onAddVSP={onAddVSP}>
+ <CatalogList
+ onAddVLM={showAddButtons ? onAddVLM : false}
+ onAddVSP={showAddButtons ? onAddVSP : false}>
{filterCatalogItemsByType({ items: licenseModelList, filter }).map(
vlm => (
<VendorItem
key={vlm.id}
+ vlm={vlm}
onAddVSP={onAddVSP}
- onSelectVSP={vsp => onSelectVSP(vsp, users)}
+ onSelectVSP={handeleSelectVSP}
shouldShowOverlay={currentOverlay === vlm.id}
- onVSPButtonClick={hasVSP =>
- onVspOverlayChange(
- vlm.id === currentOverlay || !hasVSP
- ? null
- : vlm
- )
- }
+ onVSPButtonClick={handleOnVspButtonClick}
onVendorSelect={onVendorSelect}
onMigrate={onMigrate}
vendor={vlm}
@@ -66,21 +69,24 @@ const SoftwareProductListByVendor = ({
onSelectVLM,
filter,
onMigrate,
- users
+ users,
+ isArchived
}) => {
+ const handleAddVsp = !isArchived
+ ? () => onAddVSP(selectedVendor.id)
+ : false;
+ const handleOnSelect = () => onSelectVLM(selectedVendor, users);
return (
<div>
<CatalogList
- onAddVSP={() => {
- onAddVSP(selectedVendor.id);
- }}
+ onAddVSP={handleAddVsp}
vendorPageOptions={{
selectedVendor,
onBack: () => onVendorSelect(false)
}}>
<CatalogItemDetails
key={selectedVendor.id}
- onSelect={() => onSelectVLM(selectedVendor, users)}
+ onSelect={handleOnSelect}
catalogItemTypeClass={catalogItemTypes.LICENSE_MODEL}
onMigrate={onMigrate}
catalogItemData={selectedVendor}