1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
7 StyleRulesCallback, WithStyles, withStyles, Card,
8 CardHeader, IconButton, CardContent, Grid, Chip, Typography, Tooltip
9 } from '@material-ui/core';
10 import { ArvadosTheme } from '~/common/custom-theme';
11 import { MoreOptionsIcon, ProcessIcon } from '~/components/icon/icon';
12 import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
14 type CssRules = 'card' | 'iconHeader' | 'label' | 'value' | 'chip' | 'headerText' | 'link' | 'content' | 'title' | 'avatar';
16 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
18 marginBottom: theme.spacing.unit * 2
22 color: theme.customs.colors.green700,
25 alignSelf: 'flex-start'
29 justifyContent: 'flex-end',
31 marginRight: theme.spacing.unit * 3,
32 paddingRight: theme.spacing.unit
35 textTransform: 'none',
40 color: theme.palette.primary.main,
46 height: theme.spacing.unit * 3,
47 width: theme.spacing.unit * 12,
48 backgroundColor: theme.customs.colors.green700,
49 color: theme.palette.common.white,
51 borderRadius: theme.spacing.unit * 0.625,
55 marginLeft: theme.spacing.unit * 3,
59 paddingBottom: theme.spacing.unit * 2,
68 export interface ProcessInformationCardDataProps {
70 onContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
73 type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles<CssRules>;
75 export const ProcessInformationCard = withStyles(styles)(
76 ({ classes, onContextMenu }: ProcessInformationCardProps) =>
77 <Card className={classes.card}>
80 content: classes.title,
81 avatar: classes.avatar
83 avatar={<ProcessIcon className={classes.iconHeader} />}
86 <Chip label="Complete" className={classes.chip} />
88 aria-label="More options"
89 onClick={event => onContextMenu(event)}>
95 <Tooltip title="Pipeline template that generates a config file from a template">
96 <Typography noWrap variant="title">
97 Pipeline template that generates a config file from a template
101 subheader="(no-description)" />
102 <CardContent className={classes.content}>
105 <DetailsAttribute classLabel={classes.label} classValue={classes.value}
106 label='From' value="1:25 PM 3/23/2018" />
107 <DetailsAttribute classLabel={classes.label} classValue={classes.value}
108 label='To' value='1:25 PM 3/23/2018' />
109 <DetailsAttribute classLabel={classes.label} classValue={classes.link}
110 label='Workflow' value='FastQC MultiQC' />
113 <DetailsAttribute classLabel={classes.link} label='Outputs' />
114 <DetailsAttribute classLabel={classes.link} label='Inputs' />