X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6acebd8c63b066f86aa81fce3b8937609778031f..428d454e2681d66bb14558946cfe2fb77a2c8dce:/src/views/workflow-panel/workflow-description-card.tsx diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx index e2b0f295e8..c297276e7b 100644 --- a/src/views/workflow-panel/workflow-description-card.tsx +++ b/src/views/workflow-panel/workflow-description-card.tsx @@ -3,35 +3,73 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { StyleRulesCallback, WithStyles, withStyles, Card, CardHeader, Typography, CardContent } from '@material-ui/core'; +import { StyleRulesCallback, WithStyles, withStyles, CardContent, Tab, Tabs, Paper } from '@material-ui/core'; import { ArvadosTheme } from '~/common/custom-theme'; import { WorkflowIcon } from '~/components/icon/icon'; import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view'; +import { WorkflowResource, parseWorkflowDefinition, getWorkflowInputs } from '~/models/workflow'; +import { WorkflowInput } from '~/components/workflow-inputs-form/workflow-input'; +import { RunProcessInputsForm } from '../run-process-panel/run-process-inputs-form'; -export type CssRules = 'card'; +export type CssRules = 'root' | 'tab'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ - card: { - height: '100%' + root: { + height: '100%', + }, + tab: { + minWidth: '50%' } }); -interface WorkflowDescriptionCardDataProps { +interface WorkflowDetailsCardDataProps { + workflow?: WorkflowResource; } -type WorkflowDescriptionCardProps = WorkflowDescriptionCardDataProps & WithStyles; - -export const WorkflowDescriptionCard = withStyles(styles)( - ({ classes }: WorkflowDescriptionCardProps) => { - return - - Workflow description: - } /> - - - - ; +type WorkflowDetailsCardProps = WorkflowDetailsCardDataProps & WithStyles; + +export const WorkflowDetailsCard = withStyles(styles)( + class extends React.Component { + state = { + value: 0, + }; + + handleChange = (event: React.MouseEvent, value: number) => { + this.setState({ value }); + } + + render() { + const { classes, workflow } = this.props; + const { value } = this.state; + return + + + + + {value === 0 && + {workflow + ? workflow.description + : } + } + {value === 1 && + {workflow && this.inputs + ? + : } + } + ; + } + + get inputs() { + if (this.props.workflow) { + const definition = parseWorkflowDefinition(this.props.workflow); + if (definition) { + return getWorkflowInputs(definition); + } + } + return; + } }); \ No newline at end of file