From ac2d8549e5cf6efaac78de8acc0c4967e63adcf9 Mon Sep 17 00:00:00 2001 From: Clemens Date: Mon, 6 Jun 2016 23:27:04 +0200 Subject: moved sort state to redux, missing apply sort --- web/src/js/ducks/flows.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'web/src/js/ducks') diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index fdbc42ee..bde53179 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -5,6 +5,7 @@ import {updateViewFilter, updateViewList} from "./utils/view" export const UPDATE_FLOWS = "UPDATE_FLOWS" export const SET_FILTER = "SET_FLOW_FILTER" export const SET_HIGHLIGHT = "SET_FLOW_HIGHLIGHT" +export const SET_SORT = "SET_FLOW_SORT" export const SELECT_FLOW = "SELECT_FLOW" const { @@ -20,6 +21,7 @@ const defaultState = { view: [], filter: undefined, highlight: undefined, + sort: {sortColumn: undefined, sortDesc: false}, } function makeFilterFn(filter) { @@ -46,6 +48,11 @@ export default function reducer(state = defaultState, action) { ...state, highlight: action.highlight } + case SET_SORT: + return { + ...state, + sort: action.sort + } case SELECT_FLOW: return { ...state, @@ -69,6 +76,12 @@ export function setHighlight(highlight) { highlight } } +export function setSort(sort){ + return { + type: SET_SORT, + sort + } +} export function selectFlow(flowId) { return { type: SELECT_FLOW, -- cgit v1.2.3