Sha256: b88fb14ad9905e0b27d6c51b00246bba218f509fe77864d2372c739534976e67

Contents?: true

Size: 1.06 KB

Versions: 37

Compression:

Stored size: 1.06 KB

Contents

import Immutable from 'seamless-immutable';

import {
  MANIFEST_HISTORY_REQUEST,
  MANIFEST_HISTORY_SUCCESS,
  MANIFEST_HISTORY_FAILURE,
  UPLOAD_MANIFEST_SUCCESS,
  DELETE_MANIFEST_SUCCESS,
  REFRESH_MANIFEST_SUCCESS,
} from './ManifestConstants';

const initialState = Immutable({ loading: true, results: [] });

export default (state = initialState, action) => {
  switch (action.type) {
    case MANIFEST_HISTORY_REQUEST:
      return state.set('loading', true);

    case MANIFEST_HISTORY_SUCCESS: {
      const results = action.response;

      return state.merge({
        results,
        loading: false,
      });
    }

    case MANIFEST_HISTORY_FAILURE:
      return state.merge({
        error: action.payload.message,
        loading: false,
      });

    case UPLOAD_MANIFEST_SUCCESS:
      return state.set('taskDetails', action.response);

    case DELETE_MANIFEST_SUCCESS:
      return state.set('taskDetails', action.response);

    case REFRESH_MANIFEST_SUCCESS:
      return state.set('taskDetails', action.response);

    default:
      return state;
  }
};

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
katello-3.15.0.rc1.3 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.15.0.rc1.2 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.15.0.rc1.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.15.0.rc1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.14.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.4 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.14.0 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.3 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.14.0.rc2 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.2 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.14.0.rc1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.0 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.0.rc2.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.0.rc2 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.12.3 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.12.2 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.13.0.rc1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.12.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.11.2 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js