summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js
index cfff9f1fcd..be33af7910 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js
@@ -29,8 +29,11 @@ import { modalContentMapper } from 'sdc-app/common/modal/ModalContentMapper.js';
import { CommitModalType } from 'nfvo-components/panel/versionController/components/CommitCommentModal.jsx';
import versionPageActionHelper from 'sdc-app/onboarding/versionsPage/VersionsPageActionHelper.js';
import { itemTypes } from 'sdc-app/onboarding/versionsPage/VersionsPageConstants.js';
-import { catalogItemStatuses } from 'sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogConstants.js';
import { actionsEnum as VersionControllerActionsEnum } from 'nfvo-components/panel/versionController/VersionControllerConstants.js';
+import {
+ itemStatus,
+ versionStatus
+} from 'sdc-app/common/helpers/ItemsHelperConstants.js';
function baseUrl() {
const restPrefix = Configuration.get('restPrefix');
@@ -39,19 +42,17 @@ function baseUrl() {
function fetchLicenseModels() {
return RestAPIUtil.fetch(
- `${baseUrl()}?versionFilter=${catalogItemStatuses.DRAFT}`
+ `${baseUrl()}?versionFilter=${versionStatus.DRAFT}`
);
}
function fetchFinalizedLicenseModels() {
return RestAPIUtil.fetch(
- `${baseUrl()}?versionFilter=${catalogItemStatuses.CERTIFIED}`
+ `${baseUrl()}?versionFilter=${versionStatus.CERTIFIED}`
);
}
function fetchArchivedLicenseModels() {
- return RestAPIUtil.fetch(
- `${baseUrl()}?Status=${catalogItemStatuses.ARCHIVED}`
- );
+ return RestAPIUtil.fetch(`${baseUrl()}?Status=${itemStatus.ARCHIVED}`);
}
function fetchLicenseModelById(licenseModelId, version) {
const { id: versionId } = version;
@@ -206,9 +207,8 @@ const LicenseModelActionHelper = {
version
}).then(({ inMerge, isDirty, updatedVersion }) => {
if (
- (updatedVersion.status === catalogItemStatuses.CERTIFIED ||
- updatedVersion.archivedStatus ===
- catalogItemStatuses.ARCHIVED) &&
+ (updatedVersion.status === versionStatus.CERTIFIED ||
+ updatedVersion.archivedStatus === versionStatus.ARCHIVED) &&
(action === VersionControllerActionsEnum.COMMIT ||
action === VersionControllerActionsEnum.SYNC)
) {
@@ -217,8 +217,7 @@ const LicenseModelActionHelper = {
itemId: licenseModelId
});
const msg =
- updatedVersion.archivedStatus ===
- catalogItemStatuses.ARCHIVED
+ updatedVersion.archivedStatus === versionStatus.ARCHIVED
? i18n('Item was Archived')
: i18n('Item version already Certified');
dispatch({