X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c55409793ebc677e5ca5210cb546e2b5420cb3c8..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 b3a93bbb79..604856a852 100644 --- a/services/workbench2/src/components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx @@ -17,13 +17,16 @@ 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" | 'subProcessTitle' | "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, }, @@ -37,6 +40,8 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, root: { height: "100%", + flex: 1, + overflowY: "auto", }, moreOptionsButton: { padding: 0, @@ -93,7 +98,8 @@ interface DataExplorerDataProps { title?: React.ReactNode; progressBar?: React.ReactNode; paperKey?: string; - currentItemUuid: string; + currentRouteUuid: string; + selectedResourceUuid: string; elementPath?: string; isMSToolbarVisible: boolean; checkedList: TCheckedList; @@ -114,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; @@ -124,10 +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 || ""; @@ -154,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() { @@ -194,7 +207,7 @@ export const DataExplorer = withStyles(styles)( hideSearchInput, paperKey, fetchMode, - currentItemUuid, + selectedResourceUuid, currentRoute, title, progressBar, @@ -232,7 +245,7 @@ export const DataExplorer = withStyles(styles)( )} {!!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) + }} >