summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-04-22 14:14:31 +0300
committerEinav Keidar <einavw@amdocs.com>2018-04-22 12:19:13 +0000
commit57c5c4ab80cde4290cac97a6eba3dc7de280538a (patch)
tree450d14403035554ca79f0de55c40c81b71e7740e /openecomp-ui/src/sdc-app
parenteb4b9fb0f4d3b62f3b9e2da81ebe581e7d0fc6eb (diff)
attachment page navigation fix
Issue-ID: SDC-1239 Change-Id: Ib597238233e9a035944b7a56a56601cdfd624ca2 Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app')
-rw-r--r--openecomp-ui/src/sdc-app/common/helpers/ItemsHelper.js14
-rw-r--r--openecomp-ui/src/sdc-app/common/helpers/ItemsHelperConstants.js10
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx7
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js45
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/onboard/filter/FilterComponents.jsx14
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsView.jsx11
6 files changed, 47 insertions, 54 deletions
diff --git a/openecomp-ui/src/sdc-app/common/helpers/ItemsHelper.js b/openecomp-ui/src/sdc-app/common/helpers/ItemsHelper.js
index ae5c2707b6..bbca87fec5 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 Configuration from 'sdc-app/config/Configuration.js';
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 @@ const ItemsHelper = {
},
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 @@ const ItemsHelper = {
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 ebbbfded3b..9837fed53c 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 @@ export const itemType = {
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 245dd2b55c..a73501468c 100644
--- a/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/OnboardingPunchOut.jsx
@@ -232,12 +232,13 @@ export default class OnboardingPunchOut {
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 e07777f69e..5d425a8aa4 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 @@ export default {
});
},
- 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 b114941a3c..6a4760afdf 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 @@ export const Permissions = ({ data, onDataChanged }) => {
{
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 @@ export const OnboardingProcedure = ({ data, onDataChanged }) => {
{
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 08145be9c7..814f9b38e0 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 @@ class HeatScreenView extends Component {
onboardingOrigin,
activeTab,
setActiveTab,
+ goToOverview,
...other
} = this.props;
@@ -82,17 +83,13 @@ class HeatScreenView extends Component {
/>
)}
{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>
)}