Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit ceb17a0

Browse files
committed
fix non-capitalization of Mask in wskflow
Fixes #910
1 parent e0ea575 commit ceb17a0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/plugins/modules/wskflow/lib/fsm2graph.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,10 @@ function ir2graph(ir, gm, id, prevId, options={}){ // ir and graph model
488488
}
489489
else if(typeof ir.body === 'object'){
490490
// generic handler for any subgraph-via-body node
491-
const body = drawNodeNew(id, ir.type, ir.type, undefined, options)
491+
const label = capitalize(ir.type),
492+
type = ir.type,
493+
body = drawNodeNew(id, label, type, undefined, options)
494+
492495
body.children = []
493496
body.edges = []
494497
gm.children.push(body);
@@ -670,6 +673,10 @@ const isSimpleComposition = ir => {
670673
return isShort && atMostOneNonFunction
671674
}
672675

676+
/**
677+
* @return the cumulative number of nodes in the given composition that are not of type Function
678+
*
679+
*/
673680
const numNonFunctions = composition => {
674681
if (composition.type === 'function') {
675682
return 0
@@ -688,4 +695,10 @@ const numNonFunctions = composition => {
688695
}
689696
}
690697

698+
/**
699+
* Capitalize a given string
700+
*
701+
*/
702+
const capitalize = str => str.charAt(0).toUpperCase() + str.substring(1)
703+
691704
module.exports = fsm2graph;

0 commit comments

Comments
 (0)