17782: Fixes assorted compile warnings.
[arvados-workbench2.git] / src / views / workflow-panel / workflow-description-card.tsx
index 02408b06bb7b6fcb03b76760ccfebbb6055f28eb..9c1d81c3ed21ecc712a154fb1abe44b779f9467f 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
+import React from 'react';
 import {
     StyleRulesCallback,
     WithStyles,
@@ -16,13 +16,13 @@ import {
     TableBody,
     TableRow
 } 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, getInputLabel, stringifyInputType } from '~/models/workflow';
-import { WorkflowGraph } from "~/views/workflow-panel/workflow-graph";
+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, getInputLabel, stringifyInputType } from 'models/workflow';
+import { WorkflowGraph } from "views/workflow-panel/workflow-graph";
 
-export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'descriptionTab' | 'inputsTable';
+export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'graphTabWithChosenWorkflow' | 'descriptionTab' | 'inputsTable';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
@@ -34,12 +34,12 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     inputTab: {
         overflow: 'auto',
         maxHeight: '300px',
-        marginTop: theme.spacing.unit,
-        '&:last-child': {
-            paddingBottom: theme.spacing.unit / 2,
-        }
+        marginTop: theme.spacing.unit
     },
     graphTab: {
+        marginTop: theme.spacing.unit,
+    },
+    graphTabWithChosenWorkflow: {
         overflow: 'auto',
         height: '450px',
         marginTop: theme.spacing.unit,
@@ -72,9 +72,6 @@ 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}>
@@ -99,7 +96,7 @@ export const WorkflowDetailsCard = withStyles(styles)(
                             messages={['Please select a workflow to see its inputs.']} />
                     }
                 </CardContent>}
-                {value === 2 && <CardContent className={classes.graphTab}>
+                {value === 2 && <CardContent className={workflow ? classes.graphTabWithChosenWorkflow : classes.graphTab}>
                     {workflow
                         ? <WorkflowGraph workflow={workflow} />
                         : <DataTableDefaultView
@@ -117,7 +114,7 @@ export const WorkflowDetailsCard = withStyles(styles)(
                     return getWorkflowInputs(definition);
                 }
             }
-            return;
+            return undefined;
         }
 
         renderInputsTable() {