Sha256: 2bb12542907c06c79142b500163ebbfaf58309adb364e994dc05d45a285af849

Contents?: true

Size: 927 Bytes

Versions: 70

Compression:

Stored size: 927 Bytes

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);
    default:
      return state;
  }
};

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
foreman_remote_execution-8.1.2 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-8.1.1 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-8.1.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-7.2.2 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-7.2.1 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-7.2.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-5.0.8 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-8.0.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-7.1.1 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-7.1.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-7.0.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-5.0.7 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-5.0.6 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-6.2.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-5.0.5 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-6.1.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-5.0.4 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-5.0.3 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-6.0.0 webpack/react_app/redux/reducers/jobInvocations/index.js
foreman_remote_execution-5.0.2 webpack/react_app/redux/reducers/jobInvocations/index.js