// SPDX-License-Identifier: AGPL-3.0
import React, { ReactElement, useState } from 'react';
+import { Dispatch } from 'redux';
import {
StyleRulesCallback,
WithStyles,
import { RootState } from 'store/store';
import { ProcessOutputCollectionFiles } from './process-output-collection-files';
import { Process } from 'store/processes/process';
+import { navigateTo } from 'store/navigation/navigation-action';
-type CssRules = 'card' | 'content' | 'title' | 'header' | 'avatar' | 'iconHeader' | 'tableWrapper' | 'tableRoot' | 'paramValue' | 'keepLink' | 'imagePreview' | 'valArray' | 'emptyValue' | 'halfRow' | 'symmetricTabs' | 'imagePlaceholder' | 'rowWithPreview';
+type CssRules = 'card' | 'content' | 'title' | 'header' | 'avatar' | 'iconHeader' | 'tableWrapper' | 'tableRoot' | 'paramValue' | 'keepLink' | 'collectionLink' | 'imagePreview' | 'valArray' | 'emptyValue' | 'halfRow' | 'symmetricTabs' | 'imagePlaceholder' | 'rowWithPreview';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
card: {
overflowWrap: 'break-word',
cursor: 'pointer',
},
+ collectionLink: {
+ margin: '10px',
+ '& a': {
+ color: theme.palette.primary.main,
+ textDecoration: 'none',
+ overflowWrap: 'break-word',
+ cursor: 'pointer',
+ }
+ },
imagePreview: {
maxHeight: '15em',
maxWidth: '15em',
outputUuid?: string;
}
-type ProcessIOCardProps = ProcessIOCardDataProps & WithStyles<CssRules> & MPVPanelProps;
+export interface ProcessIOCardActionProps {
+ navigateTo: (uuid: string) => void;
+}
-export const ProcessIOCard = withStyles(styles)(
- ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, panelName, process }: ProcessIOCardProps) => {
+const mapDispatchToProps = (dispatch: Dispatch): ProcessIOCardActionProps => ({
+ navigateTo: (uuid) => dispatch<any>(navigateTo(uuid)),
+});
+
+type ProcessIOCardProps = ProcessIOCardDataProps & ProcessIOCardActionProps & WithStyles<CssRules> & MPVPanelProps;
+
+export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps)(
+ ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, panelName, process, navigateTo }: ProcessIOCardProps) => {
const [mainProcTabState, setMainProcTabState] = useState(0);
const handleMainProcTabChange = (event: React.MouseEvent<HTMLElement>, value: number) => {
setMainProcTabState(value);
</Tabs>
<div className={classes.tableWrapper}>
{label === ProcessIOCardType.INPUT && <ProcessInputMounts mounts={mounts || []} />}
- {label === ProcessIOCardType.OUTPUT && <ProcessOutputCollectionFiles isWritable={false} currentItemUuid={outputUuid} />}
+ {label === ProcessIOCardType.OUTPUT && <>
+ {outputUuid && <Typography className={classes.collectionLink}>
+ Output Collection: <MuiLink className={classes.keepLink} onClick={() => {navigateTo(outputUuid)}}>
+ {outputUuid}
+ </MuiLink></Typography>}
+ <ProcessOutputCollectionFiles isWritable={false} currentItemUuid={outputUuid} />
+ </>}
</div>
</>)
}
</CardContent>
</Card>;
}
-);
+));
export type ProcessIOValue = {
display: ReactElement<any, any>;