Skip to content

Commit

Permalink
fix non-capitalization of Mask in wskflow
Browse files Browse the repository at this point in the history
  • Loading branch information
starpit committed Apr 11, 2018
1 parent e0ea575 commit e860703
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/plugins/modules/wskflow/lib/fsm2graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ function ir2graph(ir, gm, id, prevId, options={}){ // ir and graph model
}
else if(typeof ir.body === 'object'){
// generic handler for any subgraph-via-body node
const body = drawNodeNew(id, ir.type, ir.type, undefined, options)
const label = capitalize(ir.type),
type = ir.type,
body = drawNodeNew(id, label, type, undefined, options)

body.children = []
body.edges = []
gm.children.push(body);
Expand Down Expand Up @@ -670,6 +673,10 @@ const isSimpleComposition = ir => {
return isShort && atMostOneNonFunction
}

/**
* @return the cumulative number of nodes in the given composition that are not of type Function
*
*/
const numNonFunctions = composition => {
if (composition.type === 'function') {
return 0
Expand All @@ -688,4 +695,10 @@ const numNonFunctions = composition => {
}
}

/**
* Capitalize a given string
*
*/
const capitalize = str => str.charAt(0).toUpperCase() + str.substring(1)

module.exports = fsm2graph;

0 comments on commit e860703

Please sign in to comment.