Sha256: 681ffdc9d06279a2d7916547d5eb6f921d5152c688152f9c080a8b5b488a4cb6

Contents?: true

Size: 1.01 KB

Versions: 44

Compression:

Stored size: 1.01 KB

Contents

import Immutable from 'seamless-immutable';

import {
  JOB_INVOCATIONS_GET_JOB_INVOCATIONS,
  JOB_INVOCATIONS_POLLING_STARTED,
  JOB_INVOCATIONS_JOB_FINISHED,
} from '../../consts';

const initialState = Immutable({
  isPolling: false,
  jobInvocations: [],
  statuses: {},
});

export default (state = initialState, action) => {
  const { payload } = action;
  switch (action.type) {
    case JOB_INVOCATIONS_POLLING_STARTED:
      return state.set('isPolling', true);
    case JOB_INVOCATIONS_JOB_FINISHED:
      return state
        .set('isPolling', false)
        .set('jobInvocations', payload.jobInvocations.job_invocations)
        .set('statuses', payload.jobInvocations.statuses);
    case JOB_INVOCATIONS_GET_JOB_INVOCATIONS:
      return state
        .set('jobInvocations', payload.jobInvocations.job_invocations)
        .set('statuses', payload.jobInvocations.statuses);
    case 'JOB_INVOCATION_CHART_FILTER':
      return state.set('jobInvocationStateFilter', payload.filter);
    default:
      return state;
  }
};

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.1 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-14.1.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-14.0.2 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-14.0.1 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.2.6 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-14.0.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.2.5 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.2.4 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.2.3 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.2.2 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-12.0.7 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.2.1 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.2.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-10.1.3 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-13.0.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-12.0.5 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-12.0.4 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-12.0.1 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-12.0.2 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-11.1.3 webpack/react_app/redux/reducers/jobInvocations/index.js