summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-08-06 23:08:39 +0300
committerEinav Keidar <einavw@amdocs.com>2018-08-07 07:55:38 +0000
commit8f13330349a9a78b4cd2e32218237955f86fb4d8 (patch)
treefdf41c5cf34419c5d6e67bdabed877017e2c2656 /openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js
parenta53629a4c022f8cbfca7d7ead1c13ae7d30042e9 (diff)
ui user feedback 1810
Enhance LKG & EP to include MRN Enhance EP & LKG UI to display Invariant UUID & UUID Remove MRN from FG Issue-ID: SDC-1524 Change-Id: Id6259f746ba4b4dcd5684d58d66f0df769107589 Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js77
1 files changed, 31 insertions, 46 deletions
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js
index 51f353f7d9..ef705d67e4 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsActionHelper.js
@@ -1,5 +1,5 @@
/*!
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2016-2018 European Support Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
+
import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
import Configuration from 'sdc-app/config/Configuration.js';
import { actionTypes as entitlementPoolsActionTypes } from './EntitlementPoolsConstants.js';
@@ -39,7 +40,8 @@ function postEntitlementPool(licenseModelId, entitlementPool, version) {
increments: entitlementPool.increments,
time: entitlementPool.time,
startDate: entitlementPool.startDate,
- expiryDate: entitlementPool.expiryDate
+ expiryDate: entitlementPool.expiryDate,
+ manufacturerReferenceNumber: entitlementPool.manufacturerReferenceNumber
});
}
@@ -59,7 +61,9 @@ function putEntitlementPool(
increments: entitlementPool.increments,
time: entitlementPool.time,
startDate: entitlementPool.startDate,
- expiryDate: entitlementPool.expiryDate
+ expiryDate: entitlementPool.expiryDate,
+ manufacturerReferenceNumber:
+ entitlementPool.manufacturerReferenceNumber
}
);
}
@@ -119,7 +123,7 @@ function putLimit(licenseModelId, entitlementPoolId, version, limit) {
);
}
-export default {
+const EntitlementPoolsActionHelper = {
fetchEntitlementPoolsList(dispatch, { licenseModelId, version }) {
return fetchEntitlementPoolsList(licenseModelId, version).then(
response =>
@@ -148,23 +152,20 @@ export default {
});
},
- deleteEntitlementPool(
+ async deleteEntitlementPool(
dispatch,
{ licenseModelId, entitlementPoolId, version }
) {
- return deleteEntitlementPool(
+ await deleteEntitlementPool(licenseModelId, entitlementPoolId, version);
+
+ await ItemsHelper.checkItemStatus(dispatch, {
+ itemId: licenseModelId,
+ versionId: version.id
+ });
+
+ await EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {
licenseModelId,
- entitlementPoolId,
version
- ).then(() => {
- dispatch({
- type: entitlementPoolsActionTypes.DELETE_ENTITLEMENT_POOL,
- entitlementPoolId
- });
- return ItemsHelper.checkItemStatus(dispatch, {
- itemId: licenseModelId,
- versionId: version.id
- });
});
},
@@ -182,46 +183,28 @@ export default {
});
},
- saveEntitlementPool(
+ async saveEntitlementPool(
dispatch,
{ licenseModelId, previousEntitlementPool, entitlementPool, version }
) {
if (previousEntitlementPool) {
- return putEntitlementPool(
+ await putEntitlementPool(
licenseModelId,
previousEntitlementPool,
entitlementPool,
version
- ).then(() => {
- dispatch({
- type: entitlementPoolsActionTypes.EDIT_ENTITLEMENT_POOL,
- entitlementPool
- });
- return ItemsHelper.checkItemStatus(dispatch, {
- itemId: licenseModelId,
- versionId: version.id
- });
- });
+ );
} else {
- return postEntitlementPool(
- licenseModelId,
- entitlementPool,
- version
- ).then(response => {
- dispatch({
- type: entitlementPoolsActionTypes.ADD_ENTITLEMENT_POOL,
- entitlementPool: {
- ...entitlementPool,
- referencingFeatureGroups: [],
- id: response.value
- }
- });
- return ItemsHelper.checkItemStatus(dispatch, {
- itemId: licenseModelId,
- versionId: version.id
- });
- });
+ await postEntitlementPool(licenseModelId, entitlementPool, version);
}
+ await ItemsHelper.checkItemStatus(dispatch, {
+ itemId: licenseModelId,
+ versionId: version.id
+ });
+ await EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {
+ licenseModelId,
+ version
+ });
},
hideDeleteConfirm(dispatch) {
@@ -291,3 +274,5 @@ export default {
});
}
};
+
+export default EntitlementPoolsActionHelper;