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 PropTypes from 'prop-types';
18 import i18n from 'nfvo-utils/i18n/i18n.js';
22 } from './onboardingCatalog/OnboardingCatalogConstants.js';
29 } from 'onap-ui-react';
30 import { TooltipWrapper } from './onboardingCatalog/Tooltip.jsx';
32 const ITEM_TYPE_MAP = {
33 [catalogItemTypes.LICENSE_MODEL]: {
34 headerText: i18n('VLM'),
35 contentIconName: 'vlm',
38 [catalogItemTypes.SOFTWARE_PRODUCT]: {
39 headerText: i18n('VSP'),
40 contentIconName: 'vsp',
45 const CatalogItemDetails = ({
51 let { vendorName, name, owner } = catalogItemData;
52 let { headerText, color, contentIconName } = ITEM_TYPE_MAP[
60 catalogItemData.isOldVersion &&
61 catalogItemData.isOldVersion === migrationStatusMapper.OLD_VERSION
63 onMigrate({ softwareProduct: catalogItemData });
71 headerText={headerText}
73 iconName={contentIconName}
76 dataTestId={catalogItemTypeClass}>
77 <TileInfo data-test-id="catalog-item-content">
79 <TileInfoLine type="supertitle">
81 className="with-overlay"
82 tooltipClassName="tile-super-info"
83 dataTestId="catalog-item-vendor-name">
88 <TileInfoLine type="title">
90 className="with-overlay"
91 tooltipClassName="catalog-tile-tooltip"
92 dataTestId="catalog-item-name">
98 {owner && <TileFooterCell>Owner - {owner}</TileFooterCell>}
104 CatalogItemDetails.propTypes = {
105 catalogItemData: PropTypes.object,
106 catalogItemTypeClass: PropTypes.string,
107 onSelect: PropTypes.func,
108 onMigrate: PropTypes.func
111 export default CatalogItemDetails;