summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-03-19 12:15:19 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-03-20 07:51:05 +0000
commit091edfdac90f66d91caff1b93131f99ba74f9aeb (patch)
treea6a24fc4a295b7f804aeb2a2211e58b38bbf922a /openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
parentfefa3e408f77289594e47edc878d1bee61fca90b (diff)
ui support for archive items
Issue-ID: SDC-1088 Change-Id: I836e4896a8ec6bb065f9d2571f514916ccf6759f Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
index 9ed6005397..42786bf752 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js
@@ -32,7 +32,7 @@ import {actionTypes as componentActionTypes} from './components/SoftwareProductC
import ValidationHelper from 'sdc-app/common/helpers/ValidationHelper.js';
import {actionTypes as modalActionTypes} from 'nfvo-components/modal/GlobalModalConstants.js';
import {modalContentMapper} from 'sdc-app/common/modal/ModalContentMapper.js';
-import ItemsHelper from 'sdc-app/common/helpers/ItemsHelper.js';
+import {default as ItemsHelper} from 'sdc-app/common/helpers/ItemsHelper.js';
import ScreensHelper from 'sdc-app/common/helpers/ScreensHelper.js';
import {enums, screenTypes} from 'sdc-app/onboarding/OnboardingConstants.js';
import MergeEditorActionHelper from 'sdc-app/common/merge/MergeEditorActionHelper.js';
@@ -90,11 +90,15 @@ function putSoftwareProductAction(id, action, version) {
}
function fetchSoftwareProductList() {
- return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=Draft`);
+ return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=${catalogItemStatuses.DRAFT}`);
+}
+
+function fetchArchivedSoftwareProductList() {
+ return RestAPIUtil.fetch(`${baseUrl()}?Status=${catalogItemStatuses.ARCHIVED}`);
}
function fetchFinalizedSoftwareProductList() {
- return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=Certified`);
+ return RestAPIUtil.fetch(`${baseUrl()}?versionFilter=${catalogItemStatuses.CERTIFIED}`);
}
function fetchSoftwareProduct(vspId, version) {
@@ -202,6 +206,13 @@ const SoftwareProductActionHelper = {
}));
},
+ fetchArchivedSoftwareProductList(dispatch) {
+ return fetchArchivedSoftwareProductList().then(response => dispatch({
+ type: actionTypes.ARCHIVED_SOFTWARE_PRODUCT_LIST_LOADED,
+ response
+ }));
+ },
+
loadSoftwareProductAssociatedData(dispatch) {
fetchSoftwareProductCategories(dispatch);
LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch);
@@ -473,14 +484,15 @@ const SoftwareProductActionHelper = {
performVCAction(dispatch, {softwareProductId, action, version, comment}) {
return MergeEditorActionHelper.analyzeSyncResult(dispatch, {itemId: softwareProductId, version}).then(({inMerge, isDirty, updatedVersion}) => {
- if (updatedVersion.status === catalogItemStatuses.CERTIFIED &&
+ if ((updatedVersion.status === catalogItemStatuses.CERTIFIED || updatedVersion.archivedStatus === catalogItemStatuses.ARCHIVED) &&
(action === VersionControllerActionsEnum.COMMIT || action === VersionControllerActionsEnum.SYNC)) {
versionPageActionHelper.fetchVersions(dispatch, {itemType: itemTypes.SOFTWARE_PRODUCT, itemId: softwareProductId});
+ const msg = updatedVersion.archivedStatus === catalogItemStatuses.ARCHIVED ? i18n('Item was Archived') : i18n('Item version already Certified');
dispatch({
type: modalActionTypes.GLOBAL_MODAL_WARNING,
data: {
title: i18n('Commit error'),
- msg: i18n('Item version already Certified'),
+ msg,
cancelButtonText: i18n('Cancel')
}
});