aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2017-12-20 14:30:43 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-12-21 11:12:33 +0000
commit8e9c0653dd6c6862123c9609ae34e1206d86456e (patch)
tree5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
parent785ebcc95de3e064e843bec04ba7a209d854fc7c (diff)
Add collaboration feature
Issue-ID: SDC-767 Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js')
-rw-r--r--openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js19
1 files changed, 12 insertions, 7 deletions
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 e9d922c212..b4f03a68cd 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
@@ -17,7 +17,7 @@ import RestAPIUtil from 'nfvo-utils/RestAPIUtil.js';
import Configuration from 'sdc-app/config/Configuration.js';
import {actionTypes as licenseAgreementActionTypes} from './LicenseAgreementConstants.js';
import FeatureGroupsActionHelper from 'sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsActionHelper.js';
-import LicenseModelActionHelper from 'sdc-app/onboarding/licenseModel/LicenseModelActionHelper.js';
+import ItemsHelper from 'sdc-app/common/helpers/ItemsHelper.js';
function baseUrl(licenseModelId, version) {
const restPrefix = Configuration.get('restPrefix');
@@ -29,6 +29,10 @@ function fetchLicenseAgreementList(licenseModelId, version) {
return RestAPIUtil.fetch(`${baseUrl(licenseModelId, version)}`);
}
+function fetchLicenseAgreement(licenseModelId, licenseAgreementId, version) {
+ return RestAPIUtil.fetch(`${baseUrl(licenseModelId, version)}/${licenseAgreementId}`);
+}
+
function postLicenseAgreement(licenseModelId, licenseAgreement, version) {
return RestAPIUtil.post(baseUrl(licenseModelId, version), {
name: licenseAgreement.name,
@@ -65,6 +69,10 @@ export default {
}));
},
+ fetchLicenseAgreement(dispatch, {licenseModelId, licenseAgreementId, version}) {
+ return fetchLicenseAgreement(licenseModelId, licenseAgreementId, version);
+ },
+
openLicenseAgreementEditor(dispatch, {licenseModelId, licenseAgreement, version}) {
FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {licenseModelId, version});
dispatch({
@@ -84,12 +92,14 @@ export default {
if (previousLicenseAgreement) {
return putLicenseAgreement(licenseModelId, previousLicenseAgreement, licenseAgreement, version).then(() => {
this.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
+ ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
else {
return postLicenseAgreement(licenseModelId, licenseAgreement, version).then(() => {
this.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {licenseModelId, version});
+ ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
}
},
@@ -100,6 +110,7 @@ export default {
type: licenseAgreementActionTypes.DELETE_LICENSE_AGREEMENT,
licenseAgreementId
});
+ ItemsHelper.checkItemStatus(dispatch, {itemId: licenseModelId, versionId: version.id});
});
},
@@ -108,11 +119,5 @@ export default {
type: licenseAgreementActionTypes.licenseAgreementEditor.SELECT_TAB,
tab
});
- },
-
- switchVersion(dispatch, {licenseModelId, version}) {
- LicenseModelActionHelper.fetchLicenseModelById(dispatch, {licenseModelId, version}).then(() => {
- this.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
- });
}
};