X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b6a5b173cd4e9f325f371d26204dfe156d911c20..273119605b7f33940a5ef9b1422eb1ff152d6764:/src/store/side-panel/side-panel-action.ts diff --git a/src/store/side-panel/side-panel-action.ts b/src/store/side-panel/side-panel-action.ts index 0dd6aad1..e4f53cea 100644 --- a/src/store/side-panel/side-panel-action.ts +++ b/src/store/side-panel/side-panel-action.ts @@ -2,15 +2,20 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { default as unionize, ofType, UnionOf } from "unionize"; +import { Dispatch } from 'redux'; +import { navigateTo } from 'store/navigation/navigation-action'; -export const sidePanelActions = unionize({ - TOGGLE_SIDE_PANEL_ITEM_OPEN: ofType(), - TOGGLE_SIDE_PANEL_ITEM_ACTIVE: ofType(), - RESET_SIDE_PANEL_ACTIVITY: ofType<{}>(), -}, { - tag: 'type', - value: 'payload' -}); +export const sidePanelActions = { + TOGGLE_COLLAPSE: 'TOGGLE_COLLAPSE' +} -export type SidePanelAction = UnionOf; +export const navigateFromSidePanel = (id: string) => + (dispatch: Dispatch) => { + dispatch(navigateTo(id)); + }; + +export const toggleSidePanel = (collapsedState: boolean) => { + return (dispatch) => { + dispatch({type: sidePanelActions.TOGGLE_COLLAPSE, payload: !collapsedState}) + } +} \ No newline at end of file