X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9ea087b587f8139416cea16fbe4caad0d6df90c4..c2090176529ea4008a94c6bfc0a1c633a369e605:/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..72af6bc2f5 100644 --- a/src/views/workflow-panel/workflow-description-card.tsx +++ b/src/views/workflow-panel/workflow-description-card.tsx @@ -3,35 +3,65 @@ // 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 } from '~/models/workflow'; -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 ? ( + workflow.name + ) : ( + + )} + } +
; + } }); \ No newline at end of file