X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9c2c8aa06d5693a6e2b00e1d8ec0a8ca79098ce0..d5f11bb2fbb20c85e8ef857caedd58adf333e522:/src/components/data-explorer/data-explorer.tsx diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx index 7fce77de..55840ae9 100644 --- a/src/components/data-explorer/data-explorer.tsx +++ b/src/components/data-explorer/data-explorer.tsx @@ -15,7 +15,7 @@ import { CloseIcon, MaximizeIcon, MoreOptionsIcon } from 'components/icon/icon'; import { PaperProps } from '@material-ui/core/Paper'; import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view'; -type CssRules = 'searchBox' | "toolbar" | "toolbarUnderTitle" | "footer" | "root" | 'moreOptionsButton' | 'title'; +type CssRules = 'searchBox' | "toolbar" | "toolbarUnderTitle" | "footer" | "root" | 'moreOptionsButton' | 'title' | 'dataTable' | 'container'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ searchBox: { @@ -32,7 +32,7 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ overflow: 'auto' }, root: { - height: '100%' + height: '100%', }, moreOptionsButton: { padding: 0 @@ -41,7 +41,14 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ paddingLeft: theme.spacing.unit * 3, paddingTop: theme.spacing.unit * 3, fontSize: '18px' - } + }, + dataTable: { + height: '100%', + overflow: 'auto', + }, + container: { + height: '100%', + }, }); interface DataExplorerDataProps { @@ -86,11 +93,13 @@ type DataExplorerProps = DataExplorerDataProps & export const DataExplorer = withStyles(styles)( class DataExplorerGeneric extends React.Component> { + componentDidMount() { if (this.props.onSetColumns) { this.props.onSetColumns(this.props.columns); } } + render() { const { columns, onContextMenu, onFiltersChange, onSortToggle, working, extractKey, @@ -100,22 +109,26 @@ export const DataExplorer = withStyles(styles)( paperKey, fetchMode, currentItemUuid, title, doHidePanel, doMaximizePanel, panelName, panelMaximized } = this.props; - return - {title &&
{title}
} - {(!hideColumnSelector || !hideSearchInput) && + + const dataCy = this.props["data-cy"]; + return + + {title && {title}} + {(!hideColumnSelector || !hideSearchInput || !!actions) && -
+ {!hideSearchInput &&
{!hideSearchInput && } -
+
} {actions} {!hideColumnSelector && }
- { doMaximizePanel && !!!panelMaximized && + { doMaximizePanel && !panelMaximized && } @@ -123,8 +136,8 @@ export const DataExplorer = withStyles(styles)( } -
} -
} + onRowClick(item)} @@ -136,8 +149,8 @@ export const DataExplorer = withStyles(styles)( working={working} defaultView={dataTableDefaultView} currentItemUuid={currentItemUuid} - currentRoute={paperKey} /> - + currentRoute={paperKey} /> + {fetchMode === DataTableFetchMode.PAGINATED ? Load more} - +
+
; }