ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From niti...@apache.org
Subject 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)
Date Wed, 08 Feb 2017 12:29:03 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 2f5ef8c6c -> 90d1ff1ad


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/90d1ff1a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/90d1ff1a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/90d1ff1a

Branch: refs/heads/branch-2.5
Commit: 90d1ff1ad92062bdf622ccdf6e8c5873092c3c01
Parents: 2f5ef8c
Author: Nitiraj Singh Rathore <nitiraj.rathore@gmail.com>
Authored: Wed Feb 8 17:55:45 2017 +0530
Committer: Nitiraj Singh Rathore <nitiraj.rathore@gmail.com>
Committed: Wed Feb 8 17:56:34 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/90d1ff1a/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/90d1ff1a/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'
 });


Mime
View raw message