X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e8d0331277033fea37a9fd73ffc781ffca8759f0..5219b97601d3aee849081f81536f8edd91d9ad53:/src/components/data-explorer/data-explorer.tsx?ds=sidebyside

diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index e90b1c27..1073ddd8 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -5,10 +5,10 @@
 import * as React from 'react';
 import { Grid, Paper, Toolbar, StyleRulesCallback, withStyles, Theme, WithStyles, TablePagination, IconButton } from '@material-ui/core';
 import MoreVertIcon from "@material-ui/icons/MoreVert";
-import ColumnSelector from "../../components/column-selector/column-selector";
-import DataTable, { DataColumns, DataItem } from "../../components/data-table/data-table";
-import { DataColumn } from "../../components/data-table/data-column";
-import { DataTableFilterItem } from '../../components/data-table-filters/data-table-filters';
+import ColumnSelector from "../column-selector/column-selector";
+import DataTable, { DataColumns } from "../data-table/data-table";
+import { DataColumn } from "../data-table/data-column";
+import { DataTableFilterItem } from '../data-table-filters/data-table-filters';
 import SearchInput from '../search-input/search-input';
 
 interface DataExplorerProps<T> {
@@ -21,15 +21,17 @@ interface DataExplorerProps<T> {
     page: number;
     onSearch: (value: string) => void;
     onRowClick: (item: T) => void;
+    onRowDoubleClick: (item: T) => void;
     onColumnToggle: (column: DataColumn<T>) => void;
     onContextMenu: (event: React.MouseEvent<HTMLElement>, item: T) => void;
     onSortToggle: (column: DataColumn<T>) => void;
     onFiltersChange: (filters: DataTableFilterItem[], column: DataColumn<T>) => void;
     onChangePage: (page: number) => void;
     onChangeRowsPerPage: (rowsPerPage: number) => void;
+    extractKey?: (item: T) => React.Key;
 }
 
-class DataExplorer<T extends DataItem> extends React.Component<DataExplorerProps<T> & WithStyles<CssRules>> {
+class DataExplorer<T> extends React.Component<DataExplorerProps<T> & WithStyles<CssRules>> {
 
     render() {
         return <Paper>
@@ -50,8 +52,10 @@ class DataExplorer<T extends DataItem> extends React.Component<DataExplorerProps
                 items={this.props.items}
                 onRowClick={(_, item: T) => this.props.onRowClick(item)}
                 onContextMenu={this.props.onContextMenu}
+                onRowDoubleClick={(_, item: T) => this.props.onRowDoubleClick(item)}
                 onFiltersChange={this.props.onFiltersChange}
-                onSortToggle={this.props.onSortToggle} />
+                onSortToggle={this.props.onSortToggle}
+                extractKey={this.props.extractKey} />
             <Toolbar>
                 {this.props.items.length > 0 &&
                     <Grid container justify="flex-end">
