21700: Install Bundler system-wide in Rails postinst
[arvados.git] / services / workbench2 / src / store / side-panel / side-panel-action.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Dispatch } from 'redux';
6 import { navigateTo } from 'store/navigation/navigation-action';
7
8 export const sidePanelActions = {
9     TOGGLE_COLLAPSE: 'TOGGLE_COLLAPSE',
10     SET_CURRENT_WIDTH: 'SET_CURRENT_WIDTH'
11 }
12
13 export const navigateFromSidePanel = (id: string) =>
14     (dispatch: Dispatch) => {
15         dispatch<any>(navigateTo(id));
16     };
17
18 export const toggleSidePanel = (collapsedState: boolean) => {
19     return (dispatch) => {
20         dispatch({type: sidePanelActions.TOGGLE_COLLAPSE, payload: !collapsedState})
21     }
22 }
23
24 export const setCurrentSideWidth = (width: number) => {
25     return (dispatch) => {
26         dispatch({type: sidePanelActions.SET_CURRENT_WIDTH, payload: width})
27     }
28 }