X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c8528155683c9cf4f11ee6d78da8d9b86a3203bf..2b3f667039ba2e7efe0852d58ae2c62899b773f0:/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 d7abde7b..cb979c7b 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -4,15 +4,16 @@
 
 import * as React from 'react';
 import { Grid, Paper, Toolbar, StyleRulesCallback, withStyles, WithStyles, TablePagination, IconButton, Tooltip } from '@material-ui/core';
-import MoreVertIcon from "@material-ui/icons/MoreVert";
 import { ColumnSelector } from "../column-selector/column-selector";
 import { DataTable, DataColumns } from "../data-table/data-table";
 import { DataColumn, SortDirection } from "../data-table/data-column";
-import { DataTableFilterItem } from '../data-table-filters/data-table-filters';
 import { SearchInput } from '../search-input/search-input';
 import { ArvadosTheme } from "~/common/custom-theme";
+import { createTree } from '~/models/tree';
+import { DataTableFilters } from '../data-table-filters/data-table-filters-tree';
+import { MoreOptionsIcon } from '~/components/icon/icon';
 
-type CssRules = 'searchBox' | "toolbar" | "root";
+type CssRules = 'searchBox' | "toolbar" | "footer" | "root" | 'moreOptionsButton';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     searchBox: {
@@ -21,8 +22,14 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     toolbar: {
         paddingTop: theme.spacing.unit * 2
     },
+    footer: {
+        overflow: 'auto'
+    },
     root: {
         height: '100%'
+    },
+    moreOptionsButton: {
+        padding: 0
     }
 });
 
@@ -47,7 +54,7 @@ interface DataExplorerActionProps<T> {
     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;
+    onFiltersChange: (filters: DataTableFilters, column: DataColumn<T>) => void;
     onChangePage: (page: number) => void;
     onChangeRowsPerPage: (rowsPerPage: number) => void;
     extractKey?: (item: T) => React.Key;
@@ -94,7 +101,7 @@ export const DataExplorer = withStyles(styles)(
                     working={working}
                     defaultView={dataTableDefaultView}
                 />
-                <Toolbar>
+                <Toolbar className={classes.footer}>
                     <Grid container justify="flex-end">
                         <TablePagination
                             count={itemsAvailable}
@@ -118,10 +125,10 @@ export const DataExplorer = withStyles(styles)(
         }
 
         renderContextMenuTrigger = (item: T) =>
-            <Grid container justify="flex-end">
-                <Tooltip title="More options">
-                    <IconButton onClick={event => this.props.onContextMenu(event, item)}>
-                        <MoreVertIcon />
+            <Grid container justify="center">
+                <Tooltip title="More options" disableFocusListener>
+                    <IconButton className={this.props.classes.moreOptionsButton} onClick={event => this.props.onContextMenu(event, item)}>
+                        <MoreOptionsIcon />
                     </IconButton>
                 </Tooltip>
             </Grid>
@@ -131,7 +138,7 @@ export const DataExplorer = withStyles(styles)(
             selected: true,
             configurable: false,
             sortDirection: SortDirection.NONE,
-            filters: [],
+            filters: createTree(),
             key: "context-actions",
             render: this.renderContextMenuTrigger
         };
