Sha256: 40ec985705ae2a98b04ee058d8134cbb98c47163d2e55078b6142528c6cce146

Contents?: true

Size: 532 Bytes

Versions: 80

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

80 entries across 80 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.27 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.26 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.26 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.25.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.25 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.25 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.24.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.24.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.24 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.24 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.23 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.23 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.22 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.22 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-4.0.21.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.21.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.21 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.20 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.19 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js
foreman_rh_cloud-3.0.18.1 webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js