X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f3b8d03f7063b162355bccfd71aeb2b8b67bbdbb..6477e004fb67681b8b64bcdbca187dbc32c6cd60:/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..ba710bc783 100644 --- a/services/workbench2/src/components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx @@ -17,15 +17,20 @@ import { CloseIcon, IconType, MaximizeIcon, UnMaximizeIcon, MoreVerticalIcon } f import { PaperProps } from "@material-ui/core/Paper"; import { MPVPanelProps } from "components/multi-panel-view/multi-panel-view"; -type CssRules = "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | "dataTable" | "container"; +type CssRules = "titleWrapper" | "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | 'subProcessTitle' | "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 +46,15 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ paddingLeft: theme.spacing.unit * 2, paddingTop: theme.spacing.unit * 2, fontSize: "18px", + paddingRight: "10px", + }, + subProcessTitle: { + display: "inline-block", + paddingLeft: theme.spacing.unit * 2, + paddingTop: theme.spacing.unit * 2, + fontSize: "18px", + flexGrow: 0, + paddingRight: "10px", }, dataTable: { height: "100%", @@ -50,11 +64,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, }, }); @@ -72,18 +84,19 @@ interface DataExplorerDataProps { defaultViewIcon?: IconType; defaultViewMessages?: string[]; working?: boolean; - currentRefresh?: string; currentRoute?: string; hideColumnSelector?: boolean; paperProps?: PaperProps; actions?: React.ReactNode; hideSearchInput?: boolean; title?: React.ReactNode; + progressBar?: React.ReactNode; paperKey?: string; currentItemUuid: string; elementPath?: string; isMSToolbarVisible: boolean; checkedList: TCheckedList; + isNotFound: boolean; } interface DataExplorerActionProps { @@ -107,50 +120,13 @@ type DataExplorerProps = DataExplorerDataProps & DataExplorerActionProps extends React.Component> { - state = { - showLoading: false, - prevRefresh: "", - prevRoute: "", - }; - - componentDidUpdate(prevProps: DataExplorerProps) { - const currentRefresh = this.props.currentRefresh || ""; - const currentRoute = this.props.currentRoute || ""; - if (currentRoute !== this.state.prevRoute) { - // Component already mounted, but the user comes from a route change, - // like browsing through a project hierarchy. - this.setState({ - showLoading: this.props.working, - prevRoute: currentRoute, - }); - } - - if (currentRefresh !== this.state.prevRefresh) { - // Component already mounted, but the user just clicked the - // refresh button. - this.setState({ - showLoading: this.props.working, - prevRefresh: currentRefresh, - }); - } - if (this.state.showLoading && !this.props.working) { - this.setState({ - showLoading: false, - }); - } - } + multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar; componentDidMount() { if (this.props.onSetColumns) { this.props.onSetColumns(this.props.columns); } - // Component just mounted, so we need to show the loading indicator. - this.setState({ - showLoading: this.props.working, - prevRefresh: this.props.currentRefresh || "", - prevRoute: this.props.currentRoute || "", - }); } render() { @@ -180,7 +156,9 @@ export const DataExplorer = withStyles(styles)( paperKey, fetchMode, currentItemUuid, + currentRoute, title, + progressBar, doHidePanel, doMaximizePanel, doUnMaximizePanel, @@ -190,6 +168,7 @@ export const DataExplorer = withStyles(styles)( toggleMSToolbar, setCheckedListOnStore, checkedList, + working, } = this.props; return ( -
+
{title && ( {title} )} + {!!progressBar && progressBar} + {this.multiSelectToolbarInTitle && } {(!hideColumnSelector || !hideSearchInput || !!actions) && ( - {!hideSearchInput && ( -
- {!hideSearchInput && ( - - )} -
- )} - {actions} - {!hideColumnSelector && ( - - )} + + {!hideSearchInput && ( +
+ {!hideSearchInput && ( + + )} +
+ )} + {actions} + {!hideColumnSelector && ( + + )} +
{doUnMaximizePanel && panelMaximized && ( )}
-
)}
+ {!this.multiSelectToolbarInTitle && } this.props.onContextMenu(event, item)} + onClick={event => { + event.stopPropagation() + this.props.onContextMenu(event, item) + }} >