webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js in foreman_acd-0.9.7 vs webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js in foreman_acd-0.10.0

- old
+ new

@@ -1,14 +1,8 @@ import Immutable from 'seamless-immutable'; import { - cloneDeep, - findIndex, - findLastIndex, -} from 'lodash'; - -import { APPLICATION_INSTANCE_REPORT_INIT, APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST, APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST, APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS, APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE, @@ -26,28 +20,31 @@ case APPLICATION_INSTANCE_REPORT_INIT: { return state.merge(payload); } case APPLICATION_INSTANCE_REPORT_SET_ACTIVE_HOST: { return state.merge({ - loading: true, activeHostId: payload.activeHostId, - }) + }); } case APPLICATION_INSTANCE_REPORT_LOAD_REPORT_REQUEST: { - // Nothing to do - return state; + return state.merge({ + loading: true, + }); } case APPLICATION_INSTANCE_REPORT_LOAD_REPORT_SUCCESS: { return state.merge({ deploymentState: payload.deploymentState, initialConfigureState: payload.initialConfigureState, initialConfigureJobUrl: payload.initialConfigureJobUrl, hosts: payload.hosts, + loading: false, }); } case APPLICATION_INSTANCE_REPORT_LOAD_REPORT_FAILURE: { - console.log("Error while loading report data: "+ payload.error); - return state.merge({ error: payload.error}); + return state.merge({ + error: payload.error, + loading: false, + }); } default: { return state; } }