From 877a089738b525098e5e6e63179b6826408f9b5d Mon Sep 17 00:00:00 2001 From: Michal Klobukowski Date: Mon, 10 Dec 2018 23:44:21 +0100 Subject: [PATCH] Refactor data-explorer to make it background more customizable, add slot for custom actions Feature #14505 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- .../data-explorer/data-explorer.tsx | 22 +++++++++---------- src/views/user-panel/user-panel.tsx | 19 ++++++++++------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx index d906a32c..b6b9a83b 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 = (theme: ArvadosTheme) => ({ searchBox: { @@ -28,10 +29,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { height: '100%' }, - rootUserPanel: { - height: '100%', - boxShadow: 'none' - }, moreOptionsButton: { padding: 0 } @@ -48,7 +45,9 @@ interface DataExplorerDataProps { contextMenuColumn: boolean; dataTableDefaultView?: React.ReactNode; working?: boolean; - isUserPanel?: boolean; + hideColumnSelector?: boolean; + paperProps?: PaperProps; + actions?: React.ReactNode; } interface DataExplorerActionProps { @@ -79,17 +78,18 @@ 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, } = this.props; - return - + return +
- {!isUserPanel && }
diff --git a/src/views/user-panel/user-panel.tsx b/src/views/user-panel/user-panel.tsx index f28cca3b..b152896f 100644 --- a/src/views/user-panel/user-panel.tsx +++ b/src/views/user-panel/user-panel.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { WithStyles, withStyles, Typography, Tabs, Tab, Paper, Button } from '@material-ui/core'; +import { WithStyles, withStyles, Typography, Tabs, Tab, Paper, Button, Grid } from '@material-ui/core'; import { DataExplorer } from "~/views-components/data-explorer/data-explorer"; import { connect, DispatchProp } from 'react-redux'; import { DataColumns } from '~/components/data-table/data-table'; @@ -163,18 +163,23 @@ export const UserPanel = compose( {value === 0 && -
- -
+ + + } + paperProps={{ + elevation: 0, + }} dataTableDefaultView={