From 9a79dcedfaaf173d2f301bb18b1832a799b1bc2f Mon Sep 17 00:00:00 2001 From: svishnev Date: Wed, 7 Mar 2018 16:41:59 +0200 Subject: heat validation tabs and download fix Issue-ID: SDC-1084 Change-Id: I548c42c1cad316e336017269e6793d1750639e0a Signed-off-by: svishnev --- .../attachments/SoftwareProductAttachmentsView.jsx | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx') diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx index 90dd7692bf..4ced98f314 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx @@ -44,12 +44,12 @@ class HeatScreenView extends Component { return (
- {(activeTab === tabsMapping.SETUP) && - + onClick={()=>this.validate()}>{i18n('PROCEED TO VALIDATION')} } {candidateInProcess && onDownload({heatCandidate: heatSetup, isReadOnlyMode, version}) : undefined} + onClick={heatDataExist ? () => onDownload({heatCandidate: heatSetup, isReadOnlyMode: isReadOnlyMode || !candidateInProcess, version}) : undefined} data-test-id='download-heat'/> - + @@ -113,12 +113,10 @@ class HeatScreenView extends Component { } handleTabPress(key) { - let {heatSetup, heatSetupCache, onProcessAndValidate, isReadOnlyMode, version, setActiveTab} = this.props; + let {setActiveTab} = this.props; switch (key) { case tabsMapping.VALIDATION: - onProcessAndValidate({heatData: heatSetup, heatDataCache: heatSetupCache, isReadOnlyMode, version}).then( - () => setActiveTab({activeTab: tabsMapping.VALIDATION}) - ); + setActiveTab({activeTab: tabsMapping.VALIDATION}); return; case tabsMapping.SETUP: setActiveTab({activeTab: tabsMapping.SETUP}); @@ -139,7 +137,12 @@ class HeatScreenView extends Component { this.refs.hiddenImportFileInput.value = ''; this.props.onUpload(formData, version); } - + validate() { + let {heatSetup, heatSetupCache, onProcessAndValidate, isReadOnlyMode, version, setActiveTab} = this.props; + onProcessAndValidate({heatData: heatSetup, heatDataCache: heatSetupCache, isReadOnlyMode, version}).then( + () => setActiveTab({activeTab: tabsMapping.VALIDATION}) + ); + } save() { return this.props.onboardingOrigin === onboardingOriginTypes.ZIP ? -- cgit 1.2.3-korg