attachment page navigation fix

Issue-ID: SDC-1239
Change-Id: Ib597238233e9a035944b7a56a56601cdfd624ca2
Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
diff --git a/openecomp-ui/src/sdc-app/common/helpers/ItemsHelper.js b/openecomp-ui/src/sdc-app/common/helpers/ItemsHelper.js
index ae5c270..bbca87f 100644
--- a/openecomp-ui/src/sdc-app/common/helpers/ItemsHelper.js
+++ b/openecomp-ui/src/sdc-app/common/helpers/ItemsHelper.js
@@ -18,8 +18,6 @@
 import { permissionTypes } from 'sdc-app/onboarding/permissions/PermissionsConstants.js';
 import { actionsEnum as VersionControllerActionsEnum } from 'nfvo-components/panel/versionController/VersionControllerConstants.js';
 import { actionTypes as onboardingActionTypes } from 'sdc-app/onboarding/OnboardingConstants.js';
-import { restToggle } from 'sdc-app/features/featureToggleUtils.js';
-import { featureToggleNames } from 'sdc-app/features/FeaturesConstants.js';
 import objectPropsToUrlString from 'nfvo-utils/objectPropsToUrlString.js';
 
 export const archiveActions = {
@@ -98,11 +96,7 @@
     },
 
     fetchItem(itemId) {
-        return restToggle({
-            restFunction: () => RestAPIUtil.fetch(`${baseUrl()}/${itemId}`),
-            featureName: featureToggleNames.ARCHIVE_ITEM,
-            mockResult: {}
-        });
+        return RestAPIUtil.fetch(`${baseUrl()}/${itemId}`);
     },
 
     archiveItem(itemId) {
@@ -118,11 +112,7 @@
 
     fetchItems(filterData) {
         const str = objectPropsToUrlString(filterData);
-        return restToggle({
-            restFunction: () => RestAPIUtil.fetch(`${baseUrl()}?${str}`),
-            featureName: featureToggleNames.FILTER,
-            mockResult: { results: [] }
-        });
+        return RestAPIUtil.fetch(`${baseUrl()}?${str}`);
     }
 };
 
diff --git a/openecomp-ui/src/sdc-app/common/helpers/ItemsHelperConstants.js b/openecomp-ui/src/sdc-app/common/helpers/ItemsHelperConstants.js
index ebbbfde..9837fed 100644
--- a/openecomp-ui/src/sdc-app/common/helpers/ItemsHelperConstants.js
+++ b/openecomp-ui/src/sdc-app/common/helpers/ItemsHelperConstants.js
@@ -27,3 +27,13 @@
     VSP: 'vsp',
     VLM: 'vlm'
 };
+
+export const itemPermissions = {
+    CONTRIBUTOR: 'Contributor',
+    OWNER: 'Owner'
+};
+
+export const itemOnboardingProcedure = {
+    NETWORK: 'NetworkPackage',
+    MANUAL: 'Manual'
+};
diff --git a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
index 245dd2b..a735014 100644
--- a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
@@ -232,12 +232,13 @@
                             softwareProductScreen ===
                             enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS
                         ) {
-                            softwareProduct = vspData;
+                            softwareProduct = { ...vspData };
                             //check current vsp fields to determine which file has uploaded
+
                             if (
-                                vspData.onboardingOrigin ===
+                                vspData.onboardingOrigin.toLowerCase() ===
                                     onboardingOriginTypes.ZIP ||
-                                vspData.candidateOnboardingOrigin ===
+                                vspData.candidateOnboardingOrigin.toLowerCase() ===
                                     onboardingOriginTypes.ZIP
                             ) {
                                 softwareProductScreen =
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
index e07777f..5d425a8 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
@@ -124,46 +124,37 @@
         });
     },
 
