From 7fdf733a64670fceefc3ded35cfa581e1c458179 Mon Sep 17 00:00:00 2001
From: Einav Weiss Keidar <einavw@amdocs.com>
Date: Tue, 20 Mar 2018 14:45:40 +0200
Subject: Adding Prettier and fixing up eslint version

Issue-ID: SDC-1094
Change-Id: Ie83ad95a03899345dd90235daf0323cbe3bc6afd
Signed-off-by: Einav Weiss Keidar <einavw@amdocs.com>
---
 .../onboarding/onboard/CatalogItemDetails.jsx      | 137 ++++++++++++---------
 1 file changed, 81 insertions(+), 56 deletions(-)

(limited to 'openecomp-ui/src/sdc-app/onboarding/onboard/CatalogItemDetails.jsx')

diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/CatalogItemDetails.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/CatalogItemDetails.jsx
index 345c91e01b..7f361d2742 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/CatalogItemDetails.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/CatalogItemDetails.jsx
@@ -16,71 +16,96 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 import i18n from 'nfvo-utils/i18n/i18n.js';
-import {catalogItemTypes, migrationStatusMapper} from './onboardingCatalog/OnboardingCatalogConstants.js';
-import {Tile, TileInfo, TileInfoLine, TileFooter, TileFooterCell} from 'sdc-ui/lib/react';
-import {TooltipWrapper} from './onboardingCatalog/Tooltip.jsx';
+import {
+    catalogItemTypes,
+    migrationStatusMapper
+} from './onboardingCatalog/OnboardingCatalogConstants.js';
+import {
+    Tile,
+    TileInfo,
+    TileInfoLine,
+    TileFooter,
+    TileFooterCell
+} from 'sdc-ui/lib/react';
+import { TooltipWrapper } from './onboardingCatalog/Tooltip.jsx';
 
 const ITEM_TYPE_MAP = {
-	[catalogItemTypes.LICENSE_MODEL]: {
-		headerText: i18n('VLM'),
-		contentIconName: 'vlm',
-		color: 'purple'
-	},
-	[catalogItemTypes.SOFTWARE_PRODUCT]: {
-		headerText: i18n('VSP'),
-		contentIconName: 'vsp',
-		color: 'blue'
-	}
+    [catalogItemTypes.LICENSE_MODEL]: {
+        headerText: i18n('VLM'),
+        contentIconName: 'vlm',
+        color: 'purple'
+    },
+    [catalogItemTypes.SOFTWARE_PRODUCT]: {
+        headerText: i18n('VSP'),
+        contentIconName: 'vsp',
+        color: 'blue'
+    }
 };
 
-const CatalogItemDetails = ({catalogItemData, catalogItemTypeClass, onSelect, onMigrate}) => {
+const CatalogItemDetails = ({
+    catalogItemData,
+    catalogItemTypeClass,
+    onSelect,
+    onMigrate
+}) => {
+    let { vendorName, name, owner } = catalogItemData;
+    let { headerText, color, contentIconName } = ITEM_TYPE_MAP[
+        catalogItemTypeClass
+    ];
 
-	let {vendorName, name, owner} = catalogItemData;
-	let {headerText, color, contentIconName} = ITEM_TYPE_MAP[catalogItemTypeClass];
-
-	let onClick = (e) => {
-		e.stopPropagation();
-		e.preventDefault();
-		if (catalogItemData.isOldVersion && catalogItemData.isOldVersion === migrationStatusMapper.OLD_VERSION) {
-			onMigrate({softwareProduct: catalogItemData});
-		} else {
-			onSelect();
-		}
-	};
-
-	return (
-		<Tile
-			headerText={headerText}
-			headerColor={color}
-			iconName={contentIconName}
-			iconColor={color}
-			onClick={onClick}
-			dataTestId={catalogItemTypeClass}>
-			<TileInfo data-test-id='catalog-item-content'>
-				{vendorName &&
-					<TileInfoLine type='supertitle'>
-						<TooltipWrapper className='with-overlay' tooltipClassName='tile-super-info' dataTestId='catalog-item-vendor-name'>{vendorName}</TooltipWrapper>
-					</TileInfoLine>
-				}
-				<TileInfoLine type='title'>
-					<TooltipWrapper className='with-overlay' tooltipClassName='tile-title-info' dataTestId='catalog-item-name'>{name}</TooltipWrapper>
-				</TileInfoLine>
-			</TileInfo>
-				<TileFooter>
-				{owner &&
-					<TileFooterCell>Owner - {owner}</TileFooterCell>
-				}
-				</TileFooter>
-		</Tile>
-	);
+    let onClick = e => {
+        e.stopPropagation();
+        e.preventDefault();
+        if (
+            catalogItemData.isOldVersion &&
+            catalogItemData.isOldVersion === migrationStatusMapper.OLD_VERSION
+        ) {
+            onMigrate({ softwareProduct: catalogItemData });
+        } else {
+            onSelect();
+        }
+    };
 
+    return (
+        <Tile
+            headerText={headerText}
+            headerColor={color}
+            iconName={contentIconName}
+            iconColor={color}
+            onClick={onClick}
+            dataTestId={catalogItemTypeClass}>
+            <TileInfo data-test-id="catalog-item-content">
+                {vendorName && (
+                    <TileInfoLine type="supertitle">
+                        <TooltipWrapper
+                            className="with-overlay"
+                            tooltipClassName="tile-super-info"
+                            dataTestId="catalog-item-vendor-name">
+                            {vendorName}
+                        </TooltipWrapper>
+                    </TileInfoLine>
+                )}
+                <TileInfoLine type="title">
+                    <TooltipWrapper
+                        className="with-overlay"
+                        tooltipClassName="tile-title-info"
+                        dataTestId="catalog-item-name">
+                        {name}
+                    </TooltipWrapper>
+                </TileInfoLine>
+            </TileInfo>
+            <TileFooter>
+                {owner && <TileFooterCell>Owner - {owner}</TileFooterCell>}
+            </TileFooter>
+        </Tile>
+    );
 };
 
 CatalogItemDetails.PropTypes = {
-	catalogItemData: PropTypes.obj,
-	catalogItemTypeClass: PropTypes.string,
-	onSelect: PropTypes.func,
-	onMigrate: PropTypes.func
+    catalogItemData: PropTypes.obj,
+    catalogItemTypeClass: PropTypes.string,
+    onSelect: PropTypes.func,
+    onMigrate: PropTypes.func
 };
 
 export default CatalogItemDetails;
-- 
cgit 1.2.3-korg

