X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/de519d0b84931f8ef5fb7d2aecdb67a911c3eabf..77f285190a3ae77a1075b249ca964b1afeed7ca2:/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 1fd5817c..9cff1e98 100644 --- a/src/views/process-panel/subprocesses-card.tsx +++ b/src/views/process-panel/subprocesses-card.tsx @@ -4,117 +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' | 'middleValue' | '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 - }, - middleValue: { - marginBottom: theme.spacing.unit - 2 - }, - 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; +interface SubprocessesDataProps { + subprocessesAmount: number; + filters: SubprocessFilterDataProps[]; + onToggle: (status: string) => void; +} -export const SubprocessesCard = withStyles(styles)( - class extends React.Component { +type SubprocessesProps = SubprocessesDataProps & WithStyles; - state = { - queued: true, - active: true, - completed: true, - failed: true - }; - - handleChange = (name: string) => (event: any) => { - this.setState({ [name]: event.target.checked }); - } - - 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