X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/095e176632bbf81d28a239742a1ecce12404bd2d..0b74cbfdc8d1cb7d9223bd64ddac390dcdae3cc2:/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 8f5661929b..5eb5fdfca2 100644 --- a/services/workbench2/src/components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx @@ -17,13 +17,19 @@ 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 = "titleWrapper" | "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | "dataTable" | "container"; +type CssRules = "titleWrapper" | "msToolbarStyles" | "subpanelToolbarStyles" | "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", + }, + subpanelToolbarStyles: { + paddingTop: "1.2rem", + }, searchBox: { paddingBottom: 0, }, @@ -37,11 +43,20 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, root: { height: "100%", + flex: 1, + overflowY: "auto", }, moreOptionsButton: { padding: 0, }, title: { + display: "inline-block", + 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, @@ -86,7 +101,8 @@ interface DataExplorerDataProps { title?: React.ReactNode; progressBar?: React.ReactNode; paperKey?: string; - currentItemUuid: string; + currentRouteUuid: string; + selectedResourceUuid: string; elementPath?: string; isMSToolbarVisible: boolean; checkedList: TCheckedList; @@ -107,6 +123,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; @@ -117,10 +134,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 || ""; @@ -147,6 +165,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() { @@ -187,7 +210,8 @@ export const DataExplorer = withStyles(styles)( hideSearchInput, paperKey, fetchMode, - currentItemUuid, + selectedResourceUuid, + currentRoute, title, progressBar, doHidePanel, @@ -213,18 +237,18 @@ export const DataExplorer = withStyles(styles)( wrap="nowrap" className={classes.container} > -
+
{title && ( {title} )} {!!progressBar && progressBar} - {this.multiSelectToolbarInTitle && } + {this.multiSelectToolbarInTitle && !this.state.msToolbarInDetailsCard && } {(!hideColumnSelector || !hideSearchInput || !!actions) && ( )}
- {!this.multiSelectToolbarInTitle && } + {!this.multiSelectToolbarInTitle && } this.props.onContextMenu(event, item)} + onClick={event => { + event.stopPropagation() + this.props.onContextMenu(event, item) + }} >