X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4ad6191d53207a8b2d4c0c8a30b18119daaa5fbc..1e9e1e556f51abaa2f001b1c280f1d4a09ca75e2:/services/workbench2/src/components/data-explorer/data-explorer.tsx?ds=sidebyside diff --git a/services/workbench2/src/components/data-explorer/data-explorer.tsx b/services/workbench2/src/components/data-explorer/data-explorer.tsx index ad5762dfeb..4e89b752a6 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, }, }); @@ -79,11 +91,13 @@ interface DataExplorerDataProps { 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 { @@ -105,14 +119,20 @@ interface DataExplorerActionProps { type DataExplorerProps = DataExplorerDataProps & DataExplorerActionProps & WithStyles & MPVPanelProps; +type DataExplorerState = { + prevRefresh: string; + prevRoute: string; +}; + export const DataExplorer = withStyles(styles)( class DataExplorerGeneric extends React.Component> { - state = { - showLoading: false, + state: DataExplorerState = { prevRefresh: "", prevRoute: "", }; + multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar; + componentDidUpdate(prevProps: DataExplorerProps) { const currentRefresh = this.props.currentRefresh || ""; const currentRoute = this.props.currentRoute || ""; @@ -121,7 +141,6 @@ export const DataExplorer = withStyles(styles)( // 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, }); } @@ -130,15 +149,9 @@ export const DataExplorer = withStyles(styles)( // 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, - }); - } } componentDidMount() { @@ -147,7 +160,6 @@ export const DataExplorer = withStyles(styles)( } // 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 || "", }); @@ -180,7 +192,9 @@ export const DataExplorer = withStyles(styles)( paperKey, fetchMode, currentItemUuid, + currentRoute, title, + progressBar, doHidePanel, doMaximizePanel, doUnMaximizePanel, @@ -190,6 +204,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) + }} >