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>
---
 .../licenseModel/overview/VLMListView.jsx          | 202 +++++++++++----------
 1 file changed, 109 insertions(+), 93 deletions(-)

(limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/VLMListView.jsx')

diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/VLMListView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/VLMListView.jsx
index 012bd6e158..d91960e6a3 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/VLMListView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/overview/VLMListView.jsx
@@ -13,114 +13,130 @@
  * or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
-import React, {Component} from 'react';
+import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-import {Collapse} from 'react-bootstrap';
+import { Collapse } from 'react-bootstrap';
 import LicenseAgreement from './listItems/LicenseAgreement.jsx';
 import EntitlementPool from './listItems/EntitlementPool.jsx';
 import FeatureGroup from './listItems/FeatureGroup.jsx';
 import LicenseKeyGroup from './listItems/LicenseKeyGroup.jsx';
-import {overviewEditorHeaders} from './LicenseModelOverviewConstants.js';
+import { overviewEditorHeaders } from './LicenseModelOverviewConstants.js';
 
 class VLMListView extends Component {
+    static propTypes = {
+        licensingDataList: PropTypes.array,
+        showInUse: PropTypes.bool
+    };
 
-	static propTypes = {
-		licensingDataList: PropTypes.array,
-		showInUse: PropTypes.bool
-	};
+    state = {};
 
-	state = {
+    render() {
+        let { licensingDataList = [] } = this.props;
+        return (
+            <div className="vlm-list-view">
+                <div>
+                    <ul className="vlm-list" data-test-id="vlm-list">
+                        {licensingDataList.map(item =>
+                            this.renderLicensingItem(item)
+                        )}
+                    </ul>
+                </div>
+            </div>
+        );
+    }
 
-	};
+    renderLicensingItem(item) {
+        switch (item.itemType) {
+            case overviewEditorHeaders.LICENSE_AGREEMENT:
+                return this.renderLicenseAgreementItem(item);
+            case overviewEditorHeaders.FEATURE_GROUP:
+                return this.renderFeatureGroupItem(item);
+            case overviewEditorHeaders.LICENSE_KEY_GROUP:
+                return this.renderLicenseKeyGroupItem(item);
+            case overviewEditorHeaders.ENTITLEMENT_POOL:
+                return this.renderEntitlementPoolItem(item);
+            default:
+                return;
+        }
+    }
 
-	render() {
-		let {licensingDataList = []} = this.props;
-		return (
-			<div className='vlm-list-view'>
-				<div>
-					<ul className='vlm-list' data-test-id='vlm-list'>
-						{licensingDataList.map(item => this.renderLicensingItem(item))}
-					</ul>
-				</div>
-			</div>
-		);
-	}
+    renderLicenseAgreementItem(licenseAgreement) {
+        return (
+            <li key={licenseAgreement.id}>
+                <LicenseAgreement
+                    laData={licenseAgreement}
+                    isCollapsed={this.state[licenseAgreement.id]}
+                    onClick={event =>
+                        this.updateCollapsable(event, licenseAgreement.id)
+                    }
+                    isOrphan={!this.props.showInUse}
+                />
+                <Collapse in={this.state[licenseAgreement.id]}>
+                    <ul>
+                        {licenseAgreement.children &&
+                            licenseAgreement.children.map(item =>
+                                this.renderLicensingItem(item)
+                            )}
+                    </ul>
+                </Collapse>
+            </li>
+        );
+    }
 
-	renderLicensingItem(item) {
-		switch (item.itemType) {
-			case overviewEditorHeaders.LICENSE_AGREEMENT :
-				return this.renderLicenseAgreementItem(item);
-			case overviewEditorHeaders.FEATURE_GROUP :
-				return this.renderFeatureGroupItem(item);
-			case overviewEditorHeaders.LICENSE_KEY_GROUP :
-				return this.renderLicenseKeyGroupItem(item);
-			case overviewEditorHeaders.ENTITLEMENT_POOL:
-				return this.renderEntitlementPoolItem(item);
-			default:
-				return;
-		}
-	}
+    renderFeatureGroupItem(featureGroup) {
+        const { showInUse } = this.props;
+        return (
+            <li key={featureGroup.id}>
+                <FeatureGroup
+                    fgData={featureGroup}
+                    isCollapsed={this.state[featureGroup.id]}
+                    onClick={event =>
+                        this.updateCollapsable(event, featureGroup.id)
+                    }
+                    isOrphan={!this.props.showInUse}
+                />
+                {showInUse && (
+                    <Collapse in={this.state[featureGroup.id]}>
+                        <ul>
+                            {featureGroup.children &&
+                                featureGroup.children.map(item =>
+                                    this.renderLicensingItem(item)
+                                )}
+                        </ul>
+                    </Collapse>
+                )}
+            </li>
+        );
+    }
 
-	renderLicenseAgreementItem(licenseAgreement) {
-		return (
-			<li  key={licenseAgreement.id}>
-				<LicenseAgreement
-					laData={licenseAgreement}
-					isCollapsed={this.state[licenseAgreement.id]}
-					onClick={event => this.updateCollapsable(event, licenseAgreement.id) }
-					isOrphan={!this.props.showInUse}/>
-				<Collapse in={this.state[licenseAgreement.id]}>
-					<ul>
-						{licenseAgreement.children && licenseAgreement.children.map(item => this.renderLicensingItem(item))}
-					</ul>
-				</Collapse>
-			</li>
-		);
-	}
+    renderEntitlementPoolItem(entitlementPool) {
+        return (
+            <li key={entitlementPool.id}>
+                <EntitlementPool
+                    epData={entitlementPool}
+                    isOrphan={!this.props.showInUse}
+                />
+            </li>
+        );
+    }
 
-	renderFeatureGroupItem(featureGroup) {
-		const {showInUse} = this.props;
-		return (
-			<li key={featureGroup.id}>
-				<FeatureGroup
-					fgData={featureGroup}
-					isCollapsed={this.state[featureGroup.id]}
-					onClick={event=> this.updateCollapsable(event, featureGroup.id) }
-					isOrphan={!this.props.showInUse}/>
-				{
-					showInUse && <Collapse in={this.state[featureGroup.id]}>
-					<ul>
-						{featureGroup.children && featureGroup.children.map(item => this.renderLicensingItem(item))}
+    renderLicenseKeyGroupItem(licenseKeyGroup) {
+        return (
+            <li key={licenseKeyGroup.id}>
+                <LicenseKeyGroup
+                    lkgData={licenseKeyGroup}
+                    isOrphan={!this.props.showInUse}
+                />
+            </li>
+        );
+    }
 
-					</ul>
-				</Collapse>
-				}
-			</li>
-		);
-	}
-
-	renderEntitlementPoolItem(entitlementPool) {
-		return (
-			<li key={entitlementPool.id}>
-				<EntitlementPool epData={entitlementPool} isOrphan={!this.props.showInUse}/>
-			</li>
-		);
-	}
-
-	renderLicenseKeyGroupItem(licenseKeyGroup) {
-		return (
-			<li key={licenseKeyGroup.id}>
-				<LicenseKeyGroup lkgData={licenseKeyGroup} isOrphan={!this.props.showInUse}/>
-			</li>
-		);
-	}
-
-	updateCollapsable(event, id) {
-		event.stopPropagation();
-		let obj = {};
-		obj[id] = !this.state[id];
-		this.setState(obj);
-	}
+    updateCollapsable(event, id) {
+        event.stopPropagation();
+        let obj = {};
+        obj[id] = !this.state[id];
+        this.setState(obj);
+    }
 }
 
 export default VLMListView;
-- 
cgit 1.2.3-korg

