summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
diff options
context:
space:
mode:
authormiriame <miriam.eini@amdocs.com>2018-01-02 15:35:55 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-01-03 06:53:22 +0000
commitd411d156ac1960f059eb94ec5d7da8fa1a9edb86 (patch)
tree84bf021cfd81d8a61feda7839267ef2257cf011f /openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
parent9d79007d2b36d5ae4a03581eeca1fcf6232b3b09 (diff)
select item from workspace- skipping versions page
Change-Id: Iebd3bb33703c2d47265ba133f7b74ec961ba8b2f Issue-ID: SDC-864 Signed-off-by: miriame <miriam.eini@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx24
1 files changed, 14 insertions, 10 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
index 905712003a..06c95b0b2f 100644
--- a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
@@ -19,6 +19,7 @@ import ReactDOM from 'react-dom';
import {connect} from 'react-redux';
import isEqual from 'lodash/isEqual.js';
import objectValues from 'lodash/values.js';
+import lodashUnionBy from 'lodash/unionBy.js';
import i18n from 'nfvo-utils/i18n/i18n.js';
import Application from 'sdc-app/Application.jsx';
@@ -233,8 +234,11 @@ export default class OnboardingPunchOut {
handleData(data) {
let {breadcrumbs: {selectedKeys = []} = {}} = data;
let dispatch = action => store.dispatch(action);
- let {currentScreen, users: {usersList}, softwareProductList, licenseModelList, softwareProduct: {softwareProductEditor: {data: vspData = {}},
+ let {currentScreen, users: {usersList}, softwareProductList, finalizedSoftwareProductList, licenseModelList, finalizedLicenseModelList,
+ softwareProduct: {softwareProductEditor: {data: vspData = {}},
softwareProductComponents = {}, softwareProductQuestionnaire = {}}} = store.getState();
+ const wholeSoftwareProductList = [...softwareProductList, ...finalizedSoftwareProductList];
+ const wholeLicenseModelList = [...licenseModelList, ...finalizedLicenseModelList];
let {props: {version, isReadOnlyMode}, screen} = currentScreen;
let {componentEditor: {data: componentData = {}, qdata: componentQData = {}}} = softwareProductComponents;
@@ -269,15 +273,15 @@ export default class OnboardingPunchOut {
} else if (selectedKeys.length === 1 || selectedKeys[1] === enums.BREADCRUMS.LICENSE_MODEL) {
let [licenseModelId, , licenseModelScreen] = selectedKeys;
- let licenseModel = licenseModelList.find(vlm => vlm.id === licenseModelId);
+ let licenseModel = wholeLicenseModelList.find(vlm => vlm.id === licenseModelId);
ScreensHelper.loadScreen(dispatch, {screen: licenseModelScreen, screenType: screenTypes.LICENSE_MODEL,
props: {licenseModelId, version, licenseModel, usersList}});
} else if (selectedKeys.length <= 4 && selectedKeys[1] === enums.BREADCRUMS.SOFTWARE_PRODUCT) {
let [licenseModelId, , softwareProductId, softwareProductScreen] = selectedKeys;
let softwareProduct = softwareProductId ?
- softwareProductList.find(({id}) => id === softwareProductId) :
- softwareProductList.find(({vendorId}) => vendorId === licenseModelId);
+ wholeSoftwareProductList.find(({id}) => id === softwareProductId) :
+ wholeSoftwareProductList.find(({vendorId}) => vendorId === licenseModelId);
if (!softwareProductId) {
softwareProductId = softwareProduct.id;
}
@@ -298,8 +302,8 @@ export default class OnboardingPunchOut {
} else if (selectedKeys.length === 5 && selectedKeys[1] === enums.BREADCRUMS.SOFTWARE_PRODUCT && selectedKeys[3] === enums.BREADCRUMS.SOFTWARE_PRODUCT_COMPONENTS) {
let [licenseModelId, , softwareProductId, , componentId] = selectedKeys;
let softwareProduct = softwareProductId ?
- softwareProductList.find(({id}) => id === softwareProductId) :
- softwareProductList.find(({vendorId}) => vendorId === licenseModelId);
+ wholeSoftwareProductList.find(({id}) => id === softwareProductId) :
+ wholeSoftwareProductList.find(({vendorId}) => vendorId === licenseModelId);
if (!softwareProductId) {
softwareProductId = softwareProduct.id;
}
@@ -309,8 +313,8 @@ export default class OnboardingPunchOut {
} else if (selectedKeys.length === 6 && selectedKeys[1] === enums.BREADCRUMS.SOFTWARE_PRODUCT && selectedKeys[3] === enums.BREADCRUMS.SOFTWARE_PRODUCT_COMPONENTS) {
let [licenseModelId, , softwareProductId, , componentId, componentScreen] = selectedKeys;
let softwareProduct = softwareProductId ?
- softwareProductList.find(({id}) => id === softwareProductId) :
- softwareProductList.find(({vendorId}) => vendorId === licenseModelId);
+ wholeSoftwareProductList.find(({id}) => id === softwareProductId) :
+ wholeSoftwareProductList.find(({vendorId}) => vendorId === licenseModelId);
if (!softwareProductId) {
softwareProductId = softwareProduct.id;
}
@@ -337,8 +341,8 @@ export default class OnboardingPunchOut {
{versionsList: {itemType, itemId}},
softwareProduct: {softwareProductEditor: {data: currentSoftwareProduct = {onboardingMethod: ''}},
softwareProductComponents: {componentsList}}} = store.getState();
- const wholeSoftwareProductList = [...softwareProductList, ...finalizedSoftwareProductList];
- const wholeLicenseModelList = [...licenseModelList, ...finalizedLicenseModelList];
+ const wholeSoftwareProductList = lodashUnionBy(softwareProductList, finalizedSoftwareProductList, 'id');
+ const wholeLicenseModelList = lodashUnionBy(licenseModelList, finalizedLicenseModelList, 'id');
let breadcrumbsData = {itemType, itemId, currentScreen, wholeLicenseModelList, wholeSoftwareProductList, currentSoftwareProduct, componentsList};
if (currentScreen.forceBreadCrumbsUpdate || !isEqual(breadcrumbsData, this.prevBreadcrumbsData) || this.breadcrumbsPrefixSelected) {