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-10.0.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-10.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.2.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.2.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.2.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.2.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.1.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.0.4 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.1.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.0.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.0.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.3.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-9.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.2.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.1.4 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.3.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.3.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.1.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.3.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js
foreman-tasks-8.2.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/ConfirmModalReducer.js