UNPKG

fabric8-planner

Version:
26 lines 992 B
import * as WIStateActions from './../actions/work-item-state.actions'; import { initialState } from './../states/work-item-state.state'; export var WorkItemStateReducer = function (state, action) { if (state === void 0) { state = initialState; } switch (action.type) { case WIStateActions.GET_SUCCESS: { return action.payload .filter(function (i) { return i.attributes['can-construct']; }) .map(function (i) { return i.attributes.fields['system.state'].type.values; }) .reduce(function (a, v) { return a.concat(v); }, []) .reduce(function (a, v) { if (a.indexOf(v) === -1) { return a.concat([v]); } return a; }, []); } case WIStateActions.GET_ERROR: { return state; } default: { return state; } } }; //# sourceMappingURL=work-item-state.reducer.js.map