aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-02-12 09:10:35 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-02-13 08:14:17 +0000
commitf6784900012e11850d8e98bbf198f04bd0e411c7 (patch)
tree722fffa9ea325a1ff9b76eeb10b17fa1bc366a40 /openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments
parent7ce8756746b298e644eca57fa586bc20e880848a (diff)
heat validation flow
Issue-ID: SDC-1024 Change-Id: I4248fef46c7f8f5132644628f320231eeafe8070 Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js16
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx79
2 files changed, 62 insertions, 33 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js
index 234953ec3b..d942172973 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachments.js
@@ -1,5 +1,5 @@
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,7 +55,8 @@ export const mapStateToProps = (state) => {
HeatSetupComponent: HeatSetup,
version,
onboardingOrigin,
- activeTab
+ activeTab,
+ candidateInProcess: !!currentSoftwareProduct.candidateOnboardingOrigin
};
};
@@ -67,6 +68,8 @@ export const mapActionsToProps = (dispatch, {softwareProductId, version}) => {
data:{
msg: i18n('Upload will erase existing data. Do you want to continue?'),
confirmationButtonText: i18n('Continue'),
+ title: i18n('WARNING'),
+
onConfirmed: ()=>SoftwareProductActionHelper.uploadFile(dispatch, {
softwareProductId,
formData,
@@ -75,6 +78,15 @@ export const mapActionsToProps = (dispatch, {softwareProductId, version}) => {
})
}
}),
+ onUploadAbort: () => {
+ SoftwareProductActionHelper.abortCandidateValidation(dispatch, {softwareProductId, version})
+ .then(()=>{
+ ScreensHelper.loadScreen(dispatch, {
+ screen: enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, screenType: screenTypes.SOFTWARE_PRODUCT,
+ props: {softwareProductId, version}
+ });
+ });
+ },
onInvalidFileUpload: () => dispatch({
type: modalActionTypes.GLOBAL_MODAL_ERROR,
data: {
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 a23015732b..90dd7692bf 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx
@@ -1,5 +1,5 @@
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import {tabsMapping} from './SoftwareProductAttachmentsConstants.js';
import i18n from 'nfvo-utils/i18n/i18n.js';
import HeatValidation from './validation/HeatValidation.js';
import {onboardingOriginTypes} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
+import Button from 'sdc-ui/lib/react/Button.js';
class HeatScreenView extends Component {
@@ -30,40 +31,56 @@ class HeatScreenView extends Component {
setActiveTab: PropTypes.func
};
+ componentDidMount() {
+ if (!this.props.goToOverview && this.props.candidateInProcess) {
+ this.props.setActiveTab({activeTab: tabsMapping.VALIDATION});
+ }
+ }
+
render() {
- let {isValidationAvailable, isReadOnlyMode, heatDataExist, onDownload, softwareProductId, onProcessAndValidate,
- heatSetup, HeatSetupComponent, onGoToOverview, version, onboardingOrigin, activeTab, setActiveTab, ...other} = this.props;
+ let {isValidationAvailable, isReadOnlyMode, heatDataExist, onDownload, softwareProductId, onProcessAndValidate, onUploadAbort,
+ candidateInProcess, heatSetup, HeatSetupComponent, onGoToOverview, version, onboardingOrigin, activeTab, setActiveTab, ...other} = this.props;
return (
<div className='vsp-attachments-view'>
<div className='attachments-view-controllers'>
- {(activeTab === tabsMapping.SETUP) &&
- <SVGIcon
- disabled={heatDataExist ? false : true}
- name='download'
- className='icon-component'
- label={i18n('Export Validation')}
- labelPosition='right'
- color='secondary'
- onClick={heatDataExist ? () => onDownload({heatCandidate: heatSetup, isReadOnlyMode, version}) : undefined}
- data-test-id='download-heat'/>}
+ {(activeTab === tabsMapping.SETUP) &&
+ <Button btnType='outline'
+ data-test-id='proceed-to-validation-btn'
+ disabled={!isValidationAvailable}
+ className='proceed-to-validation-btn'
+ onClick={()=>this.handleTabPress(tabsMapping.VALIDATION)}>{i18n('PROCEED TO VALIDATION')}</Button>
+ }
+ {candidateInProcess && <SVGIcon
+ onClick={onUploadAbort}
+ name='close'
+ className='icon-component abort-btn'
+ label={i18n('ABORT')}
+ labelPosition='right'
+ color='secondary'
+ data-test-id='abort-btn'/>
+ }
+
{(activeTab === tabsMapping.VALIDATION && softwareProductId) &&
- <SVGIcon
+ <Button btnType='outline'
+ data-test-id='go-to-overview'
disabled={this.props.goToOverview !== true}
- onClick={this.props.goToOverview ? () => onGoToOverview({version}) : undefined}
- name='proceedToOverview'
- className='icon-component'
- label={i18n('Go to Overview')}
- labelPosition='right'
- color={this.props.goToOverview ? 'primary' : 'secondary'}
- data-test-id='go-to-overview'/>}
+ className='go-to-overview-btn'
+ onClick={this.props.goToOverview ? () => onGoToOverview({version}) : undefined}>{i18n('GO TO OVERVIEW')}</Button>}
+ <div className='separator'></div>
+ <SVGIcon
+ disabled={heatDataExist ? false : true}
+ name='download'
+ className='icon-component'
+ color='dark-gray'
+ onClick={heatDataExist ? () => onDownload({heatCandidate: heatSetup, isReadOnlyMode, version}) : undefined}
+ data-test-id='download-heat'/>
+
<SVGIcon
name='upload'
- className='icon-component'
- label={i18n('Upload New File')}
- labelPosition='right'
- color='secondary'
- disabled={isReadOnlyMode}
+ className='icon-component'
+ color='dark-gray'
+ disabled={isReadOnlyMode || candidateInProcess}
onClick={isReadOnlyMode ? undefined : evt => this.refs.hiddenImportFileInput.click(evt)}
data-test-id='upload-heat'/>
<input
@@ -73,11 +90,11 @@ class HeatScreenView extends Component {
accept='.zip, .csar'
onChange={evt => this.handleImport(evt)}/>
</div>
- <Tabs
- className='attachments-tabs'
- type='header'
- activeTab={activeTab}
- onTabClick={key => this.handleTabPress(key)}>
+ <Tabs
+ className='attachments-tabs'
+ type='header'
+ activeTab={activeTab}
+ onTabClick={key => this.handleTabPress(key)}>
<Tab tabId={tabsMapping.SETUP} title='Setup' disabled={onboardingOrigin === onboardingOriginTypes.CSAR}>
<HeatSetupComponent
heatDataExist={heatDataExist}