summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js30
1 files changed, 24 insertions, 6 deletions
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 52a69803a6..5dc0aab0d7 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js
@@ -75,14 +75,32 @@ export const mapStateToProps = ({
};
};
+function handleScreenChange(softwareProduct, dispatch, version) {
+ const softwareProductId = softwareProduct.id;
+ if (softwareProduct.licenseType === 'INTERNAL') {
+ ScreensHelper.loadScreen(dispatch, {
+ screen: enums.SCREEN.SOFTWARE_PRODUCT_DETAILS,
+ screenType: screenTypes.SOFTWARE_PRODUCT,
+ props: { softwareProductId, version }
+ });
+ } else {
+ ScreensHelper.loadScreen(dispatch, {
+ screen: enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE,
+ screenType: screenTypes.SOFTWARE_PRODUCT,
+ props: { softwareProductId, version }
+ });
+ }
+}
+
const mapActionsToProps = (dispatch, { version }) => {
return {
- onDetailsSelect: ({ id: softwareProductId }) =>
- ScreensHelper.loadScreen(dispatch, {
- screen: enums.SCREEN.SOFTWARE_PRODUCT_DETAILS,
- screenType: screenTypes.SOFTWARE_PRODUCT,
- props: { softwareProductId, version }
- }),
+ onLicenseChange: softwareProduct => {
+ SoftwareProductActionHelper.updateSoftwareProductData(dispatch, {
+ softwareProduct,
+ version
+ }).then(() => {});
+ handleScreenChange(softwareProduct, dispatch, version);
+ },
onCandidateInProcess: softwareProductId =>
ScreensHelper.loadScreen(dispatch, {
screen: enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS_SETUP,