aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-10-18 14:34:47 +0300
committerEinav Keidar <einavw@amdocs.com>2018-10-21 07:45:10 +0000
commit768f706f6f017ca605e0b292619e46b24fda1767 (patch)
tree762f59428389529ebffc22ae36c57898558d6e86 /openecomp-ui/src/sdc-app/onboarding/onboard/onboardingCatalog/VendorCatalogView.jsx
parent5cc93c4c9e4750a4630afa6f4509438ca4925f51 (diff)
vendor view issues fix
Issue-ID: SDC-1850 Change-Id: I13f39b82ea152399ccd43914c893856bc6063cb1 Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
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}