X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d6c180028671059f19912a11887b804e9d63d608..refs/heads/18549-global-search-results-show-path:/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 f3cccfce..051f5d34 100644 --- a/src/components/data-explorer/data-explorer.tsx +++ b/src/components/data-explorer/data-explorer.tsx @@ -11,34 +11,45 @@ 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' | 'headerMenu' | "toolbar" | "footer" | "root" | 'moreOptionsButton' | 'title' | 'dataTable' | 'container'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ searchBox: { paddingBottom: theme.spacing.unit * 2 }, toolbar: { - paddingTop: theme.spacing.unit * 2 - }, - toolbarUnderTitle: { - paddingTop: 0 + paddingTop: theme.spacing.unit, + paddingRight: theme.spacing.unit * 2, }, footer: { overflow: 'auto' }, root: { - height: '100%' + height: '100%', }, moreOptionsButton: { padding: 0 }, title: { + display: 'inline-block', paddingLeft: theme.spacing.unit * 3, paddingTop: theme.spacing.unit * 3, fontSize: '18px' + }, + dataTable: { + height: '100%', + overflow: 'auto', + }, + container: { + height: '100%', + }, + headerMenu: { + float: 'right', + display: 'inline-block' } }); @@ -62,6 +73,7 @@ interface DataExplorerDataProps { title?: React.ReactNode; paperKey?: string; currentItemUuid: string; + elementPath?: string; } interface DataExplorerActionProps { @@ -79,40 +91,63 @@ 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, elementPath } = this.props; - return - {title &&
{title}
} - {(!hideColumnSelector || !hideSearchInput || !!actions) && - - {!hideSearchInput &&
- {!hideSearchInput && } -
} - {actions} - {!hideColumnSelector && } -
-
} - + +
+ {title && {title}} + { + (!hideColumnSelector || !hideSearchInput || !!actions) && + + + + {!hideSearchInput &&
+ {!hideSearchInput && } +
} + {actions} + {!hideColumnSelector && } +
+ { doMaximizePanel && !panelMaximized && + + + } + { doHidePanel && + + + } +
+
+ } +
+ onRowClick(item)} @@ -124,9 +159,17 @@ export const DataExplorer = withStyles(styles)( working={working} defaultView={dataTableDefaultView} currentItemUuid={currentItemUuid} - currentRoute={paperKey} /> - - + currentRoute={paperKey} /> + + { + elementPath && + + + {elementPath} + + + } + {fetchMode === DataTableFetchMode.PAGINATED ? Load more} - + +
; }