heat validation flow
Issue-ID: SDC-1024
Change-Id: I4248fef46c7f8f5132644628f320231eeafe8070
Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
diff --git a/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss b/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss
index 0ae3f00..ad98ec0 100644
--- a/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss
+++ b/openecomp-ui/resources/scss/modules/_softwareProductAttachmentPage.scss
@@ -24,13 +24,12 @@
.attachments-view-controllers {
position: absolute;
right: 40px;
- top: 15px;
+ top: 10px;
display: flex;
-
+
.icon-component {
- margin-right: 30px;
-
+ margin-right: 30px;
}
input[type="file"] {
@@ -39,6 +38,32 @@
padding: 0;
margin-left: -1px;
}
+
+ .proceed-to-validation-btn {
+ width: 191px;
+ margin-right: 30px;
+ height: 36px;
+ }
+ .go-to-overview-btn {
+ width: 191px;
+ margin-right: 36px;
+ height: 36px;
+ }
+ .separator {
+ height: 27px;
+ border: 1px solid $light-gray;
+ margin-right: 31px;
+ margin-left: 0px;
+ margin-top: 3px;
+ }
+ .abort-btn {
+ fill: $blue;
+ color: $blue;
+ &:hover {
+ color: $light-blue;
+ fill: $light-blue;
+ }
+ }
}
}
diff --git a/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.jsx b/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.jsx
index 02552fc..2eda7e6 100644
--- a/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.jsx
+++ b/openecomp-ui/src/nfvo-components/panel/NavigationSideBar.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.
@@ -23,7 +23,8 @@
activeItemId: PropTypes.string.isRequired,
onSelect: PropTypes.func,
onToggle: PropTypes.func,
- groups: PropTypes.array
+ groups: PropTypes.array,
+ disabled: PropTypes.bool
};
constructor(props) {
@@ -35,10 +36,10 @@
}
render() {
- let {groups, activeItemId} = this.props;
+ let {groups, activeItemId, disabled = false} = this.props;
return (
- <div className='navigation-side-content'>
+ <div className={`navigation-side-content ${disabled ? 'disabled' : ''}`}>
{groups.map(group => (
<NavigationMenu menu={group} activeItemId={activeItemId} onNavigationItemClick={this.handleItemClicked} key={'menu_' + group.id} />
))}
diff --git a/openecomp-ui/src/nfvo-components/panel/versionController/VersionController.jsx b/openecomp-ui/src/nfvo-components/panel/versionController/VersionController.jsx
index 5273785..fdc86d4 100644
--- a/openecomp-ui/src/nfvo-components/panel/versionController/VersionController.jsx
+++ b/openecomp-ui/src/nfvo-components/panel/versionController/VersionController.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.
@@ -43,10 +43,11 @@
render() {
let {version = {}, viewableVersions = [], onVersionSwitching, onMoreVersionsClick, callVCAction, onSave, isReadOnlyMode, itemPermission,
- isFormDataValid, onClose, onManagePermissions, permissions = {}, userInfo, usersList, itemName, onOpenCommentCommitModal, onOpenRevisionsModal, isManual} = this.props;
+ isFormDataValid, onClose, onManagePermissions, permissions = {}, userInfo, usersList, itemName,
+ onOpenCommentCommitModal, onOpenRevisionsModal, isManual, candidateInProcess} = this.props;
return (
<div className='version-controller-bar'>
- <div className='vc-container'>
+ <div className={`vc-container ${candidateInProcess ? 'disabled' : ''}`}>
<div className='version-status-container'>
<VersionSelector
viewableVersions={viewableVersions}
@@ -58,7 +59,7 @@
<ActionButtons onSubmit={callVCAction ? () => this.submit(callVCAction, version) : undefined}
onRevert={callVCAction ? () => this.revert(callVCAction, version) : undefined}
onOpenRevisionsModal={onOpenRevisionsModal}
- onSave={onSave ? () => onSave() : undefined}
+ onSave={onSave ? () => onSave() : undefined}
permissions={permissions}
userInfo={userInfo}
onManagePermissions={onManagePermissions}
@@ -70,7 +71,7 @@
onCommit={callVCAction ? (comment) => this.commit(callVCAction, version, comment) : undefined}
isFormDataValid={isFormDataValid}
itemPermissions={itemPermission}
- isReadOnlyMode={isReadOnlyMode}
+ isReadOnlyMode={isReadOnlyMode || candidateInProcess}
isManual={isManual} />
<div className='vc-separator'></div>
<NotificationsView />
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js
index cdaf189..683dd4f 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.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.
@@ -90,7 +90,7 @@
const buildNavigationBarProps = ({softwareProduct, meta, screen, componentId, componentsList, mapOfExpandedIds}) => {
const {softwareProductEditor: {data: currentSoftwareProduct = {}}} = softwareProduct;
- const {id, name, onboardingMethod, candidateOnboardingOrigin} = currentSoftwareProduct;
+ const {id, name, onboardingMethod, candidateOnboardingOrigin, onboardingOrigin} = currentSoftwareProduct;
const groups = [{
id: id,
name: name,
@@ -126,7 +126,7 @@
id: enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS,
name: i18n('Attachments'),
disabled: false,
- hidden: candidateOnboardingOrigin === onboardingOriginTypes.NONE,
+ hidden: !candidateOnboardingOrigin && !onboardingOrigin,
meta
}, {
id: enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG,
@@ -159,14 +159,14 @@
}];
let activeItemId = getActiveNavigationId(screen, componentId);
return {
- activeItemId, groups
+ activeItemId, groups, disabled: !!candidateOnboardingOrigin
};
};
const buildVersionControllerProps = ({softwareProduct, versions, currentVersion, permissions, userInfo, usersList, itemPermission, isReadOnlyMode}) => {
const {softwareProductEditor = {data: {}}} = softwareProduct;
- const {isValidityData = true, data: {name, onboardingMethod}} = softwareProductEditor;
-
+ const {isValidityData = true, data: {name, onboardingMethod, candidateOnboardingOrigin}} = softwareProductEditor;
+
return {
version: currentVersion,
viewableVersions: versions,
@@ -177,7 +177,8 @@
isReadOnlyMode,
userInfo,
usersList,
- isManual: onboardingMethod === onboardingMethodType.MANUAL
+ isManual: onboardingMethod === onboardingMethodType.MANUAL,
+ candidateInProcess: !!candidateOnboardingOrigin
};
};
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
index ebd660f..9ed6005 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
@@ -1,17 +1,17 @@
-/*
- * Copyright © 2016-2017 European Support Limited
+/*!
+ * 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.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
*/
import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
import showFileSaveDialog from 'nfvo-utils/ShowFileSaveDialog.js';
@@ -116,6 +116,10 @@
return RestAPIUtil.fetch(`${baseUrl()}${softwareProductId}/versions/${version.id}/orchestration-template-candidate`, {dataType: 'binary'});
}
+function abortValidationProcess(softwareProductId, version) {
+ return RestAPIUtil.destroy(`${baseUrl()}${softwareProductId}/versions/${version.id}/orchestration-template-candidate`);
+}
+
function objToString(obj) {
let str = '';
if (obj instanceof Array) {
@@ -242,6 +246,8 @@
if (response.status === 'Success') {
SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version});
SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version});
+ } else {
+ SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version});
}
});
},
@@ -267,6 +273,10 @@
screen: enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_SETUP, screenType: screenTypes.SOFTWARE_PRODUCT,
props: {softwareProductId, version}
});
+ dispatch({
+ type: actionTypes.CANDIDATE_IN_PROCESS,
+ inProcess: true
+ });
break;
case onboardingOriginTypes.CSAR:
ScreensHelper.loadScreen(dispatch, {
@@ -540,6 +550,10 @@
screen: enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, screenType: screenTypes.SOFTWARE_PRODUCT,
props: {softwareProductId, version: {id: newVer, label: newVer}}
}));
+ },
+
+ abortCandidateValidation(dispatch, {softwareProductId, version}) {
+ return abortValidationProcess(softwareProductId, version);
}
};
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js
index 7df4658..c824837 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductConstants.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.
@@ -24,6 +24,7 @@
SOFTWARE_PRODUCT_QUESTIONNAIRE_UPDATE: null,
LOAD_LICENSING_VERSIONS_LIST: null,
TOGGLE_NAVIGATION_ITEM: null,
+ CANDIDATE_IN_PROCESS: null,
softwareProductEditor: {
OPEN: null,
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 234953e..d942172 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 @@
HeatSetupComponent: HeatSetup,
version,
onboardingOrigin,
- activeTab
+ activeTab,
+ candidateInProcess: !!currentSoftwareProduct.candidateOnboardingOrigin
};
};
@@ -67,6 +68,8 @@
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 @@
})
}
}),
+ 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 a230157..90dd769 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 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 @@
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.VALIDATION && softwareProductId) &&
- <SVGIcon
- 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'/>}
- <SVGIcon
- name='upload'
- className='icon-component'
- label={i18n('Upload New File')}
+ {(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'
- disabled={isReadOnlyMode}
+ data-test-id='abort-btn'/>
+ }
+
+ {(activeTab === tabsMapping.VALIDATION && softwareProductId) &&
+ <Button btnType='outline'
+ data-test-id='go-to-overview'
+ disabled={this.props.goToOverview !== true}
+ 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'
+ 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 @@
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}
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.js
index 54dc1a4..1a29326 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.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.
@@ -50,6 +50,11 @@
...state,
licensingVersionsList: action.licensingVersionsList
};
+ case actionTypes.CANDIDATE_IN_PROCESS:
+ return {
+ ...state,
+ data: {...state.data, candidateOnboardingOrigin: true}
+ };
default:
return state;
}
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
index 90ea182..64e0d56 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.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.
@@ -27,7 +27,7 @@
softwareProduct,
licenseModel: {licenseAgreement},
}) => {
- let {softwareProductEditor: {data:currentSoftwareProduct = {}}, softwareProductComponents, softwareProductCategories = []} = softwareProduct;
+ let {softwareProductEditor: {data:currentSoftwareProduct = {}}, softwareProductComponents, softwareProductCategories = [], } = softwareProduct;
let {licensingData = {}} = currentSoftwareProduct;
let {licenseAgreementList} = licenseAgreement;
let {componentsList} = softwareProductComponents;
@@ -53,8 +53,8 @@
currentSoftwareProduct: {
...currentSoftwareProduct,
licenseAgreementName,
- fullCategoryDisplayName
- },
+ fullCategoryDisplayName
+ },
componentsList,
isManual: currentSoftwareProduct.onboardingMethod === onboardingMethod.MANUAL
};
@@ -67,7 +67,10 @@
screen: enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, screenType: screenTypes.SOFTWARE_PRODUCT,
props: {softwareProductId, version}
}),
-
+ onCandidateInProcess: (softwareProductId) => ScreensHelper.loadScreen(dispatch, {
+ screen: enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_SETUP, screenType: screenTypes.SOFTWARE_PRODUCT,
+ props: {softwareProductId, version}
+ }),
onUpload: (softwareProductId, formData) =>
SoftwareProductActionHelper.uploadFile(dispatch, {
softwareProductId,
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
index 76228b0..70c04f0 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx
@@ -1,17 +1,17 @@
-/*
- * Copyright © 2016-2017 European Support Limited
+/*!
+ * 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.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
@@ -65,7 +65,12 @@
onComponentSelect: PropTypes.func,
onAddComponent: PropTypes.func
};
-
+ componentDidMount() {
+ const {onCandidateInProcess, currentSoftwareProduct} = this.props;
+ if (currentSoftwareProduct.candidateOnboardingOrigin) {
+ onCandidateInProcess(currentSoftwareProduct.id);
+ }
+ }
render() {
let {currentSoftwareProduct, isReadOnlyMode, isManual, onDetailsSelect} = this.props;
return (
diff --git a/openecomp-ui/test/softwareProduct/attachments/validationFlow.test.js b/openecomp-ui/test/softwareProduct/attachments/validationFlow.test.js
new file mode 100644
index 0000000..b095aed
--- /dev/null
+++ b/openecomp-ui/test/softwareProduct/attachments/validationFlow.test.js
@@ -0,0 +1,40 @@
+/*!
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+import {VSPEditorFactoryWithLicensingData} from 'test-utils/factories/softwareProduct/SoftwareProductEditorFactories.js';
+import {storeCreator} from 'sdc-app/AppStore.js';
+import {actionTypes} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
+
+describe('SoftwareProduct Attachments - validation flow test: ', function () {
+
+ it('candidate in process flag test', () => {
+ const softwareProduct = VSPEditorFactoryWithLicensingData.build();
+ const store = storeCreator({
+ softwareProduct: {
+ softwareProductEditor: {data: softwareProduct},
+ softwareProductQuestionnaire: {qdata: 'test', qschema: {type: 'string'}}
+ }
+ });
+ store.dispatch({
+ type: actionTypes.CANDIDATE_IN_PROCESS,
+ inProcess: true
+ });
+ let unsubscribe = store.subscribe(() => {
+ expect(store.getState().softwareProduct.softwareProductEditor.data.onboardingOrigin).toEqual(true);
+ });
+ unsubscribe();
+ });
+
+});
\ No newline at end of file