[ARVADOS-WORKBENCH2] created: 1.2.0-828-gf27157a

Git user git at public.curoverse.com
Thu Nov 8 16:37:08 EST 2018


        at  f27157a0cd7178ee83e69bc2778c1730aed14335 (commit)


commit f27157a0cd7178ee83e69bc2778c1730aed14335
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Thu Nov 8 22:37:01 2018 +0100

    Fix graph content not being refreshed on workflow change, adjust graph's tab height
    
    Bug #14463
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx
index b4b9f20..02408b0 100644
--- a/src/views/workflow-panel/workflow-description-card.tsx
+++ b/src/views/workflow-panel/workflow-description-card.tsx
@@ -22,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' | 'descriptionTab' | 'inputsTable';
+export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'descriptionTab' | 'inputsTable';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
@@ -39,6 +39,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
             paddingBottom: theme.spacing.unit / 2,
         }
     },
+    graphTab: {
+        overflow: 'auto',
+        height: '450px',
+        marginTop: theme.spacing.unit,
+    },
     descriptionTab: {
         overflow: 'auto',
         maxHeight: '300px',
@@ -67,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}>
@@ -91,7 +99,7 @@ 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={classes.graphTab}>
                     {workflow
                         ? <WorkflowGraph workflow={workflow} />
                         : <DataTableDefaultView
diff --git a/src/views/workflow-panel/workflow-graph.tsx b/src/views/workflow-panel/workflow-graph.tsx
index de29032..a2faf32 100644
--- a/src/views/workflow-panel/workflow-graph.tsx
+++ b/src/views/workflow-panel/workflow-graph.tsx
@@ -20,7 +20,7 @@ interface WorkflowGraphProps {
 export class WorkflowGraph extends React.Component<WorkflowGraphProps, {}> {
     private svgRoot: React.RefObject<SVGSVGElement> = React.createRef();
 
-    componentDidMount(): void {
+    setGraph() {
         const graphs = yaml.safeLoad(this.props.workflow.definition, { json: true });
 
         let workflowGraph = graphs;
@@ -37,7 +37,7 @@ export class WorkflowGraph extends React.Component<WorkflowGraphProps, {}> {
                 new SVGArrangePlugin(),
                 new SVGEdgeHoverPlugin(),
                 new SVGNodeMovePlugin({
-                    movementSpeed: 10
+                    movementSpeed: 2
                 }),
                 new SVGPortDragPlugin(),
                 new SelectionPlugin(),
@@ -47,6 +47,14 @@ export class WorkflowGraph extends React.Component<WorkflowGraphProps, {}> {
         workflow.draw();
     }
 
+    componentDidMount() {
+        this.setGraph();
+    }
+
+    componentDidUpdate() {
+        this.setGraph();
+    }
+
     render() {
         return <svg
             ref={this.svgRoot}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list