X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b5b6d3dd22b597c9626a396b6449c4f7c9557794..2563eaaa00e5ffb77981fbb8cc1bdd37fb2a3ca6:/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 db7b484a..25d81c62 100644
--- a/src/components/data-table/data-table.tsx
+++ b/src/components/data-table/data-table.tsx
@@ -19,10 +19,11 @@ export interface DataTableDataProps<T> {
     onSortToggle: (column: DataColumn<T>) => void;
     onFiltersChange: (filters: DataTableFilterItem[], column: DataColumn<T>) => void;
     extractKey?: (item: T) => React.Key;
+    working?: boolean;
     defaultView?: React.ReactNode;
 }
 
-type CssRules = "tableBody" | "root" | "content" | "noItemsInfo";
+type CssRules = "tableBody" | "root" | "content" | "noItemsInfo" | 'tableCell';
 
 const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
     root: {
@@ -31,6 +32,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
     },
     content: {
         display: 'inline-block',
+        width: '100%'
     },
     tableBody: {
         background: theme.palette.background.paper
@@ -39,6 +41,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
         textAlign: "center",
         padding: theme.spacing.unit
     },
+    tableCell: {
+        wordWrap: 'break-word'
+    }
 });
 
 type DataTableProps<T> = DataTableDataProps<T> & WithStyles<CssRules>;
@@ -59,7 +64,7 @@ export const DataTable = withStyles(styles)(
                             {items.map(this.renderBodyRow)}
                         </TableBody>
                     </Table>
-                    {items.length === 0 && this.renderNoItemsPlaceholder()}
+                    {items.length === 0 && this.props.working !== undefined && !this.props.working && this.renderNoItemsPlaceholder()}
                 </div>
             </div>;
         }
@@ -67,13 +72,13 @@ export const DataTable = withStyles(styles)(
         renderNoItemsPlaceholder = () => {
             return this.props.defaultView
                 ? this.props.defaultView
-                : <DataTableDefaultView />;
+                : <DataTableDefaultView/>;
         }
 
         renderHeadCell = (column: DataColumn<T>, index: number) => {
             const { name, key, renderHeader, filters, sortDirection } = column;
             const { onSortToggle, onFiltersChange } = this.props;
-            return <TableCell key={key || index} style={{ width: column.width, minWidth: column.width }}>
+            return <TableCell key={key || index}>
                 {renderHeader ?
                     renderHeader() :
                     filters.length > 0
@@ -101,7 +106,7 @@ export const DataTable = withStyles(styles)(
         }
 
         renderBodyRow = (item: T, index: number) => {
-            const { onRowClick, onRowDoubleClick, extractKey } = this.props;
+            const { onRowClick, onRowDoubleClick, extractKey, classes } = this.props;
             return <TableRow
                 hover
                 key={extractKey ? extractKey(item) : index}
@@ -109,7 +114,7 @@ export const DataTable = withStyles(styles)(
                 onContextMenu={this.handleRowContextMenu(item)}
                 onDoubleClick={event => onRowDoubleClick && onRowDoubleClick(event, item)}>
                 {this.mapVisibleColumns((column, index) => (
-                    <TableCell key={column.key || index}>
+                    <TableCell key={column.key || index} className={classes.tableCell}>
                         {column.render(item)}
                     </TableCell>
                 ))}
