X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/ad5208965b91e020b431cd9d2c1d15ff4b856450..61cd8fe9d4fe4dfeab443f31bbbc5effa5176765:/src/components/data-explorer/data-explorer.tsx

diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index d906a32c..b6ca215d 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { Grid, Paper, Toolbar, StyleRulesCallback, withStyles, WithStyles, TablePagination, IconButton, Tooltip } from '@material-ui/core';
+import { Grid, Paper, Toolbar, StyleRulesCallback, withStyles, WithStyles, TablePagination, IconButton, Tooltip, Button } from '@material-ui/core';
 import { ColumnSelector } from "~/components/column-selector/column-selector";
 import { DataTable, DataColumns } from "~/components/data-table/data-table";
 import { DataColumn, SortDirection } from "~/components/data-table/data-column";
@@ -12,8 +12,9 @@ import { ArvadosTheme } from "~/common/custom-theme";
 import { createTree } from '~/models/tree';
 import { DataTableFilters } from '~/components/data-table-filters/data-table-filters-tree';
 import { MoreOptionsIcon } from '~/components/icon/icon';
+import { PaperProps } from '@material-ui/core/Paper';
 
-type CssRules = 'searchBox' | "toolbar" | "footer" | "root" | 'moreOptionsButton' | 'rootUserPanel';
+type CssRules = 'searchBox' | "toolbar" | "footer" | "root" | 'moreOptionsButton';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     searchBox: {
@@ -28,10 +29,6 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
         height: '100%'
     },
-    rootUserPanel: {
-        height: '100%',
-        boxShadow: 'none'
-    },
     moreOptionsButton: {
         padding: 0
     }
@@ -48,7 +45,11 @@ interface DataExplorerDataProps<T> {
     contextMenuColumn: boolean;
     dataTableDefaultView?: React.ReactNode;
     working?: boolean;
-    isUserPanel?: boolean;
+    hideColumnSelector?: boolean;
+    paperProps?: PaperProps;
+    actions?: React.ReactNode;
+    hideSearchInput?: boolean;
+    paperKey?: string;
 }
 
 interface DataExplorerActionProps<T> {
@@ -79,17 +80,19 @@ export const DataExplorer = withStyles(styles)(
                 columns, onContextMenu, onFiltersChange, onSortToggle, working, extractKey,
                 rowsPerPage, rowsPerPageOptions, onColumnToggle, searchValue, onSearch,
                 items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
-                dataTableDefaultView, isUserPanel
+                dataTableDefaultView, hideColumnSelector, actions, paperProps, hideSearchInput,
+                paperKey
             } = this.props;
-            return <Paper className={!isUserPanel ? classes.root : classes.rootUserPanel}>
-                <Toolbar className={!isUserPanel ? classes.toolbar : ''}>
+            return <Paper className={classes.root} {...paperProps} key={paperKey}>
+                <Toolbar className={classes.toolbar}>
                     <Grid container justify="space-between" wrap="nowrap" alignItems="center">
-                        <div className={classes.searchBox}>
+                        {!hideSearchInput && <div className={classes.searchBox}>
                             <SearchInput
                                 value={searchValue}
                                 onSearch={onSearch} />
-                        </div>
-                        {!isUserPanel && <ColumnSelector
+                        </div>}
+                        {actions}
+                        {!hideColumnSelector && <ColumnSelector
                             columns={columns}
                             onColumnToggle={onColumnToggle} />}
                     </Grid>
@@ -104,8 +107,7 @@ export const DataExplorer = withStyles(styles)(
                     onSortToggle={onSortToggle}
                     extractKey={extractKey}
                     working={working}
-                    defaultView={dataTableDefaultView}
-                />
+                    defaultView={dataTableDefaultView} />
                 <Toolbar className={classes.footer}>
                     <Grid container justify="flex-end">
                         <TablePagination
