Sha256: 635e9b8c7f42ebcacb348f83b3cf0591276b8143ad29482d28f35a65d64a893b

Contents?: true

Size: 849 Bytes

Versions: 29

Compression:

Stored size: 849 Bytes

Contents

import Immutable from 'seamless-immutable';
import { GET_SETTING_SUCCESS } from 'foremanReact/components/Settings/SettingsConstants';
import {
  AUTOSEARCH_DELAY,
  AUTOSEARCH_WHILE_TYPING,
  CONTENT_DISCONNECTED,
} from './SettingsConstants';

export const initialSettingsState = Immutable({
  autoSearchEnabled: true,
  autoSearchDelay: 500,
});

export default (state = initialSettingsState, action) => {
  switch (action.type) {
  case GET_SETTING_SUCCESS: {
    const { name, value } = action.response;
    switch (name) {
    case AUTOSEARCH_DELAY:
      return state.set('autoSearchDelay', value);
    case AUTOSEARCH_WHILE_TYPING:
      return state.set('autoSearchEnabled', value);
    case CONTENT_DISCONNECTED:
      return state.set('disconnected', value);
    default:
      return state;
    }
  }

  default:
    return state;
  }
};

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
katello-4.7.6 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.5 webpack/scenes/Settings/SettingsReducer.js
katello-4.8.0.rc2 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.4 webpack/scenes/Settings/SettingsReducer.js
katello-4.8.0.rc1 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.3 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.2 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.1 webpack/scenes/Settings/SettingsReducer.js
katello-4.6.2.1 webpack/scenes/Settings/SettingsReducer.js
katello-4.6.2 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.0 webpack/scenes/Settings/SettingsReducer.js
katello-4.6.1 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.0.rc2 webpack/scenes/Settings/SettingsReducer.js
katello-4.7.0.rc1 webpack/scenes/Settings/SettingsReducer.js
katello-4.4.2.2 webpack/scenes/Settings/SettingsReducer.js
katello-4.4.2.1 webpack/scenes/Settings/SettingsReducer.js
katello-4.4.2 webpack/scenes/Settings/SettingsReducer.js
katello-4.5.1 webpack/scenes/Settings/SettingsReducer.js
katello-4.6.0 webpack/scenes/Settings/SettingsReducer.js
katello-4.6.0.rc2 webpack/scenes/Settings/SettingsReducer.js