summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5e87aa7)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>
checkedList: TCheckedList;
isNotFound: boolean;
searchBarValue: string;
checkedList: TCheckedList;
isNotFound: boolean;
searchBarValue: string;
+ paperClassName?: string;
}
interface DataExplorerActionProps<T> {
}
interface DataExplorerActionProps<T> {
setCheckedListOnStore,
checkedList,
working,
setCheckedListOnStore,
checkedList,
working,
} = this.props;
return (
<Paper
} = this.props;
return (
<Paper
- className={classes.root}
+ className={classNames(classes.root, paperClassName)}
{...paperProps}
key={paperKey}
data-cy={this.props["data-cy"]}
{...paperProps}
key={paperKey}
data-cy={this.props["data-cy"]}
import { ReactNodeArray } from 'prop-types';
import classNames from 'classnames';
import { ReactNodeArray } from 'prop-types';
import classNames from 'classnames';
-type CssRules = 'root' | 'button' | 'buttonIcon' | 'content' | 'tabsWrapper' | 'tabsRoot' | 'tabs';
+type CssRules =
+ | 'gridContainerRoot'
+ | 'exclusiveGridContainerRoot'
+ | 'gridItemRoot'
+ | 'paperRoot'
+ | 'button'
+ | 'buttonIcon'
+ | 'content'
+ | 'exclusiveContentPaper'
+ | 'tabs';
const styles: StyleRulesCallback<CssRules> = theme => ({
const styles: StyleRulesCallback<CssRules> = theme => ({
+ exclusiveGridContainerRoot: {
+ marginTop: 0,
+ },
+ gridItemRoot: {
+ paddingTop: '0 !important',
+ },
+ paperRoot: {
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ },
button: {
padding: '2px 5px',
marginRight: '5px',
button: {
padding: '2px 5px',
marginRight: '5px',
overflow: 'auto',
maxWidth: 'initial',
},
overflow: 'auto',
maxWidth: 'initial',
},
- tabsWrapper: {
- width: '100%',
- },
- tabsRoot: {
- flexGrow: 1,
+ exclusiveContentPaper: {
+ boxShadow: 'none',
illuminated: boolean;
children: ReactNode;
panelRef?: MutableRefObject<any>;
illuminated: boolean;
children: ReactNode;
panelRef?: MutableRefObject<any>;
+ paperClassName?: string;
}
interface MPVHideablePanelActionProps {
}
interface MPVHideablePanelActionProps {
type MPVHideablePanelProps = MPVHideablePanelDataProps & MPVHideablePanelActionProps;
type MPVHideablePanelProps = MPVHideablePanelDataProps & MPVHideablePanelActionProps;
-const MPVHideablePanel = ({ doHidePanel, doMaximizePanel, doUnMaximizePanel, name, visible, maximized, illuminated, ...props }: MPVHideablePanelProps) =>
+const MPVHideablePanel = ({ doHidePanel, doMaximizePanel, doUnMaximizePanel, name, visible, maximized, illuminated, paperClassName, ...props }: MPVHideablePanelProps) =>
- {React.cloneElement((props.children as ReactElement), { doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName: name, panelMaximized: maximized, panelIlluminated: illuminated, panelRef: props.panelRef })}
+ {React.cloneElement((props.children as ReactElement), {
+ doHidePanel,
+ doMaximizePanel,
+ doUnMaximizePanel,
+ panelName: name,
+ panelMaximized: maximized,
+ panelIlluminated: illuminated,
+ panelRef: props.panelRef,
+ paperClassName,
+ })}
forwardProps?: boolean;
maxHeight?: string;
minHeight?: string;
forwardProps?: boolean;
maxHeight?: string;
minHeight?: string;
+ paperClassName?: string;
}
interface MPVPanelActionProps {
}
interface MPVPanelActionProps {
// Grid item compatible component for layout and MPV props passing
export const MPVPanelContent = ({ doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName,
// Grid item compatible component for layout and MPV props passing
export const MPVPanelContent = ({ doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName,
- panelMaximized, panelIlluminated, panelRef, forwardProps, maxHeight, minHeight,
+ panelMaximized, panelIlluminated, panelRef, forwardProps, maxHeight, minHeight, paperClassName,
...props }: MPVPanelContentProps) => {
useEffect(() => {
if (panelRef && panelRef.current) {
...props }: MPVPanelContentProps) => {
useEffect(() => {
if (panelRef && panelRef.current) {
<span ref={panelRef} /> {/* Element to scroll to when the panel is selected */}
<Paper style={{ height: '100%' }} elevation={panelIlluminated ? 8 : 0}>
{forwardProps
<span ref={panelRef} /> {/* Element to scroll to when the panel is selected */}
<Paper style={{ height: '100%' }} elevation={panelIlluminated ? 8 : 0}>
{forwardProps
- ? React.cloneElement(props.children, { doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName, panelMaximized })
- : props.children}
+ ? React.cloneElement(props.children, { doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName, panelMaximized, paperClassName })
+ : React.cloneElement(props.children, { paperClassName })}
- <MPVHideablePanel key={idx} visible={panelVisibility[idx]} name={panelName}
+ <MPVHideablePanel
+ key={idx}
+ visible={panelVisibility[idx]}
+ name={panelName}
+ paperClassName={props.mutuallyExclusive ? classes.exclusiveContentPaper : undefined}
panelRef={(idx === selectedPanel) ? panelRef : undefined}
maximized={panelIsMaximized} illuminated={idx === highlightedPanel}
doHidePanel={hideFn(idx)} doMaximizePanel={maximizeFn(idx)} doUnMaximizePanel={panelIsMaximized ? unMaximizeFn(idx) : () => null}>
panelRef={(idx === selectedPanel) ? panelRef : undefined}
maximized={panelIsMaximized} illuminated={idx === highlightedPanel}
doHidePanel={hideFn(idx)} doMaximizePanel={maximizeFn(idx)} doUnMaximizePanel={panelIsMaximized ? unMaximizeFn(idx) : () => null}>
};
buttonBar = props.mutuallyExclusive ?
};
buttonBar = props.mutuallyExclusive ?
- <Paper className={classes.tabsWrapper}>
- <Tabs className={classes.tabsRoot} value={currentSelectedPanel} onChange={(e, val) => showFn(val)()}>
- {tabs.map((tgl, idx) => <Tab className={classes.tabs} key={idx} label={tgl} />)}
- </Tabs>
- </Paper> :
- <>
+ <Tabs value={currentSelectedPanel} onChange={(e, val) => showFn(val)()}>
+ {tabs.map((tgl, idx) => <Tab className={classes.tabs} key={idx} label={tgl} />)}
+ </Tabs> :
+ <Grid container item direction="row">
{buttons.map((tgl, idx) => <Grid item key={idx}>{tgl}</Grid>)}
{buttons.map((tgl, idx) => <Grid item key={idx}>{tgl}</Grid>)}
- return <Grid container {...props} className={classNames(classes.root, props.className)}>
- <Grid container item direction="row">
- {buttonBar}
- </Grid>
- <Grid container item {...props} xs className={classes.content}
- onScroll={() => setSelectedPanel(-1)}>
- {panelVisibility.includes(true)
- ? panels
- : <Grid container item alignItems='center' justify='center'>
- <DefaultView messages={["All panels are hidden.", "Click on the buttons above to show them."]} icon={InfoIcon} />
- </Grid>}
- </Grid>
+ const content = <Grid container item {...props} xs className={classes.content}
+ onScroll={() => setSelectedPanel(-1)}>
+ {panelVisibility.includes(true)
+ ? panels
+ : <Grid container item alignItems='center' justify='center'>
+ <DefaultView messages={["All panels are hidden.", "Click on the buttons above to show them."]} icon={InfoIcon} />
+ </Grid>}
+
+ if (props.mutuallyExclusive) {
+ return <Grid container {...props} className={classNames(classes.exclusiveGridContainerRoot, props.className)}>
+ <Grid item {...props} className={classes.gridItemRoot}>
+ <Paper className={classes.paperRoot}>
+ {buttonBar}
+ {content}
+ </Paper>
+ </Grid>
+ </Grid>;
+ } else {
+ return <Grid container {...props} className={classNames(classes.gridContainerRoot, props.className)}>
+ {buttonBar}
+ {content}
+ </Grid>;
+ }
};
export const MPVContainer = withStyles(styles)(MPVContainerComponent);
};
export const MPVContainer = withStyles(styles)(MPVContainerComponent);
setSelectedUuid: (uuid: string | null) => {
dispatch<any>(setSelectedResourceUuid(uuid));
},
setSelectedUuid: (uuid: string | null) => {
dispatch<any>(setSelectedResourceUuid(uuid));
},
onRowClick,
onRowDoubleClick,
onRowClick,
onRowDoubleClick,
const DEFAULT_VIEW_MESSAGES = ['No data found'];
const DEFAULT_VIEW_MESSAGES = ['No data found'];
-export const ProjectPanelData = class extends React.Component {
+interface ProjectPanelDataProps {
+ paperClassName?: string;
+};
+
+export const ProjectPanelData = class extends React.Component<ProjectPanelDataProps> {
handleRowClick = () => {};
handleRowDoubleClick = () => {};
handleContextMenu = () => {};
handleRowClick = () => {};
handleRowDoubleClick = () => {};
handleContextMenu = () => {};
contextMenuColumn={true}
defaultViewIcon={ProjectIcon}
defaultViewMessages={DEFAULT_VIEW_MESSAGES}
contextMenuColumn={true}
defaultViewIcon={ProjectIcon}
defaultViewMessages={DEFAULT_VIEW_MESSAGES}
+ paperClassName={this.props.paperClassName}
interface ProjectPanelRunProps {
project?: ProjectResource;
interface ProjectPanelRunProps {
project?: ProjectResource;
+ paperClassName?: string;
}
const mapStateToProps = (state: RootState): ProjectPanelRunProps => {
}
const mapStateToProps = (state: RootState): ProjectPanelRunProps => {
defaultViewIcon={ProjectIcon}
defaultViewMessages={DEFAULT_VIEW_MESSAGES}
progressBar={<SubprocessProgressBar parentResource={props.project} dataExplorerId={PROJECT_PANEL_RUN_ID} />}
defaultViewIcon={ProjectIcon}
defaultViewMessages={DEFAULT_VIEW_MESSAGES}
progressBar={<SubprocessProgressBar parentResource={props.project} dataExplorerId={PROJECT_PANEL_RUN_ID} />}
+ paperClassName={props.paperClassName}
},
mpvRoot: {
flexGrow: 1,
},
mpvRoot: {
flexGrow: 1,
+ display: 'flex',
+ flexDirection: 'column',
+ '& > div': {
+ height: '100%',
+ },
},
dataExplorer: {
height: "100%",
},
dataExplorer: {
height: "100%",
<MPVPanelContent
forwardProps
xs="auto"
<MPVPanelContent
forwardProps
xs="auto"
- data-cy="process-details"
className={classes.dataExplorer}>
<ProjectPanelData />
</MPVPanelContent>
<MPVPanelContent
forwardProps
xs="auto"
className={classes.dataExplorer}>
<ProjectPanelData />
</MPVPanelContent>
<MPVPanelContent
forwardProps
xs="auto"
- data-cy="process-details"
className={classes.dataExplorer}>
<ProjectPanelRun />
</MPVPanelContent>
className={classes.dataExplorer}>
<ProjectPanelRun />
</MPVPanelContent>