-    saveLicenseAgreement(
+    async saveLicenseAgreement(
         dispatch,
         { licenseModelId, previousLicenseAgreement, licenseAgreement, version }
     ) {
         if (previousLicenseAgreement) {
-            return putLicenseAgreement(
+            await putLicenseAgreement(
                 licenseModelId,
                 previousLicenseAgreement,
                 licenseAgreement,
                 version
-            ).then(() => {
-                this.fetchLicenseAgreementList(dispatch, {
-                    licenseModelId,
-                    version
-                });
-                return ItemsHelper.checkItemStatus(dispatch, {
-                    itemId: licenseModelId,
-                    versionId: version.id
-                });
-            });
+            );
         } else {
-            return postLicenseAgreement(
+            await postLicenseAgreement(
                 licenseModelId,
                 licenseAgreement,
                 version
-            ).then(() => {
-                this.fetchLicenseAgreementList(dispatch, {
-                    licenseModelId,
-                    version
-                });
-                FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {
-                    licenseModelId,
-                    version
-                });
-                return ItemsHelper.checkItemStatus(dispatch, {
-                    itemId: licenseModelId,
-                    versionId: version.id
-                });
-            });
+            );
         }
+        await this.fetchLicenseAgreementList(dispatch, {
+            licenseModelId,
+            version
+        });
+        await FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {
+            licenseModelId,
+            version
+        });
+
+        return ItemsHelper.checkItemStatus(dispatch, {
+            itemId: licenseModelId,
+            versionId: version.id
+        });
     },
 
     deleteLicenseAgreement(
diff --git a/openecomp-ui/src/sdc-app/onboarding/onboard/filter/FilterComponents.jsx b/openecomp-ui/src/sdc-app/onboarding/onboard/filter/FilterComponents.jsx
index b114941..6a4760a 100644
--- a/openecomp-ui/src/sdc-app/onboarding/onboard/filter/FilterComponents.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/onboard/filter/FilterComponents.jsx
@@ -16,7 +16,11 @@
 import React from 'react';
 import Input from 'nfvo-components/input/validation/Input.jsx';
 import i18n from 'nfvo-utils/i18n/i18n.js';
-import { itemStatus } from 'sdc-app/common/helpers/ItemsHelperConstants.js';
+import {
+    itemStatus,
+    itemPermissions,
+    itemOnboardingProcedure
+} from 'sdc-app/common/helpers/ItemsHelperConstants.js';
 import Accordion from 'sdc-ui/lib/react/Accordion.js';
 import Checklist from 'sdc-ui/lib/react/Checklist.js';
 import Checkbox from 'sdc-ui/lib/react/Checkbox.js';
@@ -102,13 +106,13 @@
         {
             label: i18n('Owner'),
             dataTestId: 'catalog-filter-permission-owner',
-            value: 'Owner',
+            value: itemPermissions.OWNER,
             checked: data.permission && data.permission.Owner
         },
         {
             label: i18n('Contributor'),
             dataTestId: 'catalog-filter-permission-contributor',
-            value: 'Contributor',
+            value: itemPermissions.CONTRIBUTOR,
             checked: data.permission && data.permission.Contributor
         }
     ];
@@ -130,14 +134,14 @@
         {
             label: i18n('Network Package'),
             dataTestId: 'catalog-filter-procedure-network',
-            value: 'NetworkPackage',
+            value: itemOnboardingProcedure.NETWORK,
             checked:
                 data.onboardingMethod && data.onboardingMethod.NetworkPackage
         },
         {
             label: i18n('Manual'),
             dataTestId: 'catalog-filter-procedure-manual',
-            value: 'Manual',
+            value: itemOnboardingProcedure.MANUAL,
             checked: data.onboardingMethod && data.onboardingMethod.Manual
         }
     ];
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 08145be..814f9b3 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx
@@ -53,6 +53,7 @@
             onboardingOrigin,
             activeTab,
             setActiveTab,
+            goToOverview,
             ...other
         } = this.props;
 
@@ -82,17 +83,13 @@
                         />
                     )}
                     {activeTab === tabsMapping.VALIDATION &&
-                        softwareProductId && (
+                        softwareProductId &&
+                        goToOverview && (
                             <Button
                                 btnType="secondary"
                                 data-test-id="go-to-overview"
-                                disabled={this.props.goToOverview !== true}
                                 className="go-to-overview-btn"
-                                onClick={
-                                    this.props.goToOverview
-                                        ? () => onGoToOverview({ version })
-                                        : undefined
-                                }>
+                                onClick={() => onGoToOverview({ version })}>
                                 {i18n('GO TO OVERVIEW')}
                             </Button>
                         )}