21700: Install Bundler system-wide in Rails postinst
[arvados.git] / services / workbench2 / src / views / workflow-panel / workflow-processes-panel.tsx
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 { connect } from "react-redux";
7 import { openProcessContextMenu } from "store/context-menu/context-menu-actions";
8 import { WorkflowProcessesPanelRoot, WorkflowProcessesPanelActionProps, WorkflowProcessesPanelDataProps } from "views/workflow-panel/workflow-processes-panel-root";
9 import { RootState } from "store/store";
10 import { navigateTo } from "store/navigation/navigation-action";
11 import { loadDetailsPanel } from "store/details-panel/details-panel-action";
12 import { getProcess } from "store/processes/process";
13 import { toggleOne, deselectAllOthers } from 'store/multiselect/multiselect-actions';
14
15 const mapDispatchToProps = (dispatch: Dispatch): WorkflowProcessesPanelActionProps => ({
16     onContextMenu: (event, resourceUuid, resources) => {
17         const process = getProcess(resourceUuid)(resources);
18         if (process) {
19             dispatch<any>(openProcessContextMenu(event, process));
20         }
21     },
22     onItemClick: (uuid: string) => {
23         dispatch<any>(toggleOne(uuid))
24         dispatch<any>(deselectAllOthers(uuid))
25         dispatch<any>(loadDetailsPanel(uuid));
26     },
27     onItemDoubleClick: uuid => {
28         dispatch<any>(navigateTo(uuid));
29     },
30 });
31
32 const mapStateToProps = (state: RootState): WorkflowProcessesPanelDataProps => ({
33     resources: state.resources,
34 });
35
36 export const WorkflowProcessesPanel = connect(mapStateToProps, mapDispatchToProps)(WorkflowProcessesPanelRoot);