Set up data explorer for group details panel
[arvados-workbench2.git] / src / store / group-details-panel / group-details-panel-actions.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { bindDataExplorerActions } from '~/store/data-explorer/data-explorer-action';
6 import { Dispatch } from 'redux';
7 import { propertiesActions } from '~/store/properties/properties-actions';
8 import { getProperty } from '~/store/properties/properties';
9
10 export const GROUP_DETAILS_PANEL_ID = 'groupDetailsPanel';
11
12 export const GroupDetailsPanelActions = bindDataExplorerActions(GROUP_DETAILS_PANEL_ID);
13
14 export const loadGroupDetailsPanel = (groupUuid: string) =>
15     (dispatch: Dispatch) => {
16         dispatch(propertiesActions.SET_PROPERTY({ key: GROUP_DETAILS_PANEL_ID, value: groupUuid }));
17         dispatch(GroupDetailsPanelActions.REQUEST_ITEMS());
18     };
19
20 export const getCurrentGroupDetailsPanelUuid = getProperty<string>(GROUP_DETAILS_PANEL_ID);