X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/04ddc76f953ae6c61264a9c1fa5a8cade9e1773e..58db72fee358d5987139a1b8526c0ca873e07dbf:/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 928d3ed4..55840ae9 100644 --- a/src/components/data-explorer/data-explorer.tsx +++ b/src/components/data-explorer/data-explorer.tsx @@ -11,17 +11,19 @@ import { SearchInput } from 'components/search-input/search-input'; import { ArvadosTheme } from "common/custom-theme"; import { createTree } from 'models/tree'; import { DataTableFilters } from 'components/data-table-filters/data-table-filters-tree'; -import { MoreOptionsIcon } from 'components/icon/icon'; +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: { paddingBottom: theme.spacing.unit * 2 }, toolbar: { - paddingTop: theme.spacing.unit * 2 + paddingTop: theme.spacing.unit, + paddingRight: theme.spacing.unit * 2, }, toolbarUnderTitle: { paddingTop: 0 @@ -30,7 +32,7 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ overflow: 'auto' }, root: { - height: '100%' + height: '100%', }, moreOptionsButton: { padding: 0 @@ -39,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 { @@ -79,32 +88,39 @@ interface DataExplorerActionProps { extractKey?: (item: T) => React.Key; } -type DataExplorerProps = DataExplorerDataProps & DataExplorerActionProps & WithStyles; +type DataExplorerProps = DataExplorerDataProps & + DataExplorerActionProps & WithStyles & MPVPanelProps; 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, rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, searchValue, onSearch, items, itemsAvailable, onRowClick, onRowDoubleClick, classes, dataTableDefaultView, hideColumnSelector, actions, paperProps, hideSearchInput, - paperKey, fetchMode, currentItemUuid, title + paperKey, fetchMode, currentItemUuid, title, + doHidePanel, doMaximizePanel, panelName, panelMaximized } = this.props; + const dataCy = this.props["data-cy"]; return - {title &&
{title}
} - {(!hideColumnSelector || !hideSearchInput || !!actions) && + + {title && {title}} + {(!hideColumnSelector || !hideSearchInput || !!actions) && {!hideSearchInput &&
{!hideSearchInput && }
} {actions} @@ -112,8 +128,16 @@ export const DataExplorer = withStyles(styles)( columns={columns} onColumnToggle={onColumnToggle} />}
-
} - + + } + { doHidePanel && + + + } +
} + onRowClick(item)} @@ -125,8 +149,8 @@ export const DataExplorer = withStyles(styles)( working={working} defaultView={dataTableDefaultView} currentItemUuid={currentItemUuid} - currentRoute={paperKey} /> - + currentRoute={paperKey} /> + {fetchMode === DataTableFetchMode.PAGINATED ? Load more} - + +
; }