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-9.0.59 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-11.0.2 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-11.0.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-11.0.0 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.58 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-10.0.2 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.57 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-10.0.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.56 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.55 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.54 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.53 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.52 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-8.0.52 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-9.0.51 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-8.0.51 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-7.0.48 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-7.0.47 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-8.0.50 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-8.0.49 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js