X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/58db72fee358d5987139a1b8526c0ca873e07dbf..394ebdfd13fe40a7096f484c46a353d2537f4c9a:/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 de52d365..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,7 +35,7 @@ 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: { @@ -48,6 +48,13 @@ const styles: StyleRulesCallback = (theme: Theme) => ({ tableBody: { background: theme.palette.background.paper }, + loader: { + top: '50%', + left: '50%', + marginTop: '-15px', + marginLeft: '-15px', + position: 'absolute' + }, noItemsInfo: { textAlign: "center", padding: theme.spacing.unit @@ -90,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()}