X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1ca26fd87e061052b071e5039cc68c5a7434a8a5..1223a1b7def439123f2950a6f4627a170483e779:/src/views/process-panel/subprocesses-card.tsx diff --git a/src/views/process-panel/subprocesses-card.tsx b/src/views/process-panel/subprocesses-card.tsx index fe73aeadbe..9cff1e9816 100644 --- a/src/views/process-panel/subprocesses-card.tsx +++ b/src/views/process-panel/subprocesses-card.tsx @@ -4,114 +4,61 @@ import * as React from 'react'; import { ArvadosTheme } from '~/common/custom-theme'; -import { StyleRulesCallback, withStyles, WithStyles, Card, CardHeader, CardContent, Grid, Switch } from '@material-ui/core'; +import { StyleRulesCallback, withStyles, WithStyles, Card, CardHeader, CardContent, Grid, Typography } from '@material-ui/core'; +import { SubprocessFilter } from '~/components/subprocess-filter/subprocess-filter'; +import { SubprocessFilterDataProps } from '~/components/subprocess-filter/subprocess-filter'; -type CssRules = 'root' | 'label' | 'value' | 'switch' | 'grid'; +type CssRules = 'root' | 'title' | 'gridFilter'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { - fontSize: '0.875rem' + fontSize: '0.875rem', + height: '100%' }, - label: { - color: theme.palette.grey["500"], - marginBottom: theme.spacing.unit + title: { + color: theme.palette.grey["700"] }, - value: { - marginBottom: theme.spacing.unit - }, - switch: { - '& span:first-child': { - height: '18px' - } - }, - grid: { - marginLeft: '22px' + gridFilter: { + height: '20px', + marginBottom: theme.spacing.unit, + paddingTop: '0px!important', + paddingBottom: '0px!important', } }); -type SubprocessesProps = WithStyles; - -export const SubprocessesCard = withStyles(styles)( - class extends React.Component { - - state = { - queued: true, - active: true, - completed: true, - failed: true - }; +interface SubprocessesDataProps { + subprocessesAmount: number; + filters: SubprocessFilterDataProps[]; + onToggle: (status: string) => void; +} - handleChange = (name: string) => (event: any) => { - this.setState({ [name]: event.target.checked }); - } +type SubprocessesProps = SubprocessesDataProps & WithStyles; - render() { - const { classes } = this.props; - return ( - - - - - - - Subprocesses: - Queued: - Active: - - - - - 1 - - 2 - - - - 3 - - - - - - -   - Completed: - Failed: - - - - -   - - 2 - - - - 1 - - - - +export const SubprocessesCard = withStyles(styles)( + ({ classes, filters, subprocessesAmount, onToggle }: SubprocessesProps) => + + + Subprocess and filters + } /> + + + + + - - - ); - } - } + + { + filters.map(filter => + + onToggle(filter.label)} /> + + ) + } + + + + ); \ No newline at end of file