webpack/reducer.js in foreman_acd-0.9.7 vs webpack/reducer.js in foreman_acd-0.10.0
- old
+ new
@@ -1,7 +1,5 @@
-import { combineReducers } from 'redux';
-
import parameterSelectionParameters from './components/ParameterSelection/ParameterSelectionReducer';
import applicationDefinitionConf from './components/ApplicationDefinition/ApplicationDefinitionReducer';
import applicationDefinitionImportConf from './components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer';
import applicationInstanceConf from './components/ApplicationInstance/ApplicationInstanceReducer';
import applicationInstanceReport from './components/ApplicationInstanceReport/ApplicationInstanceReportReducer';
@@ -18,45 +16,72 @@
APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE,
APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE,
} from './components/ApplicationInstance/ApplicationInstanceConstants';
const rootReducer = (state = {}, action) => {
+ const paramState = parameterSelectionParameters(
+ state.parameterSelectionParameters,
+ action
+ );
+ const appInsReportState = applicationInstanceReport(
+ state.applicationInstanceReport,
+ action
+ );
- const param_state = parameterSelectionParameters(state.parameterSelectionParameters, action);
- const app_ins_report_state = applicationInstanceReport(state.applicationInstanceReport, action);
-
- if (action.type == APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE) {
- action.payload.parameterSelection = param_state.parameters;
+ if (
+ action.type ===
+ APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE
+ ) {
+ action.payload.parameterSelection = paramState.parameters;
}
- if (action.type == APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE) {
- action.payload.parameterSelection = param_state.parameters;
+ if (
+ action.type ===
+ APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE
+ ) {
+ action.payload.parameterSelection = paramState.parameters;
}
- const app_def_state = applicationDefinitionConf(state.applicationDefinitionConf, action);
- const app_def_import_state = applicationDefinitionImportConf(state.applicationDefinitionImportConf, action);
+ const appDefState = applicationDefinitionConf(
+ state.applicationDefinitionConf,
+ action
+ );
+ const appDefImportState = applicationDefinitionImportConf(
+ state.applicationDefinitionImportConf,
+ action
+ );
- if (action.type == APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE) {
- action.payload.parameterSelection = param_state.parameters;
+ if (
+ action.type === APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE
+ ) {
+ action.payload.parameterSelection = paramState.parameters;
}
- if (action.type == APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE) {
- action.payload.parameterSelection = param_state.parameters;
+ if (
+ action.type === APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE
+ ) {
+ action.payload.parameterSelection = paramState.parameters;
}
- const ex_host_state = existingHostSelectionConf(state.existingHostSelectionConf, action);
- if (action.type == APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE) {
- action.payload.selectedHosts = ex_host_state.selectedHosts;
+ const exHostState = existingHostSelectionConf(
+ state.existingHostSelectionConf,
+ action
+ );
+ if (action.type === APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE) {
+ action.payload.selectedHosts = exHostState.selectedHosts;
}
- const app_ins_state = applicationInstanceConf(state.applicationInstanceConf, action);
- const sync_git_repo_state = syncGitRepoConf(state.syncGitRepoConf, action);
+ const appInsState = applicationInstanceConf(
+ state.applicationInstanceConf,
+ action
+ );
+ const syncGitRepoState = syncGitRepoConf(state.syncGitRepoConf, action);
return {
- applicationDefinitionConf: app_def_state,
- applicationDefinitionImportConf: app_def_import_state,
- applicationInstanceConf: app_ins_state,
- applicationInstanceReport: app_ins_report_state,
- existingHostSelectionConf: ex_host_state,
- parameterSelectionParameters: param_state,
- syncGitRepoConf: sync_git_repo_state,
+ applicationDefinitionConf: appDefState,
+ applicationDefinitionImportConf: appDefImportState,
+ applicationInstanceConf: appInsState,
+ applicationInstanceReport: appInsReportState,
+ existingHostSelectionConf: exHostState,
+ parameterSelectionParameters: paramState,
+ syncGitRepoConf: syncGitRepoState,
};
};
export default rootReducer;