Fix orphan list for VLMs
Fix the orphan list where feature groups stayed orphans after a license
agreement that contains them was created.
Issue-ID: SDC-407
Change-Id: I80b20e46fb4077ba0632e897437cfd795f134ad1
Signed-off-by: ilanap <ilanap@amdocs.com>
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 efc4fb7..e9d922c 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementActionHelper.js
@@ -83,21 +83,13 @@
saveLicenseAgreement(dispatch, {licenseModelId, previousLicenseAgreement, licenseAgreement, version}) {
if (previousLicenseAgreement) {
return putLicenseAgreement(licenseModelId, previousLicenseAgreement, licenseAgreement, version).then(() => {
- dispatch({
- type: licenseAgreementActionTypes.EDIT_LICENSE_AGREEMENT,
- licenseAgreement
- });
+ this.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
});
}
else {
- return postLicenseAgreement(licenseModelId, licenseAgreement, version).then(response => {
- dispatch({
- type: licenseAgreementActionTypes.ADD_LICENSE_AGREEMENT,
- licenseAgreement: {
- ...licenseAgreement,
- id: response.value
- }
- });
+ return postLicenseAgreement(licenseModelId, licenseAgreement, version).then(() => {
+ this.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
+ FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {licenseModelId, version});
});
}
},
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementConstants.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementConstants.js
index 40bef2c..181171d 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementConstants.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementConstants.js
@@ -19,8 +19,6 @@
export const actionTypes = keyMirror({
LICENSE_AGREEMENT_LIST_LOADED: null,
- ADD_LICENSE_AGREEMENT: null,
- EDIT_LICENSE_AGREEMENT: null,
DELETE_LICENSE_AGREEMENT: null,
licenseAgreementEditor: {
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListReducer.js
index e6a8f34..7d1a5ef 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementListReducer.js
@@ -19,11 +19,6 @@
switch (action.type) {
case licenseAgreementActionTypes.LICENSE_AGREEMENT_LIST_LOADED:
return [...action.response.results];
- case licenseAgreementActionTypes.ADD_LICENSE_AGREEMENT:
- return [...state, action.licenseAgreement];
- case licenseAgreementActionTypes.EDIT_LICENSE_AGREEMENT:
- const indexForEdit = state.findIndex(licenseAgreement => licenseAgreement.id === action.licenseAgreement.id);
- return [...state.slice(0, indexForEdit), action.licenseAgreement, ...state.slice(indexForEdit + 1)];
case licenseAgreementActionTypes.DELETE_LICENSE_AGREEMENT:
return state.filter(licenseAgreement => licenseAgreement.id !== action.licenseAgreementId);
default: