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<CssRules> = (theme: ArvadosTheme) => ({
-    card: {
-        height: '100%'
+    root: {
+        height: '100%',
+    },
+    tab: {
+        minWidth: '50%'
     }
 });
 
-interface WorkflowDescriptionCardDataProps {
+interface WorkflowDetailsCardDataProps {
+    workflow?: WorkflowResource;
 }
 
-type WorkflowDescriptionCardProps = WorkflowDescriptionCardDataProps & WithStyles<CssRules>;
-
-export const WorkflowDescriptionCard = withStyles(styles)(
-    ({ classes }: WorkflowDescriptionCardProps) => {
-        return <Card className={classes.card}>
-            <CardHeader
-                title={<Typography noWrap variant="body2">
-                    Workflow description:
-                </Typography>} />
-            <CardContent>
-                <DataTableDefaultView
-                    icon={WorkflowIcon}
-                    messages={['Please select a workflow to see its description.']} />
-            </CardContent>
-        </Card>;
+type WorkflowDetailsCardProps = WorkflowDetailsCardDataProps & WithStyles<CssRules>;
+
+export const WorkflowDetailsCard = withStyles(styles)(
+    class extends React.Component<WorkflowDetailsCardProps> {
+        state = {
+            value: 0,
+        };
+
+        handleChange = (event: React.MouseEvent<HTMLElement>, value: number) => {
+            this.setState({ value });
+        }
+
+        render() {
+            const { classes, workflow } = this.props;
+            const { value } = this.state;
+            return <div className={classes.root}>
+                <Tabs value={value} onChange={this.handleChange} centered={true}>
+                    <Tab className={classes.tab} label="Description" />
+                    <Tab className={classes.tab} label="Inputs" />
+                </Tabs>
+                {value === 0 && <CardContent>
+                    {workflow ? (
+                        workflow.description
+                    ) : (
+                        <DataTableDefaultView
+                            icon={WorkflowIcon}
+                            messages={['Please select a workflow to see its description.']} />
+                    )}
+                </CardContent>}
+                {value === 1 && <CardContent>
+                    {workflow ? (
+                        workflow.name
+                    ) : (
+                        <DataTableDefaultView
+                            icon={WorkflowIcon}
+                            messages={['Please select a workflow to see its inputs.']} />
+                    )}
+                </CardContent>}
+            </div>;
+        }
     });
\ No newline at end of file
