X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3dcd0e5228ba58a37e55193f99573845a825693e..e57a8f466cdbaec06d35639cc54241600a6b54e7:/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 3cce8f3d..87386d50 100644 --- a/src/components/data-table/data-table.tsx +++ b/src/components/data-table/data-table.tsx @@ -35,12 +35,13 @@ export interface DataTableDataProps { currentRoute?: string; } -type CssRules = "tableBody" | "root" | "content" | "noItemsInfo" | 'tableCell' | 'arrow' | 'arrowButton'; +type CssRules = "tableBody" | "root" | "content" | "noItemsInfo" | 'tableCell' | 'arrow' | 'arrowButton' | 'tableCellWorkflows'; const styles: StyleRulesCallback = (theme: Theme) => ({ root: { overflowX: 'auto', - overflowY: 'hidden' + overflowY: 'auto', + height: 'calc(100vh - 280px)', }, content: { display: 'inline-block', @@ -54,7 +55,19 @@ const styles: StyleRulesCallback = (theme: Theme) => ({ padding: theme.spacing.unit }, tableCell: { - wordWrap: 'break-word' + wordWrap: 'break-word', + paddingRight: '24px' + }, + tableCellWorkflows: { + '&:nth-last-child(2)': { + padding: '0px', + maxWidth: '48px' + }, + '&:last-child': { + padding: '0px', + paddingRight: '24px', + width: '48px' + } }, arrow: { margin: 0 @@ -95,13 +108,14 @@ export const DataTable = withStyles(styles)( renderHeadCell = (column: DataColumn, index: number) => { const { name, key, renderHeader, filters, sortDirection } = column; - const { onSortToggle, onFiltersChange } = this.props; - return + const { onSortToggle, onFiltersChange, classes } = this.props; + return {renderHeader ? renderHeader() : countNodes(filters) > 0 ? onFiltersChange && onFiltersChange(filters, column)} @@ -125,14 +139,14 @@ export const DataTable = withStyles(styles)( ; } - ArrowIcon = ({className, ...props}: SvgIconProps) => ( - - + ArrowIcon = ({ className, ...props }: SvgIconProps) => ( + + ) renderBodyRow = (item: any, index: number) => { - const { onRowClick, onRowDoubleClick, extractKey, classes, currentItemUuid } = this.props; + const { onRowClick, onRowDoubleClick, extractKey, classes, currentItemUuid, currentRoute } = this.props; return onRowDoubleClick && onRowDoubleClick(event, item)} selected={item === currentItemUuid}> {this.mapVisibleColumns((column, index) => ( - + {column.render(item)} ))}