[ARVADOS-WORKBENCH2] updated: 1.4.1-295-gfb1f060e

Git user git at public.arvados.org
Sat Feb 29 10:53:25 UTC 2020


Summary of changes:
 .../process-panel/process-information-card.tsx     | 208 ++++++++++-----------
 1 file changed, 102 insertions(+), 106 deletions(-)

       via  fb1f060e6145c1fc4e5c6b6978b90b9769b47b16 (commit)
       via  2a1d9671c58eb9ce530c45e18635d65e2462046d (commit)
      from  c2ce397fa6b468ae42d54da37d0fc92374bf93da (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit fb1f060e6145c1fc4e5c6b6978b90b9769b47b16
Merge: 2a1d9671 c2ce397f
Author: PiotrAleksander <piotrhugonow at gmail.com>
Date:   Sat Feb 29 11:53:10 2020 +0100

    reverted process information card back to functional component, kept containerRequest.properties


commit 2a1d9671c58eb9ce530c45e18635d65e2462046d
Author: PiotrAleksander <piotrhugonow at gmail.com>
Date:   Sat Feb 29 11:51:18 2020 +0100

    reverted process information card back to functional component, kept containerRequest.properties

diff --git a/src/views/process-panel/process-information-card.tsx b/src/views/process-panel/process-information-card.tsx
index fc26a748..bb35abd9 100644
--- a/src/views/process-panel/process-information-card.tsx
+++ b/src/views/process-panel/process-information-card.tsx
@@ -15,9 +15,11 @@ import { getProcessStatus, getProcessStatusColor } from '~/store/processes/proce
 import { formatDate } from '~/common/formatters';
 import * as classNames from 'classnames';
 import { ContainerState } from '~/models/container';
-import { connect, DispatchProp } from 'react-redux';
+import { connect } from 'react-redux';
 import { deleteCollectionTag } from '~/store/collection-panel/collection-panel-action';
 import { getPropertyChip } from '~/views-components/resource-properties-form/property-chip';
+import { Dispatch } from 'redux';
+import { ContainerRequestResource } from '~/models/container-request';
 
 type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'chip' | 'link' | 'content' | 'title' | 'avatar' | 'cancelButton' | 'tag';
 
@@ -88,115 +90,109 @@ export interface ProcessInformationCardDataProps {
     navigateToOutput: (uuid: string) => void;
     openWorkflow: (uuid: string) => void;
     cancelProcess: (uuid: string) => void;
+    handleDelete: (key: string, value: string) => void;
 }
 
-type ProcessInformationCardProps = ProcessInformationCardDataProps & DispatchProp & WithStyles<CssRules, true>;
-
-export const ProcessInformationCard = withStyles(styles)(
-    connect()(
-        class extends React.Component<ProcessInformationCardProps> {
-
-            render() {
-                const { classes, process, onContextMenu, theme, openProcessInputDialog, navigateToOutput, openWorkflow, cancelProcess } = this.props;
-                const { container, containerRequest } = process;
-                const startedAt = container ? formatDate(container.startedAt) : 'N/A';
-                const finishedAt = container ? formatDate(container.finishedAt) : 'N/A';
+const mapDispatchToProps = (dispatch: Dispatch) => ({
+    handleDelete: (key: string, value: string) => dispatch<any>(deleteCollectionTag(key, value))
+});
 
-                return <>
-                    <Card className={classes.card}>
-                        <CardHeader
-                            classes={{
-                                content: classes.title,
-                                avatar: classes.avatar
-                            }}
-                            avatar={<ProcessIcon className={classes.iconHeader} />}
-                            action={
-                                <div>
-                                    {process.container && process.container.state === ContainerState.RUNNING &&
-                                        <span className={classes.cancelButton} onClick={() => cancelProcess(process.containerRequest.uuid)}>Cancel</span>}
-                                    <Chip label={getProcessStatus(process)}
-                                        className={classes.chip}
-                                        style={{ backgroundColor: getProcessStatusColor(getProcessStatus(process), theme as ArvadosTheme) }} />
-                                    <Tooltip title="More options" disableFocusListener>
-                                        <IconButton
-                                            aria-label="More options"
-                                            onClick={event => onContextMenu(event)}>
-                                            <MoreOptionsIcon />
-                                        </IconButton>
-                                    </Tooltip>
-                                </div>
-                            }
-                            title={
-                                <Tooltip title={process.containerRequest.name} placement="bottom-start">
-                                    <Typography noWrap variant='h6' color='inherit'>
-                                        {process.containerRequest.name}
-                                    </Typography>
-                                </Tooltip>
-                            }
-                            subheader={
-                                <Tooltip title={this.getDescription(process)} placement="bottom-start">
-                                    <Typography noWrap variant='body1' color='inherit'>
-                                        {this.getDescription(process)}
-                                    </Typography>
-                                </Tooltip>} />
-                        <CardContent className={classes.content}>
-                            <Grid container>
-                                <Grid item xs={6}>
-                                    <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                                        label='From'
-                                        value={startedAt} />
-                                    <DetailsAttribute classLabel={classes.label} classValue={classes.value}
-                                        label='To'
-                                        value={finishedAt} />
-                                    {process.containerRequest.properties.workflowUuid &&
-                                        <span onClick={() => openWorkflow(process.containerRequest.properties.workflowUuid)}>
-                                            <DetailsAttribute classLabel={classes.label} classValue={classNames(classes.value, classes.link)}
-                                                label='Workflow' value={process.containerRequest.properties.workflowName} />
-                                        </span>}
-                                </Grid>
-                                <Grid item xs={6}>
-                                    <span onClick={() => navigateToOutput(process.containerRequest.outputUuid!)}>
-                                        <DetailsAttribute classLabel={classes.link} label='Outputs' />
-                                    </span>
-                                    <span onClick={() => openProcessInputDialog(process.containerRequest.uuid)}>
-                                        <DetailsAttribute classLabel={classes.link} label='Inputs' />
-                                    </span>
-                                </Grid>
-                            </Grid>
-                        </CardContent>
-                    </Card>
+type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles<CssRules, true>;
 
-                    <Card className={classes.card}>
-                        <CardHeader title="Properties" />
-                        <CardContent>
-                            <Grid container direction="column">
-                                <Grid item xs={12}>
-                                    {Object.keys(containerRequest.properties).map(k =>
-                                        Array.isArray(containerRequest.properties[k])
-                                            ? containerRequest.properties[k].map((v: string) =>
-                                                getPropertyChip(
-                                                    k, v,
-                                                    this.handleDelete(k, v),
-                                                    classes.tag))
-                                            : getPropertyChip(
-                                                k, containerRequest.properties[k],
-                                                this.handleDelete(k, containerRequest.properties[k]),
-                                                classes.tag)
-                                    )}
-                                </Grid>
-                            </Grid>
-                        </CardContent>
-                    </Card>
-                </>;
-            }
+export const ProcessInformationCard = connect(undefined, mapDispatchToProps)(withStyles(styles, { withTheme: true })(
+    ({ classes, process, onContextMenu, theme, openProcessInputDialog, navigateToOutput, openWorkflow, cancelProcess, handleDelete }: ProcessInformationCardProps) => {
+        const { container, containerRequest } = process;
+        const startedAt = container ? formatDate(container.startedAt) : 'N/A';
+        const finishedAt = container ? formatDate(container.finishedAt) : 'N/A';
 
-            handleDelete = (key: string, value: string) => () => {
-                this.props.dispatch<any>(deleteCollectionTag(key, value));
-            }
+        return <>
+            <Card className={classes.card}>
+                <CardHeader
+                    classes={{
+                        content: classes.title,
+                        avatar: classes.avatar
+                    }}
+                    avatar={<ProcessIcon className={classes.iconHeader} />}
+                    action={
+                        <div>
+                            {process.container && process.container.state === ContainerState.RUNNING &&
+                                <span className={classes.cancelButton} onClick={() => cancelProcess(containerRequest.uuid)}>Cancel</span>}
+                            <Chip label={getProcessStatus(process)}
+                                className={classes.chip}
+                                style={{ backgroundColor: getProcessStatusColor(getProcessStatus(process), theme as ArvadosTheme) }} />
+                            <Tooltip title="More options" disableFocusListener>
+                                <IconButton
+                                    aria-label="More options"
+                                    onClick={event => onContextMenu(event)}>
+                                    <MoreOptionsIcon />
+                                </IconButton>
+                            </Tooltip>
+                        </div>
+                    }
+                    title={
+                        <Tooltip title={containerRequest.name} placement="bottom-start">
+                            <Typography noWrap variant='h6' color='inherit'>
+                                {containerRequest.name}
+                            </Typography>
+                        </Tooltip>
+                    }
+                    subheader={
+                        <Tooltip title={getDescription(containerRequest)} placement="bottom-start">
+                            <Typography noWrap variant='body1' color='inherit'>
+                                {getDescription(containerRequest)}
+                            </Typography>
+                        </Tooltip>} />
+                <CardContent className={classes.content}>
+                    <Grid container>
+                        <Grid item xs={6}>
+                            <DetailsAttribute classLabel={classes.label} classValue={classes.value}
+                                label='From'
+                                value={startedAt} />
+                            <DetailsAttribute classLabel={classes.label} classValue={classes.value}
+                                label='To'
+                                value={finishedAt} />
+                            {containerRequest.properties.workflowUuid &&
+                                <span onClick={() => openWorkflow(containerRequest.properties.workflowUuid)}>
+                                    <DetailsAttribute classLabel={classes.label} classValue={classNames(classes.value, classes.link)}
+                                        label='Workflow' value={containerRequest.properties.workflowName} />
+                                </span>}
+                        </Grid>
+                        <Grid item xs={6}>
+                            <span onClick={() => navigateToOutput(containerRequest.outputUuid!)}>
+                                <DetailsAttribute classLabel={classes.link} label='Outputs' />
+                            </span>
+                            <span onClick={() => openProcessInputDialog(containerRequest.uuid)}>
+                                <DetailsAttribute classLabel={classes.link} label='Inputs' />
+                            </span>
+                        </Grid>
+                    </Grid>
+                </CardContent>
+            </Card>
 
-            getDescription = (process: Process) =>
-                process.containerRequest.description || '(no-description)'
+            <Card className={classes.card}>
+                <CardHeader title="Properties" />
+                <CardContent>
+                    <Grid container direction="column">
+                        <Grid item xs={12}>
+                            {Object.keys(containerRequest.properties).map(k =>
+                                Array.isArray(containerRequest.properties[k])
+                                    ? containerRequest.properties[k].map((v: string) =>
+                                        getPropertyChip(
+                                            k, v,
+                                            handleDelete(k, v),
+                                            classes.tag))
+                                    : getPropertyChip(
+                                        k, containerRequest.properties[k],
+                                        handleDelete(k, containerRequest.properties[k]),
+                                        classes.tag)
+                            )}
+                        </Grid>
+                    </Grid>
+                </CardContent>
+            </Card>
+        </>;
+    }
+));
 
-        }
-    )
-);
\ No newline at end of file
+const getDescription = (containerRequest: ContainerRequestResource) =>
+    containerRequest.description || '(no-description)';
\ No newline at end of file

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list