summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-04-15 09:06:57 +0300
committerEinav Keidar <einavw@amdocs.com>2018-04-15 07:55:06 +0000
commitea5e43cc939f2010b4f4c97cb8d346c91348fbba (patch)
tree23e0d347103d16099ec3ca657ab246088cf88d01 /openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js
parent894285bfa9ccacde35b1e94e07856b53971e2559 (diff)
Onboarding filter
Issue-ID: SDC-1187 Change-Id: I74ce464c8ee4060c381b094d26d1ded270cdf40d Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
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({