Fix view attachment for onboarded CSAR packages 00/91500/4
authorandre.schmid <andre.schmid@est.tech>
Tue, 16 Jul 2019 10:01:17 +0000 (10:01 +0000)
committerPiotr Darosz <piotr.darosz@nokia.com>
Wed, 24 Jul 2019 05:24:37 +0000 (05:24 +0000)
Fixes the problem to view attachments for a onboarded CSAR package.
Every time the attachments link was clicked the process package was
being called. The package processing can only happen once, while
uploading the package. This solution changes the Attachment link
action to a view action without package processing.

Change-Id: I5bded800c060adfb8cc80a8512bc8eecf07557b8
Issue-ID: SDC-2443
Signed-off-by: andre.schmid <andre.schmid@est.tech>
openecomp-ui/src/sdc-app/common/helpers/ScreensHelper.js
openecomp-ui/src/sdc-app/onboarding/OnboardingActionHelper.js
openecomp-ui/src/sdc-app/onboarding/OnboardingConstants.js
openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProduct.js

index 58f4795..afa5a42 100644 (file)
@@ -179,6 +179,13 @@ const ScreensHelper = {
                             vspProps
                         );
                         break;
+                    case enums.SCREEN
+                        .SOFTWARE_PRODUCT_ATTACHMENTS_VIEW_VALIDATION:
+                        OnboardingActionHelper.viewSoftwareProductAttachmentsValidationTab(
+                            dispatch,
+                            vspProps
+                        );
+                        break;
                     case enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES:
                         OnboardingActionHelper.navigateToSoftwareProductProcesses(
                             dispatch,
index 8385da7..754c112 100644 (file)
@@ -355,7 +355,23 @@ const OnboardingActionHelper = {
             );
         });
     },
-
+    viewSoftwareProductAttachmentsValidationTab(
+        dispatch,
+        { softwareProductId, version, status }
+    ) {
+        SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {
+            softwareProductId,
+            version
+        });
+        SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {
+            activeTab: attachmentsTabsMapping.VALIDATION
+        });
+        setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {
+            softwareProductId,
+            version,
+            status
+        });
+    },
     navigateToSoftwareProductProcesses(
         dispatch,
         { softwareProductId, version, status }
index cf8ff12..919344e 100644 (file)
@@ -4,9 +4,9 @@
  * 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.
@@ -95,6 +95,8 @@ export const enums = keyMirror({
             'SOFTWARE_PRODUCT_ATTACHMENTS_SETUP',
         SOFTWARE_PRODUCT_ATTACHMENTS_VALIDATION:
             'SOFTWARE_PRODUCT_ATTACHMENTS_VALIDATION',
+        SOFTWARE_PRODUCT_ATTACHMENTS_VIEW_VALIDATION:
+            'SOFTWARE_PRODUCT_ATTACHMENTS_VIEW_VALIDATION',
         SOFTWARE_PRODUCT_PROCESSES: breadcrumbsEnum.SOFTWARE_PRODUCT_PROCESSES,
         SOFTWARE_PRODUCT_DEPLOYMENT:
             breadcrumbsEnum.SOFTWARE_PRODUCT_DEPLOYMENT,
index 1362165..e34fb51 100644 (file)
@@ -576,7 +576,7 @@ const mapActionsToProps = (
                             ) {
                                 nextScreen =
                                     enums.SCREEN
-                                        .SOFTWARE_PRODUCT_ATTACHMENTS_VALIDATION;
+                                        .SOFTWARE_PRODUCT_ATTACHMENTS_VIEW_VALIDATION;
                             }
                         }
                         ScreensHelper.loadScreen(dispatch, {