You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ni...@apache.org on 2017/02/08 12:27:44 UTC

ambari git commit: AMBARI-19920 : Workfow Manger- Issue in flow graph active transitions in case of decision and fork (M Madhan Mohan Reddy via nitirajrathore)

Repository: ambari
Updated Branches:
  refs/heads/trunk 742225ab9 -> f2329600c


AMBARI-19920 : Workfow Manger- Issue in flow graph active transitions in case of decision and fork (M Madhan Mohan Reddy via nitirajrathore)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f2329600
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f2329600
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f2329600

Branch: refs/heads/trunk
Commit: f2329600c336ad3b51f13e00c5c439a5787f4b96
Parents: 742225a
Author: Nitiraj Singh Rathore <ni...@gmail.com>
Authored: Wed Feb 8 17:55:45 2017 +0530
Committer: Nitiraj Singh Rathore <ni...@gmail.com>
Committed: Wed Feb 8 17:57:06 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/components/job-details.js  | 21 ++++++++++++++++++--
 .../main/resources/ui/app/utils/constants.js    |  4 +++-
 2 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f2329600/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
index d0c5d11..6507c49 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
@@ -18,6 +18,7 @@
 import Ember from 'ember';
 import {WorkflowImporter} from '../domain/workflow-importer';
 import {ActionTypeResolver} from "../domain/action-type-resolver";
+import Constants from '../utils/constants';
 
 export default Ember.Component.extend({
   workflowImporter: WorkflowImporter.create({}),
@@ -104,6 +105,13 @@ export default Ember.Component.extend({
     }
   },
 
+  getActionNode(nodeName, nodeType) {
+    if (nodeType === 'start') {
+      nodeName = ':start:';
+    }
+    return this.getNodeActionByName(this.get('model.actions'), nodeName);
+  },
+
   getActionStatus(nodeName, nodeType) {
     if (nodeType === 'start') {
       nodeName = ':start:';
@@ -201,14 +209,23 @@ export default Ember.Component.extend({
             if (tran.targetNode.type === 'kill') {
               return;
             }
+            var transitionBorderColor;
+            var actionNode = self.getActionNode(node.name, node.type);
+            if (actionNode && (actionNode.transition===tran.targetNode.name ||actionNode.transition==='*')){
+              transitionBorderColor = Constants.successfulFlowColor;//green
+            }else{
+              transitionBorderColor = Constants.defaultFlowColor;//grey
+            }
+            if (!actionNode){
+              transitionBorderColor = Constants.defaultFlowColor;//grey
+            }
             dataNodes.push(
               {
                 data: {
                   id: tran.sourceNodeId + '_to_' + tran.targetNode.id,
                   source:tran.sourceNodeId,
                   target: tran.targetNode.id,
-                  borderColor: (self.getActionStatus(tran.targetNode.name, tran.targetNode.type) === 'Not-Visited')
-                    ? '#808080' : self.getBorderColorBasedOnStatus(nodeActionStatus)
+                  borderColor: transitionBorderColor
                 }
               }
             );

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2329600/contrib/views/wfmanager/src/main/resources/ui/app/utils/constants.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/utils/constants.js b/contrib/views/wfmanager/src/main/resources/ui/app/utils/constants.js
index e410262..ef0758a 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/utils/constants.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/utils/constants.js
@@ -89,5 +89,7 @@ export default Ember.Object.create({
   elConstants : [
     '${YEAR}', '${MONTH}', '${DAY}', '${HOUR}', '${MINUTE}'
   ],
-  customActionEnabled : true
+  customActionEnabled : true,
+  successfulFlowColor : '#5bb75b',
+  defaultFlowColor : '#808080'
 });