Sha256: b6adeecfddade8f9158d6fc394e6b5e4007f0e3be8933ba0790dd17f9d66eec9

Contents?: true

Size: 914 Bytes

Versions: 23

Compression:

Stored size: 914 Bytes

Contents

import Immutable from 'seamless-immutable';

import {
  PREUPGRADE_REPORTS_REQUEST,
  PREUPGRADE_REPORTS_SUCCESS,
  PREUPGRADE_REPORTS_FAILURE,
} from '../../consts';

export const initialState = Immutable({
  loadingPreupgradeReports: false,
  reportsExpected: false,
  preupgradeReports: [],
  error: {},
});

const reducer = (state = initialState, action) => {
  const { payload } = action;
  switch (action.type) {
    case PREUPGRADE_REPORTS_REQUEST:
      return state.set('loadingPreupgradeReports', true);
    case PREUPGRADE_REPORTS_SUCCESS:
      return state.merge({
        loadingPreupgradeReports: false,
        preupgradeReports: payload.results,
        reportsExpected: true,
      });
    case PREUPGRADE_REPORTS_FAILURE:
      return state.merge({
        error: payload.error,
        loadingPreupgradeReports: false,
      });
    default:
      return state;
  }
};

export default reducer;

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
foreman_leapp-2.0.1 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-2.0.0 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-1.2.1 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-1.2.0 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.15 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-1.1.1 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-1.1.0 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-1.0.0 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.14 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.13 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.12 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.11 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.10 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.9 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.8 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.7 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.6 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.5 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.4 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js
foreman_leapp-0.1.3 webpack/components/PreupgradeReports/PreupgradeReportsReducer.js