X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9fbb245286171bc55fed5b5104361a1869a1d76b..aca52d4ea87faf5063db188998edfee1dea4e002:/src/views/process-panel/process-panel.tsx

diff --git a/src/views/process-panel/process-panel.tsx b/src/views/process-panel/process-panel.tsx
index 402e5d0e..9f1d0adb 100644
--- a/src/views/process-panel/process-panel.tsx
+++ b/src/views/process-panel/process-panel.tsx
@@ -3,21 +3,28 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { Grid } from '@material-ui/core';
-import { ProcessInformationCard } from '~/views/process-panel/information-card';
-import { SubprocessesCard } from '~/views/process-panel/subprocesses-card';
+import { RootState } from '~/store/store';
+import { connect } from 'react-redux';
+import { getProcess, getSubprocesses } from '~/store/processes/process';
+import { Dispatch } from 'redux';
+import { openProcessContextMenu } from '~/store/context-menu/context-menu-actions';
+import { matchProcessRoute } from '~/routes/routes';
+import { ProcessPanelRootDataProps, ProcessPanelRootActionProps, ProcessPanelRoot } from './process-panel-root';
 
-export class ProcessPanel extends React.Component {
-    render() {
-        return <div>
-            <Grid container spacing={16}>
-                <Grid item xs={7}>
-                    <ProcessInformationCard />
-                </Grid>
-                <Grid item xs={5}>
-                    <SubprocessesCard />
-                </Grid>
-            </Grid>
-        </div>;
+const mapStateToProps = ({ router, resources }: RootState): ProcessPanelRootDataProps => {
+    const pathname = router.location ? router.location.pathname : '';
+    const match = matchProcessRoute(pathname);
+    const uuid = match ? match.params.id : '';
+    return {
+        process: getProcess(uuid)(resources),
+        subprocesses: getSubprocesses(uuid)(resources)
+    };
+};
+
+const mapDispatchToProps = (dispatch: Dispatch): ProcessPanelRootActionProps => ({
+    onContextMenu: (event: React.MouseEvent<HTMLElement>) => {
+        dispatch<any>(openProcessContextMenu(event));
     }
-}
+});
+
+export const ProcessPanel = connect(mapStateToProps, mapDispatchToProps)(ProcessPanelRoot);
