projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
21224: fixed subpanel toolbar css Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa...
[arvados.git]
/
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 8f5661929bff5b1f95c27c4d650f6a8d9717c1f8..5eb5fdfca24c7ed5743f09b6f5b73bb3f24fb84f 100644
(file)
--- 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";
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<CssRules> = (theme: ArvadosTheme) => ({
titleWrapper: {
display: "flex",
justifyContent: "space-between",
},
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
titleWrapper: {
display: "flex",
justifyContent: "space-between",
},
+ msToolbarStyles: {
+ paddingTop: "0.6rem",
+ },
+ subpanelToolbarStyles: {
+ paddingTop: "1.2rem",
+ },
searchBox: {
paddingBottom: 0,
},
searchBox: {
paddingBottom: 0,
},
@@
-37,11
+43,20
@@
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
},
root: {
height: "100%",
},
root: {
height: "100%",
+ flex: 1,
+ overflowY: "auto",
},
moreOptionsButton: {
padding: 0,
},
title: {
},
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,
display: "inline-block",
paddingLeft: theme.spacing.unit * 2,
paddingTop: theme.spacing.unit * 2,
@@
-86,7
+101,8
@@
interface DataExplorerDataProps<T> {
title?: React.ReactNode;
progressBar?: React.ReactNode;
paperKey?: string;
title?: React.ReactNode;
progressBar?: React.ReactNode;
paperKey?: string;
- currentItemUuid: string;
+ currentRouteUuid: string;
+ selectedResourceUuid: string;
elementPath?: string;
isMSToolbarVisible: boolean;
checkedList: TCheckedList;
elementPath?: string;
isMSToolbarVisible: boolean;
checkedList: TCheckedList;
@@
-107,6
+123,7
@@
interface DataExplorerActionProps<T> {
extractKey?: (item: T) => React.Key;
toggleMSToolbar: (isVisible: boolean) => void;
setCheckedListOnStore: (checkedList: TCheckedList) => void;
extractKey?: (item: T) => React.Key;
toggleMSToolbar: (isVisible: boolean) => void;
setCheckedListOnStore: (checkedList: TCheckedList) => void;
+ setSelectedUuid: (uuid: string) => void;
}
type DataExplorerProps<T> = DataExplorerDataProps<T> & DataExplorerActionProps<T> & WithStyles<CssRules> & MPVPanelProps;
}
type DataExplorerProps<T> = DataExplorerDataProps<T> & DataExplorerActionProps<T> & WithStyles<CssRules> & MPVPanelProps;
@@
-117,10
+134,11
@@
export const DataExplorer = withStyles(styles)(
showLoading: false,
prevRefresh: "",
prevRoute: "",
showLoading: false,
prevRefresh: "",
prevRoute: "",
+ msToolbarInDetailsCard: false,
};
multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar;
};
multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar;
-
+
componentDidUpdate(prevProps: DataExplorerProps<T>) {
const currentRefresh = this.props.currentRefresh || "";
const currentRoute = this.props.currentRoute || "";
componentDidUpdate(prevProps: DataExplorerProps<T>) {
const currentRefresh = this.props.currentRefresh || "";
const currentRoute = this.props.currentRoute || "";
@@
-147,6
+165,11
@@
export const DataExplorer = withStyles(styles)(
showLoading: false,
});
}
showLoading: false,
});
}
+ if (this.props.selectedResourceUuid !== prevProps.selectedResourceUuid || this.props.currentRouteUuid !== prevProps.currentRouteUuid) {
+ this.setState({
+ msToolbarInDetailsCard: this.props.selectedResourceUuid === this.props.currentRouteUuid,
+ });
+ }
}
componentDidMount() {
}
componentDidMount() {
@@
-187,7
+210,8
@@
export const DataExplorer = withStyles(styles)(
hideSearchInput,
paperKey,
fetchMode,
hideSearchInput,
paperKey,
fetchMode,
- currentItemUuid,
+ selectedResourceUuid,
+ currentRoute,
title,
progressBar,
doHidePanel,
title,
progressBar,
doHidePanel,
@@
-213,18
+237,18
@@
export const DataExplorer = withStyles(styles)(
wrap="nowrap"
className={classes.container}
>
wrap="nowrap"
className={classes.container}
>
- <div className={classes.titleWrapper}>
+ <div className={classes.titleWrapper}
style={currentRoute?.includes('search-results') || !!progressBar ? {marginBottom: '-20px'} : {}}
>
{title && (
<Grid
item
xs
{title && (
<Grid
item
xs
- className={classes.title}
+ className={
!!progressBar ? classes.subProcessTitle :
classes.title}
>
{title}
</Grid>
)}
{!!progressBar && progressBar}
>
{title}
</Grid>
)}
{!!progressBar && progressBar}
- {this.multiSelectToolbarInTitle &&
<MultiselectToolbar
/>}
+ {this.multiSelectToolbarInTitle &&
!this.state.msToolbarInDetailsCard && <MultiselectToolbar injectedStyles={classes.msToolbarStyles}
/>}
{(!hideColumnSelector || !hideSearchInput || !!actions) && (
<Grid
className={classes.headerMenu}
{(!hideColumnSelector || !hideSearchInput || !!actions) && (
<Grid
className={classes.headerMenu}
@@
-290,11
+314,12
@@
export const DataExplorer = withStyles(styles)(
</Grid>
)}
</div>
</Grid>
)}
</div>
- {!this.multiSelectToolbarInTitle && <MultiselectToolbar />}
+ {!this.multiSelectToolbarInTitle && <MultiselectToolbar
isSubPanel={true} injectedStyles={classes.subpanelToolbarStyles}
/>}
<Grid
item
xs="auto"
className={classes.dataTable}
<Grid
item
xs="auto"
className={classes.dataTable}
+ style={currentRoute?.includes('search-results') || !!progressBar ? {marginTop: '-10px'} : {}}
>
<DataTable
columns={this.props.contextMenuColumn ? [...columns, this.contextMenuColumn] : columns}
>
<DataTable
columns={this.props.contextMenuColumn ? [...columns, this.contextMenuColumn] : columns}
@@
-308,11
+333,13
@@
export const DataExplorer = withStyles(styles)(
working={this.state.showLoading}
defaultViewIcon={defaultViewIcon}
defaultViewMessages={defaultViewMessages}
working={this.state.showLoading}
defaultViewIcon={defaultViewIcon}
defaultViewMessages={defaultViewMessages}
- currentItemUuid={currentItemUuid}
currentRoute={paperKey}
toggleMSToolbar={toggleMSToolbar}
setCheckedListOnStore={setCheckedListOnStore}
checkedList={checkedList}
currentRoute={paperKey}
toggleMSToolbar={toggleMSToolbar}
setCheckedListOnStore={setCheckedListOnStore}
checkedList={checkedList}
+ selectedResourceUuid={selectedResourceUuid}
+ setSelectedUuid={this.props.setSelectedUuid}
+ currentRouteUuid={this.props.currentRouteUuid}
/>
</Grid>
<Grid
/>
</Grid>
<Grid
@@
-381,7
+408,10
@@
export const DataExplorer = withStyles(styles)(
>
<IconButton
className={this.props.classes.moreOptionsButton}
>
<IconButton
className={this.props.classes.moreOptionsButton}
- onClick={event => this.props.onContextMenu(event, item)}
+ onClick={event => {
+ event.stopPropagation()
+ this.props.onContextMenu(event, item)
+ }}
>
<MoreVerticalIcon />
</IconButton>
>
<MoreVerticalIcon />
</IconButton>