Sha256: 40ec985705ae2a98b04ee058d8134cbb98c47163d2e55078b6142528c6cce146

Contents?: true

Size: 532 Bytes

Versions: 79

Compression:

Stored size: 532 Bytes

Contents

import Immutable from 'seamless-immutable';
import {
  INVENTORY_FILTER_UPDATE,
  INVENTORY_FILTER_CLEAR,
} from './InventoryFilterConstants';

const initialState = Immutable({
  filterTerm: '',
});

export default (
  state = initialState,
  { type, payload: { filterTerm } = {} }
) => {
  switch (type) {
    case INVENTORY_FILTER_UPDATE:
      return state.merge({
        filterTerm,
      });
    case INVENTORY_FILTER_CLEAR:
      return state.merge({
        filterTerm: '',
      });
    default:
      return state;
  }
};

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
foreman_rh_cloud-5.0.38 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.35 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.37 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.36 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.35 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.34 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.33 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.32 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.32 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.32 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.31 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.31 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.30 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.30 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.29 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.29 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.29 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.28 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-5.0.28 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.27 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js