Sha256: 9beaafe35a8d8d11132cf3f75f9e5a9f291af8acf0abacc7203d796072b45a62

Contents?: true

Size: 1004 Bytes

Versions: 64

Compression:

Stored size: 1004 Bytes

Contents

import Immutable from 'seamless-immutable';
import {
  UPDATE_MODAL,
  CANCEL_SELECTED_MODAL,
  RESUME_SELECTED_MODAL,
  RESUME_MODAL,
  CANCEL_MODAL,
} from '../../TasksTableConstants';

const initialState = Immutable({});

export const ConfirmModalReducer = (state = initialState, action) => {
  const { type, payload } = action;
  switch (type) {
    case UPDATE_MODAL:
      switch (payload.modalID) {
        case CANCEL_SELECTED_MODAL:
        case CANCEL_MODAL:
          return state.merge({
            actionText: 'cancel',
            actionState: 'stopped',
            actionType: payload.modalID,
          });
        case RESUME_SELECTED_MODAL:
        case RESUME_MODAL:
          return state.merge({
            actionText: 'resume',
            actionState: 'running',
            actionType: payload.modalID,
          });
        default:
          return state.set('actionType', payload.modalID);
      }
    default:
      return state;
  }
};
export default ConfirmModalReducer;

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
foreman-tasks-5.2.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-5.1.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-5.1.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.1.5 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.1.4 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.1.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-3.0.6 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-5.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.1.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.1.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.0.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.1.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-3.0.5 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-4.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-3.0.4 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-2.0.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-3.0.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-3.0.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-3.0.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-3.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js