2017-05-16 13:34:00 +02:00
|
|
|
import {LOAD_CONFIG_SUCCESS} from './actions'
|
|
|
|
|
|
|
|
const initialState = {
|
2018-07-05 10:30:52 +02:00
|
|
|
routes_columns: {},
|
|
|
|
routes_columns_order: [],
|
|
|
|
neighbours_columns: {},
|
|
|
|
neighbours_columns_order: [],
|
2018-08-03 12:22:10 +02:00
|
|
|
lookup_columns: {},
|
|
|
|
lookup_columns_order: [],
|
2018-06-26 16:59:01 +02:00
|
|
|
prefix_lookup_enabled: false,
|
2018-08-03 17:04:31 +02:00
|
|
|
content: {},
|
|
|
|
noexport_load_on_demand: true, // we have to assume this
|
2018-09-07 11:40:03 +02:00
|
|
|
// otherwise fetch will start.
|
2018-08-09 23:24:58 +02:00
|
|
|
bgp_communities: {},
|
2017-05-16 13:34:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default function reducer(state = initialState, action) {
|
|
|
|
switch(action.type) {
|
|
|
|
case LOAD_CONFIG_SUCCESS:
|
2018-07-05 10:30:52 +02:00
|
|
|
return Object.assign({}, state, {
|
|
|
|
routes_columns: action.payload.routes_columns,
|
|
|
|
routes_columns_order: action.payload.routes_columns_order,
|
|
|
|
|
|
|
|
neighbours_columns: action.payload.neighbours_columns,
|
|
|
|
neighbours_columns_order: action.payload.neighbours_columns_order,
|
|
|
|
|
2018-08-03 12:22:10 +02:00
|
|
|
lookup_columns: action.payload.lookup_columns,
|
|
|
|
lookup_columns_order: action.payload.lookup_columns_order,
|
|
|
|
|
2018-08-03 17:04:31 +02:00
|
|
|
prefix_lookup_enabled: action.payload.prefix_lookup_enabled,
|
|
|
|
|
2018-08-09 23:24:58 +02:00
|
|
|
bgp_communities: action.payload.bgp_communities,
|
2018-08-03 17:04:31 +02:00
|
|
|
noexport_load_on_demand: action.payload.noexport.load_on_demand
|
2018-07-05 10:30:52 +02:00
|
|
|
});
|
2017-05-16 13:34:00 +02:00
|
|
|
}
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|