Merge branch '14248_assigning_properties_to_projects_during_create'
[arvados-workbench2.git] / src / views / workflow-panel / workflow-description-card.tsx
index c4db3fb912bc6b6f8b800b42c6ca8d0b22e30275..936c3485746b001b3fa4d3a52e8f493e209677e8 100644 (file)
@@ -14,8 +14,7 @@ import {
     TableHead,
     TableCell,
     TableBody,
-    TableRow,
-    Divider
+    TableRow
 } from '@material-ui/core';
 import { ArvadosTheme } from '~/common/custom-theme';
 import { WorkflowIcon } from '~/components/icon/icon';
@@ -23,7 +22,7 @@ import { DataTableDefaultView } from '~/components/data-table-default-view/data-
 import { WorkflowResource, parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from '~/models/workflow';
 import { WorkflowGraph } from "~/views/workflow-panel/workflow-graph";
 
-export type CssRules = 'root' | 'tab' | 'inputTab';
+export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'graphTabWithChosenWorkflow' | 'descriptionTab' | 'inputsTable';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
@@ -33,13 +32,26 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         minWidth: '33%'
     },
     inputTab: {
-        height: 'calc(100% - 48px - 16px * 2)',
-        overflowX: 'auto',
-        overflowY: 'hidden',
-        '&:last-child': {
-            paddingBottom: theme.spacing.unit / 2,
-        }
-    }
+        overflow: 'auto',
+        maxHeight: '300px',
+        marginTop: theme.spacing.unit
+    },
+    graphTab: {
+        marginTop: theme.spacing.unit,
+    },
+    graphTabWithChosenWorkflow: {
+        overflow: 'auto',
+        height: '450px',
+        marginTop: theme.spacing.unit,
+    },
+    descriptionTab: {
+        overflow: 'auto',
+        maxHeight: '300px',
+        marginTop: theme.spacing.unit,
+    },
+    inputsTable: {
+        tableLayout: 'fixed',
+    },
 });
 
 interface WorkflowDetailsCardDataProps {
@@ -60,6 +72,9 @@ export const WorkflowDetailsCard = withStyles(styles)(
 
         render() {
             const { classes, workflow } = this.props;
+            if (workflow) {
+                console.log(workflow.definition);
+            }
             const { value } = this.state;
             return <div className={classes.root}>
                 <Tabs value={value} onChange={this.handleChange} centered={true}>
@@ -67,7 +82,7 @@ export const WorkflowDetailsCard = withStyles(styles)(
                     <Tab className={classes.tab} label="Inputs" />
                     <Tab className={classes.tab} label="Graph" />
                 </Tabs>
-                {value === 0 && <CardContent>
+                {value === 0 && <CardContent className={classes.descriptionTab}>
                     {workflow ? <div>
                         {workflow.description}
                     </div> : (
@@ -84,9 +99,9 @@ export const WorkflowDetailsCard = withStyles(styles)(
                             messages={['Please select a workflow to see its inputs.']} />
                     }
                 </CardContent>}
-                {value === 2 && <CardContent className={classes.inputTab}>
+                {value === 2 && <CardContent className={workflow ? classes.graphTabWithChosenWorkflow : classes.graphTab}>
                     {workflow
-                        ? <WorkflowGraph workflow={workflow}/>
+                        ? <WorkflowGraph workflow={workflow} />
                         : <DataTableDefaultView
                             icon={WorkflowIcon}
                             messages={['Please select a workflow to see its visualisation.']} />
@@ -106,7 +121,7 @@ export const WorkflowDetailsCard = withStyles(styles)(
         }
 
         renderInputsTable() {
-            return <Table>
+            return <Table className={this.props.classes.inputsTable}>
                 <TableHead>
                     <TableRow>
                         <TableCell>Label</TableCell>