16719: Merge branch 'master' into 16719-collection-version-basic-ui
[arvados.git] / src / views / workflow-panel / workflow-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 { navigateTo } from '~/store/navigation/navigation-action';
8 import { WorkflowPanelView } from '~/views/workflow-panel/workflow-panel-view';
9 import { WorfklowPanelActionProps, WorkflowPanelDataProps } from './workflow-panel-view';
10 import { showWorkflowDetails, getWorkflowDetails } from '~/store/workflow-panel/workflow-panel-actions';
11 import { RootState } from '~/store/store';
12
13 const mapStateToProps = (state: RootState): WorkflowPanelDataProps => ({
14     workflow: getWorkflowDetails(state)
15 });
16
17 const mapDispatchToProps = (dispatch: Dispatch): WorfklowPanelActionProps => ({
18     handleRowDoubleClick: (uuid: string) => {
19         dispatch<any>(navigateTo(uuid));
20     },
21
22     handleRowClick: (uuid: string) => {
23         dispatch(showWorkflowDetails(uuid));
24     }
25 });
26
27 export const WorkflowPanel = connect(mapStateToProps, mapDispatchToProps)(WorkflowPanelView);