X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b6ac7fe88d347582d39fffa002e300af222c578f..c952afae1af2fb31b68be04f70bd7ae6f9d52aba:/src/components/data-table/data-table.tsx diff --git a/src/components/data-table/data-table.tsx b/src/components/data-table/data-table.tsx index 0c84f642..9a31cbfd 100644 --- a/src/components/data-table/data-table.tsx +++ b/src/components/data-table/data-table.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; -import { Table, TableBody, TableRow, TableCell, TableHead, TableSortLabel, StyleRulesCallback, Theme, WithStyles, withStyles, IconButton } from '@material-ui/core'; +import { Table, TableBody, TableRow, TableCell, TableHead, TableSortLabel, StyleRulesCallback, Theme, WithStyles, withStyles, IconButton, CircularProgress } from '@material-ui/core'; import classnames from 'classnames'; import { DataColumn, SortDirection } from './data-column'; import { DataTableDefaultView } from '../data-table-default-view/data-table-default-view'; @@ -35,21 +35,26 @@ export interface DataTableDataProps { currentRoute?: string; } -type CssRules = "tableBody" | "root" | "content" | "noItemsInfo" | 'tableCell' | 'arrow' | 'arrowButton' | 'tableCellWorkflows'; +type CssRules = "tableBody" | "root" | "content" | "noItemsInfo" | 'tableCell' | 'arrow' | 'arrowButton' | 'tableCellWorkflows' | 'loader'; const styles: StyleRulesCallback = (theme: Theme) => ({ root: { - overflowX: 'auto', - overflowY: 'auto', - height: 'calc(100vh - 280px)', + width: '100%', }, content: { display: 'inline-block', - width: '100%' + width: '100%', }, tableBody: { background: theme.palette.background.paper }, + loader: { + top: '50%', + left: '50%', + marginTop: '-15px', + marginLeft: '-15px', + position: 'absolute' + }, noItemsInfo: { textAlign: "center", padding: theme.spacing.unit @@ -92,7 +97,13 @@ export const DataTable = withStyles(styles)( - {items.map(this.renderBodyRow)} + { + this.props.working ? +
+ +
: + items.map(this.renderBodyRow) + }
{items.length === 0 && this.props.working !== undefined && !this.props.working && this.renderNoItemsPlaceholder()}