19302: side panel updates favorites Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa...
[arvados.git] / src / store / multiselect / multiselect-actions.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { TCheckedList } from "components/data-table/data-table";
6
7 export const multiselectActionContants = {
8     TOGGLE_VISIBLITY: "TOGGLE_VISIBLITY",
9     SET_CHECKEDLIST: "SET_CHECKEDLIST",
10     DESELECT_ONE: "DESELECT_ONE",
11 };
12
13 export const toggleMSToolbar = (isVisible: boolean) => {
14     return dispatch => {
15         dispatch({ type: multiselectActionContants.TOGGLE_VISIBLITY, payload: isVisible });
16     };
17 };
18
19 export const setCheckedListOnStore = (checkedList: TCheckedList) => {
20     return dispatch => {
21         dispatch({ type: multiselectActionContants.SET_CHECKEDLIST, payload: checkedList });
22     };
23 };
24
25 export const deselectOne = (uuid: string) => {
26     return dispatch => {
27         dispatch({ type: multiselectActionContants.DESELECT_ONE, payload: uuid });
28     };
29 };
30
31 export const multiselectActions = {
32     toggleMSToolbar,
33     setCheckedListOnStore,
34     deselectOne,
35 };