Remove loadManagedLicensesError state property

This removes the loadManagedLicensesError property from the license management store.
This property isn't used anywhere, so it does not make sense to keep
maintaining it and the associated actions and mutations.
parent 04bbe17f
...@@ -55,8 +55,8 @@ export const requestManagedLicenses = ({ commit }) => { ...@@ -55,8 +55,8 @@ export const requestManagedLicenses = ({ commit }) => {
export const receiveManagedLicensesSuccess = ({ commit }, licenses) => { export const receiveManagedLicensesSuccess = ({ commit }, licenses) => {
commit(types.RECEIVE_MANAGED_LICENSES_SUCCESS, licenses); commit(types.RECEIVE_MANAGED_LICENSES_SUCCESS, licenses);
}; };
export const receiveManagedLicensesError = ({ commit }, error) => { export const receiveManagedLicensesError = ({ commit }) => {
commit(types.RECEIVE_MANAGED_LICENSES_ERROR, error); commit(types.RECEIVE_MANAGED_LICENSES_ERROR);
}; };
export const fetchManagedLicenses = ({ dispatch, state }) => { export const fetchManagedLicenses = ({ dispatch, state }) => {
dispatch('requestManagedLicenses'); dispatch('requestManagedLicenses');
...@@ -68,8 +68,8 @@ export const fetchManagedLicenses = ({ dispatch, state }) => { ...@@ -68,8 +68,8 @@ export const fetchManagedLicenses = ({ dispatch, state }) => {
.then(({ data }) => { .then(({ data }) => {
dispatch('receiveManagedLicensesSuccess', data); dispatch('receiveManagedLicensesSuccess', data);
}) })
.catch((error) => { .catch(() => {
dispatch('receiveManagedLicensesError', error); dispatch('receiveManagedLicensesError');
}); });
}; };
......
...@@ -31,14 +31,12 @@ export default { ...@@ -31,14 +31,12 @@ export default {
Object.assign(state, { Object.assign(state, {
managedLicenses, managedLicenses,
isLoadingManagedLicenses: false, isLoadingManagedLicenses: false,
loadManagedLicensesError: false,
}); });
}, },
[types.RECEIVE_MANAGED_LICENSES_ERROR](state, error) { [types.RECEIVE_MANAGED_LICENSES_ERROR](state) {
Object.assign(state, { Object.assign(state, {
managedLicenses: [], managedLicenses: [],
isLoadingManagedLicenses: false, isLoadingManagedLicenses: false,
loadManagedLicensesError: error,
}); });
}, },
[types.REQUEST_MANAGED_LICENSES](state) { [types.REQUEST_MANAGED_LICENSES](state) {
......
...@@ -9,7 +9,6 @@ export default () => ({ ...@@ -9,7 +9,6 @@ export default () => ({
isLoadingManagedLicenses: false, isLoadingManagedLicenses: false,
pendingLicenses: [], pendingLicenses: [],
loadLicenseReportError: false, loadLicenseReportError: false,
loadManagedLicensesError: false,
managedLicenses: [], managedLicenses: [],
newLicenses: [], newLicenses: [],
existingLicenses: [], existingLicenses: [],
......
...@@ -414,7 +414,7 @@ describe('License store actions', () => { ...@@ -414,7 +414,7 @@ describe('License store actions', () => {
actions.receiveManagedLicensesError, actions.receiveManagedLicensesError,
error, error,
state, state,
[{ type: mutationTypes.RECEIVE_MANAGED_LICENSES_ERROR, payload: error }], [{ type: mutationTypes.RECEIVE_MANAGED_LICENSES_ERROR }],
[], [],
) )
.then(done) .then(done)
...@@ -452,10 +452,7 @@ describe('License store actions', () => { ...@@ -452,10 +452,7 @@ describe('License store actions', () => {
null, null,
state, state,
[], [],
[ [{ type: 'requestManagedLicenses' }, { type: 'receiveManagedLicensesError' }],
{ type: 'requestManagedLicenses' },
{ type: 'receiveManagedLicensesError', payload: expect.any(Error) },
],
) )
.then(done) .then(done)
.catch(done.fail); .catch(done.fail);
......
...@@ -177,13 +177,12 @@ describe('License store mutations', () => { ...@@ -177,13 +177,12 @@ describe('License store mutations', () => {
}); });
describe('RECEIVE_MANAGED_LICENSES_SUCCESS', () => { describe('RECEIVE_MANAGED_LICENSES_SUCCESS', () => {
it('sets isLoadingManagedLicenses and loadManagedLicensesError to false and saves managed licenses', () => { it('sets isLoadingManagedLicenses to false and saves managed licenses', () => {
store.replaceState({ store.replaceState({
...store.state, ...store.state,
licenseManagement: { licenseManagement: {
managedLicenses: false, managedLicenses: false,
isLoadingManagedLicenses: true, isLoadingManagedLicenses: true,
loadManagedLicensesError: true,
}, },
}); });
...@@ -196,7 +195,6 @@ describe('License store mutations', () => { ...@@ -196,7 +195,6 @@ describe('License store mutations', () => {
]); ]);
expect(store.state.licenseManagement.isLoadingManagedLicenses).toBe(false); expect(store.state.licenseManagement.isLoadingManagedLicenses).toBe(false);
expect(store.state.licenseManagement.loadManagedLicensesError).toBe(false);
}); });
}); });
...@@ -207,14 +205,12 @@ describe('License store mutations', () => { ...@@ -207,14 +205,12 @@ describe('License store mutations', () => {
...store.state, ...store.state,
licenseManagement: { licenseManagement: {
isLoadingManagedLicenses: true, isLoadingManagedLicenses: true,
loadManagedLicensesError: false,
}, },
}); });
store.commit(`licenseManagement/${types.RECEIVE_MANAGED_LICENSES_ERROR}`, error); store.commit(`licenseManagement/${types.RECEIVE_MANAGED_LICENSES_ERROR}`, error);
expect(store.state.licenseManagement.isLoadingManagedLicenses).toBe(false); expect(store.state.licenseManagement.isLoadingManagedLicenses).toBe(false);
expect(store.state.licenseManagement.loadManagedLicensesError).toBe(error);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment