From bf13de9e961a9cdbe6376982bdd611dc5be1333b Mon Sep 17 00:00:00 2001
From: ilanap <ilanap@amdocs.com>
Date: Mon, 23 Oct 2017 15:21:22 +0300
Subject: Readonly screen for limits

Issue-ID: SDC-494

Change-Id: I0f86e688801f65f376b3181518b97ee68462b1ef
Signed-off-by: ilanap <ilanap@amdocs.com>
---
 .../entitlementPools/EntitlementPoolsEditorView.jsx | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

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

diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorView.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorView.jsx
index aa1321c24a..8473c1a2be 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorView.jsx
@@ -245,6 +245,7 @@ class EntitlementPoolsEditorView extends React.Component {
 				<Tab disabled={isTabsDisabled} tabId={tabIds.SP_LIMITS} data-test-id='sp-limits-tab' title={i18n('SP Limits')}>
 					{selectedTab === tabIds.SP_LIMITS && 
 						<EntitlementPoolsLimits 
+							isReadOnlyMode={isReadOnlyMode}
 							limitType={limitType.SERVICE_PROVIDER} 
 							limitsList={limitsList.filter(item => item.type === limitType.SERVICE_PROVIDER)}
 							selectedLimit={this.state.selectedLimit}
@@ -254,19 +255,33 @@ class EntitlementPoolsEditorView extends React.Component {
 				<Tab disabled={isTabsDisabled} tabId={tabIds.VENDOR_LIMITS} data-test-id='vendor-limits-tab' title={i18n('Vendor Limits')}>
 					{selectedTab === tabIds.VENDOR_LIMITS && 
 						<EntitlementPoolsLimits 
+							isReadOnlyMode={isReadOnlyMode}
 							limitType={limitType.VENDOR} 
 							limitsList={limitsList.filter(item => item.type === limitType.VENDOR)}
 							selectedLimit={this.state.selectedLimit}
 							onCloseLimitEditor={() => this.onCloseLimitEditor()}
 							onSelectLimit={limit => this.onSelectLimit(limit)}/>}
 				</Tab>
-				{selectedTab !== tabIds.GENERAL ? 
-					<Button disabled={this.state.selectedLimit} className='add-limit-button' tabId={tabIds.ADD_LIMIT_BUTTON} btnType='link' iconName='plus'>{i18n('Add Limit')}</Button> : 
+				{
+					selectedTab !== tabIds.GENERAL ?
+						<Button
+							disabled={this.state.selectedLimit || isReadOnlyMode}
+							className='add-limit-button'
+							tabId={tabIds.ADD_LIMIT_BUTTON}
+							btnType='link'
+							iconName='plus'>
+							{i18n('Add Limit')}
+						</Button>
+					:
 					<div></div> // Render empty div to not break tabs
 				}
 			</Tabs>
 			<GridSection className='license-model-modal-buttons entitlement-pools-editor-buttons'>
-			{!this.state.selectedLimit && <Button btnType='default' disabled={!this.props.isFormValid} onClick={() => this.submit()} type='reset'>{i18n('Save')}</Button>}
+				{!this.state.selectedLimit &&
+					<Button btnType='default' disabled={!this.props.isFormValid || isReadOnlyMode} onClick={() => this.submit()} type='reset'>
+						{i18n('Save')}
+					</Button>
+				}
 			<Button btnType={this.state.selectedLimit ? 'default' : 'outline'} onClick={() => this.props.onCancel()} type='reset'>
 				{i18n('Cancel')}
 			</Button>
-- 
cgit 1.2.3-korg

