X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f3b8d03f7063b162355bccfd71aeb2b8b67bbdbb..1a1258b91f61253d78a6b0552e2f03f9dec73b1f:/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..604856a852 100644 --- a/services/workbench2/src/components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx @@ -17,21 +17,31 @@ 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" | "msToolbarStyles" | "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | 'subProcessTitle' | "dataTable" | "container"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ + titleWrapper: { + display: "flex", + justifyContent: "space-between", + }, + msToolbarStyles: { + paddingTop: "0.6rem", + }, searchBox: { paddingBottom: 0, }, toolbar: { paddingTop: 0, paddingRight: theme.spacing.unit, + paddingLeft: "10px", }, footer: { overflow: "auto", }, root: { height: "100%", + flex: 1, + overflowY: "auto", }, moreOptionsButton: { padding: 0, @@ -41,6 +51,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 +69,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,8 +96,10 @@ interface DataExplorerDataProps { actions?: React.ReactNode; hideSearchInput?: boolean; title?: React.ReactNode; + progressBar?: React.ReactNode; paperKey?: string; - currentItemUuid: string; + currentRouteUuid: string; + selectedResourceUuid: string; elementPath?: string; isMSToolbarVisible: boolean; checkedList: TCheckedList; @@ -101,6 +120,7 @@ interface DataExplorerActionProps { extractKey?: (item: T) => React.Key; toggleMSToolbar: (isVisible: boolean) => void; setCheckedListOnStore: (checkedList: TCheckedList) => void; + setSelectedUuid: (uuid: string) => void; } type DataExplorerProps = DataExplorerDataProps & DataExplorerActionProps & WithStyles & MPVPanelProps; @@ -111,8 +131,11 @@ export const DataExplorer = withStyles(styles)( showLoading: false, prevRefresh: "", prevRoute: "", + msToolbarInDetailsCard: false, }; + multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar; + componentDidUpdate(prevProps: DataExplorerProps) { const currentRefresh = this.props.currentRefresh || ""; const currentRoute = this.props.currentRoute || ""; @@ -139,6 +162,11 @@ export const DataExplorer = withStyles(styles)( showLoading: false, }); } + if (this.props.selectedResourceUuid !== prevProps.selectedResourceUuid || this.props.currentRouteUuid !== prevProps.currentRouteUuid) { + this.setState({ + msToolbarInDetailsCard: this.props.selectedResourceUuid === this.props.currentRouteUuid, + }); + } } componentDidMount() { @@ -179,8 +207,10 @@ export const DataExplorer = withStyles(styles)( hideSearchInput, paperKey, fetchMode, - currentItemUuid, + selectedResourceUuid, + currentRoute, title, + progressBar, doHidePanel, doMaximizePanel, doUnMaximizePanel, @@ -204,16 +234,18 @@ export const DataExplorer = withStyles(styles)( wrap="nowrap" className={classes.container} > -
+
{title && ( {title} )} + {!!progressBar && progressBar} + {this.multiSelectToolbarInTitle && !this.state.msToolbarInDetailsCard && } {(!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) + }} >