X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3ed6fab9c3ec7ca31133e4d4c750d546727b1847..refs/heads/21329-search-panel-cluster-info-bug:/services/workbench2/src/components/data-explorer/data-explorer.tsx diff --git a/services/workbench2/src/components/data-explorer/data-explorer.tsx b/services/workbench2/src/components/data-explorer/data-explorer.tsx index ad5762dfeb..0e71fbcbd4 100644 --- a/services/workbench2/src/components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx @@ -16,16 +16,22 @@ import { DataTableFilters } from "components/data-table-filters/data-table-filte import { CloseIcon, IconType, MaximizeIcon, UnMaximizeIcon, MoreVerticalIcon } from "components/icon/icon"; import { PaperProps } from "@material-ui/core/Paper"; import { MPVPanelProps } from "components/multi-panel-view/multi-panel-view"; +import classNames from "classnames"; -type CssRules = "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | "dataTable" | "container"; +type CssRules = "titleWrapper" | "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | "titleWithProgress" | "dataTable" | "container"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ + titleWrapper: { + display: "flex", + justifyContent: "space-between", + }, searchBox: { paddingBottom: 0, }, toolbar: { paddingTop: 0, paddingRight: theme.spacing.unit, + paddingLeft: "10px", }, footer: { overflow: "auto", @@ -41,6 +47,10 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ paddingLeft: theme.spacing.unit * 2, paddingTop: theme.spacing.unit * 2, fontSize: "18px", + paddingRight: "10px", + }, + titleWithProgress: { + flexGrow: 0, }, dataTable: { height: "100%", @@ -50,11 +60,9 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ height: "100%", }, headerMenu: { - width: "100%", - float: "right", - display: "flex", - flexDirection: "row-reverse", - justifyContent: "space-between", + marginLeft: "auto", + flexBasis: "initial", + flexGrow: 0, }, }); @@ -79,6 +87,7 @@ interface DataExplorerDataProps { actions?: React.ReactNode; hideSearchInput?: boolean; title?: React.ReactNode; + progressBar?: React.ReactNode; paperKey?: string; currentItemUuid: string; elementPath?: string; @@ -113,6 +122,8 @@ export const DataExplorer = withStyles(styles)( prevRoute: "", }; + multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar; + componentDidUpdate(prevProps: DataExplorerProps) { const currentRefresh = this.props.currentRefresh || ""; const currentRoute = this.props.currentRoute || ""; @@ -181,6 +192,7 @@ export const DataExplorer = withStyles(styles)( fetchMode, currentItemUuid, title, + progressBar, doHidePanel, doMaximizePanel, doUnMaximizePanel, @@ -204,16 +216,18 @@ export const DataExplorer = withStyles(styles)( wrap="nowrap" className={classes.container} > -
+
{title && ( {title} )} + {!!progressBar && progressBar} + {this.multiSelectToolbarInTitle && } {(!hideColumnSelector || !hideSearchInput || !!actions) && ( - {!hideSearchInput && ( -
- {!hideSearchInput && ( - - )} -
- )} - {actions} - {!hideColumnSelector && ( - - )} + + {!hideSearchInput && ( +
+ {!hideSearchInput && ( + + )} +
+ )} + {actions} + {!hideColumnSelector && ( + + )} +
{doUnMaximizePanel && panelMaximized && ( )}
-
)}
+ {!this.multiSelectToolbarInTitle && }