21225: Connect click handlers accidentally disconnected from project data tables
authorStephen Smith <stephen@curii.com>
Wed, 5 Jun 2024 13:55:22 +0000 (09:55 -0400)
committerStephen Smith <stephen@curii.com>
Fri, 7 Jun 2024 18:08:23 +0000 (14:08 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

services/workbench2/src/views/project-panel/project-panel-data.tsx
services/workbench2/src/views/project-panel/project-panel-run.tsx
services/workbench2/src/views/project-panel/project-panel.tsx

index 8526ebf08304b0bdf97ffda473654d8b4a247e6c..a8bde2cd9c16dbe73bbc812e2a8d357bfa8c8485 100644 (file)
@@ -152,19 +152,18 @@ const DEFAULT_VIEW_MESSAGES = ['No data found'];
 
 interface ProjectPanelDataProps {
     paperClassName?: string;
+    onRowClick: (uuid: string) => void;
+    onRowDoubleClick: (uuid: string) => void;
+    onContextMenu: (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => void;
 };
 
 export const ProjectPanelData = class extends React.Component<ProjectPanelDataProps> {
-    handleRowClick = () => {};
-    handleRowDoubleClick = () => {};
-    handleContextMenu = () => {};
-
     render () {
         return <DataExplorer
             id={PROJECT_PANEL_DATA_ID}
-            onRowClick={this.handleRowClick}
-            onRowDoubleClick={this.handleRowDoubleClick}
-            onContextMenu={this.handleContextMenu}
+            onRowClick={this.props.onRowClick}
+            onRowDoubleClick={this.props.onRowDoubleClick}
+            onContextMenu={this.props.onContextMenu}
             contextMenuColumn={true}
             defaultViewIcon={ProjectIcon}
             defaultViewMessages={DEFAULT_VIEW_MESSAGES}
index e89e76138912cb94f7ec322cadc00dea5dc7d6a4..4413bfd492f8b59cff0c6fa3b186f41b7e2c1ab4 100644 (file)
@@ -175,9 +175,12 @@ const DEFAULT_VIEW_MESSAGES = ['No workflow runs found'];
 interface ProjectPanelRunProps {
     project?: ProjectResource;
     paperClassName?: string;
+    onRowClick: (uuid: string) => void;
+    onRowDoubleClick: (uuid: string) => void;
+    onContextMenu: (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => void;
 }
 
-const mapStateToProps = (state: RootState): ProjectPanelRunProps => {
+const mapStateToProps = (state: RootState): Pick<ProjectPanelRunProps, 'project'> => {
     const projectUuid = getProjectPanelCurrentUuid(state) || "";
     const project = getResource<ProjectResource>(projectUuid)(state.resources);
     return {
@@ -186,15 +189,11 @@ const mapStateToProps = (state: RootState): ProjectPanelRunProps => {
 };
 
 export const ProjectPanelRun = connect(mapStateToProps)((props: ProjectPanelRunProps) => {
-    const handleRowClick = () => {};
-    const handleRowDoubleClick = () => {};
-    const handleContextMenu = () => {};
-
     return <DataExplorer
         id={PROJECT_PANEL_RUN_ID}
-        onRowClick={handleRowClick}
-        onRowDoubleClick={handleRowDoubleClick}
-        onContextMenu={handleContextMenu}
+        onRowClick={props.onRowClick}
+        onRowDoubleClick={props.onRowDoubleClick}
+        onContextMenu={props.onContextMenu}
         contextMenuColumn={true}
         defaultViewIcon={ProjectIcon}
         defaultViewMessages={DEFAULT_VIEW_MESSAGES}
index f84d8e70904f9f497fe2616d02044ba459023536..7a447509c5c9ec6882e8d72568c3f67f71fec2d6 100644 (file)
@@ -99,14 +99,22 @@ export const ProjectPanel = withStyles(styles)(
                             xs="auto"
                             data-cy="process-data"
                             className={classes.dataExplorer}>
-                            <ProjectPanelData />
+                            <ProjectPanelData
+                                onRowClick={this.handleRowClick}
+                                onRowDoubleClick={this.handleRowDoubleClick}
+                                onContextMenu={this.handleContextMenu}
+                            />
                         </MPVPanelContent>
                         <MPVPanelContent
                             forwardProps
                             xs="auto"
                             data-cy="process-run"
                             className={classes.dataExplorer}>
-                            <ProjectPanelRun />
+                            <ProjectPanelRun
+                                onRowClick={this.handleRowClick}
+                                onRowDoubleClick={this.handleRowDoubleClick}
+                                onContextMenu={this.handleContextMenu}
+                            />
                         </MPVPanelContent>
                     </MPVContainer>
                 </div>