From 2c1fe14206e8d47b4484c8b35f6c866a432440ec Mon Sep 17 00:00:00 2001 From: mabashian Date: Mon, 26 Mar 2018 14:55:01 -0400 Subject: [PATCH 1/2] Fixed js error when adding first workflow node --- awx/ui/client/src/templates/workflows/workflow.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/templates/workflows/workflow.service.js b/awx/ui/client/src/templates/workflows/workflow.service.js index 2199e67d5c..bf631080ce 100644 --- a/awx/ui/client/src/templates/workflows/workflow.service.js +++ b/awx/ui/client/src/templates/workflows/workflow.service.js @@ -73,7 +73,7 @@ export default ['$q', function($q){ placeholder: true, isNew: true, edited: false, - isRoot: params.parent.source.isStartNode ? true : false + isRoot: _.get(params, 'parent.isStartNode') ? true : _.get(params, 'parent.source.isStartNode', false) }; let parentNode = (params.betweenTwoNodes) ? this.searchTree({element: params.tree, matchingId: params.parent.source.id}) : this.searchTree({element: params.tree, matchingId: params.parent.id}); From 6c321f810a6577f22b4d0c0bdcef13f5101f005c Mon Sep 17 00:00:00 2001 From: mabashian Date: Mon, 26 Mar 2018 15:00:33 -0400 Subject: [PATCH 2/2] Tweaked isRoot logic to follow the same pattern as the rest of the function --- awx/ui/client/src/templates/workflows/workflow.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/templates/workflows/workflow.service.js b/awx/ui/client/src/templates/workflows/workflow.service.js index bf631080ce..fe632a2e1d 100644 --- a/awx/ui/client/src/templates/workflows/workflow.service.js +++ b/awx/ui/client/src/templates/workflows/workflow.service.js @@ -73,7 +73,7 @@ export default ['$q', function($q){ placeholder: true, isNew: true, edited: false, - isRoot: _.get(params, 'parent.isStartNode') ? true : _.get(params, 'parent.source.isStartNode', false) + isRoot: (params.betweenTwoNodes) ? _.get(params, 'parent.source.isStartNode', false) : _.get(params, 'parent.isStartNode', false) }; let parentNode = (params.betweenTwoNodes) ? this.searchTree({element: params.tree, matchingId: params.parent.source.id}) : this.searchTree({element: params.tree, matchingId: params.parent.id});