Repository: ambari Updated Branches: refs/heads/trunk d4c668c7b -> 336e8e0a7
AMBARI-20132. All the workflow details are getting logged in UI console log.(Belliraj HB via gauravn7) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/336e8e0a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/336e8e0a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/336e8e0a Branch: refs/heads/trunk Commit: 336e8e0a705f8c36219c3dc03ff255a677c17601 Parents: d4c668c Author: Gaurav Nagar <grv...@gmail.com> Authored: Mon Feb 27 18:33:22 2017 +0530 Committer: Gaurav Nagar <grv...@gmail.com> Committed: Mon Feb 27 18:34:08 2017 +0530 ---------------------------------------------------------------------- .../resources/ui/app/components/coord-config.js | 3 +-- .../ui/app/components/flow-designer.js | 27 +++----------------- .../resources/ui/app/components/job-config.js | 4 +-- .../resources/ui/app/components/job-details.js | 1 - .../main/resources/ui/app/components/save-wf.js | 1 - .../resources/ui/app/components/sqoop-action.js | 1 - .../ui/app/components/workflow-action-editor.js | 2 +- .../ui/app/domain/action-type-resolver.js | 5 ++-- .../app/domain/bundle/bundle-xml-generator.js | 1 - .../coordinator/coordinator-xml-generator.js | 1 - .../coordinator/coordinator-xml-importer.js | 4 +-- .../ui/app/domain/cytoscape-flow-renderer.js | 17 ++++++------ .../resources/ui/app/domain/cytoscape-style.js | 10 +++++++- .../resources/ui/app/domain/schema-versions.js | 4 +-- .../ui/app/domain/workflow-importer.js | 2 +- .../ui/app/domain/workflow-json-importer.js | 4 +-- .../main/resources/ui/app/domain/workflow.js | 9 +++++++ .../ui/app/routes/design/proj-manager-tab.js | 2 +- .../src/main/resources/ui/app/routes/index.js | 2 +- .../ui/app/services/workspace-manager.js | 6 +---- .../main/resources/ui/app/utils/common-utils.js | 14 ++++++++++ 21 files changed, 59 insertions(+), 61 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js index 61d9f35..f6e11b6 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js @@ -599,7 +599,6 @@ export default Ember.Component.extend(Validations, Ember.Evented, { deferred.promise.then(function(data){ this.sendAction('openTab', type, path); }.bind(this)).catch(function(data){ - console.log(data); this.set('errorMsg', 'There is some problem while importing.'); this.set('data', data); }.bind(this)); @@ -661,7 +660,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, { var workflowJson = x2js.xml_str2json(data); this.set('workflowName', workflowJson["workflow-app"]._name); }.bind(this)).catch(function(data){ - console.log(data); + console.error(data); this.set('workflowName', null); this.set('errorMsg', "There is some problem while fetching workflow name."); this.set("data", data); http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js index 8597d72..9eb20aa 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js @@ -392,24 +392,7 @@ export default Ember.Component.extend(FindNodeMixin, Validations, { }); return deferred; }, - getAssetFromHdfs(filePath){ - var url = Ember.ENV.API_URL + "/readAsset?assetPath="+filePath; - var deferred = Ember.RSVP.defer(); - Ember.$.ajax({ - url: url, - method: 'GET', - dataType: "text", - beforeSend: function (xhr) { - xhr.setRequestHeader("X-XSRF-HEADER", Math.round(Math.random()*100000)); - xhr.setRequestHeader("X-Requested-By", "Ambari"); - } - }).done(function(data){ - deferred.resolve(data); - }).fail(function(data){ - deferred.reject(data); - }); - return deferred; - }, + importActionSettingsFromString(actionSettings) { var x2js = new X2JS(); var actionSettingsObj = x2js.xml_str2json(actionSettings); @@ -477,8 +460,6 @@ export default Ember.Component.extend(FindNodeMixin, Validations, { self.set("data", data); self.set("isAssetPublishing", false); }); - - console.log("Action Node", actionNodeXml); }, resetDesigner(){ this.set("xmlAppPath", null); @@ -552,7 +533,7 @@ export default Ember.Component.extend(FindNodeMixin, Validations, { getWorkflowAsNativeJsonImpl(){ try{ var json=JSON.stringify(this.get("workflow")), self = this; - var actionVersions = JSON.stringify([...this.get("workflow").schemaVersions.actionVersions]); + var actionVersions = JSON.stringify(CommonUtils.toArray(this.get("workflow").schemaVersions.actionVersions)); var workflow = JSON.parse(json); workflow.schemaVersions.actionVersions = actionVersions return JSON.stringify(workflow); @@ -564,7 +545,7 @@ export default Ember.Component.extend(FindNodeMixin, Validations, { getWorkflowAsJsonJsoGImpl(){ try{ var json=JSOG.stringify(this.get("workflow")), self = this; - var actionVersions = JSOG.stringify([...this.get("workflow").schemaVersions.actionVersions]); + var actionVersions = JSOG.stringify(CommonUtils.toArray(this.get("workflow").schemaVersions.actionVersions)); var workflow = JSOG.parse(json); workflow.schemaVersions.actionVersions = actionVersions return JSOG.stringify(workflow); @@ -578,13 +559,11 @@ export default Ember.Component.extend(FindNodeMixin, Validations, { function detect (obj) { if (typeof obj === 'object') { if (seenObjects.indexOf(obj) !== -1) { - console.log("object already seen",obj); return true; } seenObjects.push(obj); for (var key in obj) { if (obj.hasOwnProperty(key) && detect(obj[key])) { - console.log("object already seen",key); return true; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js index 00dedbb..15c1fbf 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-config.js @@ -38,8 +38,6 @@ export default Ember.Component.extend(Validations, { systemConfigs : Ember.A([]), showingFileBrowser : false, overwritePath : false, - configMap : Ember.A([]), - configPropsExists : false, savingInProgress : false, isStackTraceVisible: false, isStackTraceAvailable: false, @@ -231,7 +229,7 @@ export default Ember.Component.extend(Validations, { this.set("savingInProgress",false); }.bind(this), error: function(response) { - console.log(response); + console.error(response); this.set("savingInProgress",false); this.showNotification({ "type": "error", http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/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 f659317..e74c873 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 @@ -260,7 +260,6 @@ export default Ember.Component.extend({ renderDag(xmlString){ var wfObject = this.get("workflowImporter").importWorkflow(xmlString); var workflow = wfObject.workflow; - console.log("Workflow Object..", workflow); var dataNodes=this.getCyDataNodes(workflow); if (dataNodes.length > Constants.flowGraphMaxNodeCount) { this.set("model.flowGraphMaxNodeCountReached", true); http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js index 01da55b..017bc61 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/save-wf.js @@ -102,7 +102,6 @@ export default Ember.Component.extend(Validations, { self.set("savingInProgress",false); this.set('jobFilePath', this.get('filePath')); }.bind(this)).catch(function(response){ - console.log(response); self.set("savingInProgress",false); self.showNotification({ "type": "error", http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/components/sqoop-action.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/sqoop-action.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/sqoop-action.js index 67ba85a..589864e 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/sqoop-action.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/sqoop-action.js @@ -97,7 +97,6 @@ export default Ember.Component.extend(Validations, { this.sendAction('openFileBrowser', model, context); }, register (name, context){ - this.get('childComponents').set(name, context); this.sendAction('register',name , context); }, setIsArg(value){ http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-action-editor.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-action-editor.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-action-editor.js index e19646d..09bffe7 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-action-editor.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-action-editor.js @@ -93,7 +93,7 @@ export default Ember.Component.extend( Ember.Evented,{ let x2js = new X2JS(); var startTag = `<${this.get('actionType')}`; Object.keys(this.get('actionModel')).forEach(key => { - if(key.startsWith('_') && key !== '__jsogObjectId'){ + if(CommonUtils.startsWith(key,'_') && key !== '__jsogObjectId'){ startTag = `${startTag} ${key.substr(1)}="${this.get('actionModel')[key]}"`; } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/action-type-resolver.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/action-type-resolver.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/action-type-resolver.js index 8cbcfaf..135fbfb 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/action-type-resolver.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/action-type-resolver.js @@ -17,6 +17,7 @@ import Ember from 'ember'; import * as actionJobHandler from '../domain/actionjob_hanlder'; +import CommonUtils from "../utils/common-utils"; var ActionTypeResolver=Ember.Object.extend({ actionJobHandlerMap:null, @@ -43,14 +44,14 @@ var ActionTypeResolver=Ember.Object.extend({ var resolvedType=null; var problaleActionsTypes=[]; Object.keys(json).forEach(function functionName(key) { - if (!self.validStandardActionProps.contains(key) && !key.startsWith("_")){ + if (!self.validStandardActionProps.contains(key) && !CommonUtils.startsWith(key,"_")){ problaleActionsTypes.push(key); } }); if (problaleActionsTypes.length===1){ return problaleActionsTypes[0]; }else{ - console.error("Invalid Action spec..",json); + console.error("Invalid Action spec.."); } return resolvedType; }, http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/bundle/bundle-xml-generator.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/bundle/bundle-xml-generator.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/bundle/bundle-xml-generator.js index f2dcef9..30dd7bb 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/bundle/bundle-xml-generator.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/bundle/bundle-xml-generator.js @@ -20,7 +20,6 @@ var BundleGenerator= Ember.Object.extend({ bundle: null, process (){ var xmlJson={"bundle-app":{}}; - console.log(this.bundle); var bundleApp=xmlJson["bundle-app"]; bundleApp._xmlns = "uri:oozie:bundle:"+this.bundle.schemaVersions.bundleVersion; bundleApp._name = this.bundle.name; http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-generator.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-generator.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-generator.js index 4c8d16f..e31e8fc 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-generator.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-generator.js @@ -25,7 +25,6 @@ var CoordinatorGenerator= Ember.Object.extend({ }, process(){ var xmlJson={"coordinator-app":{}}; - console.log(this.coordinator); var coordinatorApp=xmlJson["coordinator-app"]; coordinatorApp._name = this.coordinator.name; if(this.coordinator.frequency.type !== 'cron'){ http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-importer.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-importer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-importer.js index bc61f10..5101181 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-importer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/coordinator/coordinator-xml-importer.js @@ -81,7 +81,7 @@ var CoordinatorXmlImporter= Ember.Object.extend({ } coordinator.schemaVersions.coordinatorVersion = coordinatorVersion; var frequency = coordinatorApp._frequency; - if(frequency.startsWith('${coord:')){ + if(CommonUtils.startsWith(frequency,'${coord:')){ coordinator.frequency.type = frequency.substring(frequency.indexOf(':')+1, frequency.indexOf('(')); coordinator.frequency.value = frequency.substring(frequency.indexOf('(')+1, frequency.indexOf(')')); }else{ @@ -135,7 +135,7 @@ var CoordinatorXmlImporter= Ember.Object.extend({ timezone : dataset._timezone }; var frequency = dataset._frequency; - if(frequency.startsWith('${coord:')){ + if(CommonUtils.startsWith(frequency,'${coord:')){ dataSetJson.frequency.type = frequency.substring(frequency.indexOf(':')+1, frequency.indexOf('(')); dataSetJson.frequency.value = frequency.substring(frequency.indexOf('(')+1, frequency.indexOf(')')); }else{ http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js index 75ceecb..ae178b3 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-flow-renderer.js @@ -99,7 +99,7 @@ var CytoscapeRenderer= Ember.Object.extend({ self.get('dataNodes').pushObject({ data: { - id: node.id, name: node.name, type: node.type, + id: node.id, name: node.name, shape: self._getShape(node.type), type : node.type, node: node @@ -107,11 +107,12 @@ var CytoscapeRenderer= Ember.Object.extend({ dataNodeName: Ember.computed.alias('data.node.name') }); if (node.transitions.length > 0) { + var counter=0; node.transitions.forEach(function(transition){ - //if (transition.isOnError()|| transition.targetNode.isKillNode()){ if ((transition.isOnError() && transition.getTargetNode().isKillNode())){ return; } + counter++; var targetNodeId=transition.targetNode.id; if (transition.targetNode.isKillNode()){ errorNodeCounter++; @@ -119,7 +120,7 @@ var CytoscapeRenderer= Ember.Object.extend({ targetNodeId=errorNode.id+errorNodeCounter; self.get('dataNodes').pushObject({ data: { - id: targetNodeId, name: errorNode.name, type: errorNode.type, + id: targetNodeId, name: errorNode.name, shape: self._getShape(errorNode.type), type : errorNode.type, node: errorNode @@ -130,7 +131,7 @@ var CytoscapeRenderer= Ember.Object.extend({ self.get('dataNodes').pushObject( { data: { - id: transition.sourceNodeId + '_to_' + targetNodeId, + id: transition.sourceNodeId + '_to_' + targetNodeId+"_"+counter, source:transition.sourceNodeId, target: targetNodeId, transition: transition, @@ -337,14 +338,14 @@ var CytoscapeRenderer= Ember.Object.extend({ var incomingNodes=node.incomers("node").jsons().mapBy("data.node"); var transitionList=[]; var currentNodeId=this.get("currentCyNode").json().data.id; - for (var incomingNode of incomingNodes) { - for (var incomingTran of incomingNode.transitions ){ + incomingNodes.forEach(function(incomingNode){ + incomingNode.transitions.forEach(function(incomingTran){ if (incomingTran.targetNode.id===currentNodeId){ incomingTran.sourceNode=incomingNode; transitionList=transitionList.concat(incomingTran); } - } - } + }); + }); return transitionList; }, populateOkToandErrorTONodes(node){ http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-style.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-style.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-style.js index e05b782..5a85573 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-style.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/cytoscape-style.js @@ -107,7 +107,15 @@ export default Ember.Object.create({ { selector: 'edge', style: { - 'curve-style': 'bezier', + 'curve-style': function(target){ + if (target.data().transition && target.data().transition.isOnError()){ + return 'unbundled-bezier'; + }else{ + return 'haystack' + } + }, + 'control-point-distances': 20, + 'control-point-step-size': 10, 'target-arrow-shape': function(target){ if (target.data().transition && target.data().transition.getTargetNode(false) && !target.data().transition.getTargetNode(false).isPlaceholder()) { return "triangle"; http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/schema-versions.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/schema-versions.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/schema-versions.js index 67605ae..a0b449c 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/schema-versions.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/schema-versions.js @@ -27,7 +27,7 @@ export default Ember.Object.extend({ actionSchemas:{ "hive":["0.6","0.5","0.4","0.3","0.2","0.1"], "hive2":["0.2","0.1"], - "sqoop":["0.3","0.2","0.1"], + "sqoop":["0.4","0.3","0.2","0.1"], "shell":["0.3","0.2","0.1"], "spark":["0.2","0.1"], "distcp":["0.2","0.1"], @@ -79,7 +79,7 @@ export default Ember.Object.extend({ initializeDefaultVersions(){ this.supportedVersions.forEach((value, key) =>{ - var max = Math.max(...value) + var max = Math.max.apply(null,value); if(isNaN(max)){ max = value.reduce((a, b) => a > b?a:b); } http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js index ae566f2..dd63a3a 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-importer.js @@ -80,7 +80,7 @@ var WorkflowImporter= Ember.Object.extend({ if(!CommonUtils.isSupportedAction(wfActionType)){ return; } - var maxImportedActionVersion = Math.max(...importedWfActionVersions.get(wfActionType)); + var maxImportedActionVersion = Math.max.apply(null,importedWfActionVersions.get(wfActionType)); var supportedVersions = this.get('schemaVersions').getSupportedVersions(wfActionType); importedWfActionVersions.get(wfActionType).forEach((version)=>{ if(supportedVersions.indexOf(version) === -1){ http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-json-importer.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-json-importer.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-json-importer.js index fa7a8b8..2e937e5 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-json-importer.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow-json-importer.js @@ -36,14 +36,12 @@ var WorkflowJsonImporter= Ember.Object.extend({ workflow.set("startNode",startNode); var maxId=0; for(let value of nodeMap.keys()){ - console.log("Value in it=",value); var id=Number.parseInt(value.substr(5)); if (id>maxId){ maxId=id; } } this.nodeFactory.resetNodeIdTo(maxId+1); - console.log("imported workflow==",workflow); return workflow; }catch(e){ console.error(e); @@ -91,7 +89,7 @@ var WorkflowJsonImporter= Ember.Object.extend({ killnodesJson.forEach(function(killNodeJson){ workflow.createKillNode(killNodeJson.name,killNodeJson.killMessage); }); - console.log("killnodes json=",killnodesJson); + } }); export {WorkflowJsonImporter}; http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js index be8d8de..9fd8286 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/workflow.js @@ -148,8 +148,14 @@ var Workflow= Ember.Object.extend(FindNodeMixin,{ if (sourceNode && sourceNode.isPlaceholder()) { var orignalTransition=this.findTransitionTo(this.startNode,sourceNode.id); orignalTransition.targetNode=generatedNode; + if (orignalTransition.isOnError()){ + orignalTransition.source.set("errorNode",generatedNode); + } } else { transition.targetNode=generatedNode; + if (transition.isOnError()){ + transition.source.set("errorNode",generatedNode); + } } return generatedNode; }, @@ -218,6 +224,9 @@ var Workflow= Ember.Object.extend(FindNodeMixin,{ } }else{ tran.targetNode=target; + if (tran.isOnError()){ + tran.sourceNode.set("errorNode",target ); + } } }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/routes/design/proj-manager-tab.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/routes/design/proj-manager-tab.js b/contrib/views/wfmanager/src/main/resources/ui/app/routes/design/proj-manager-tab.js index 685b49c..60cd169 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/routes/design/proj-manager-tab.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/routes/design/proj-manager-tab.js @@ -20,7 +20,7 @@ import Ember from 'ember'; export default Ember.Route.extend({ model:function(params) { var data = this.store.findAll("wfproject").catch((error) => { - console.log(error); + console.error(error); }); return data; }, http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/routes/index.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/routes/index.js b/contrib/views/wfmanager/src/main/resources/ui/app/routes/index.js index b9ea770..8aac32b 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/routes/index.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/routes/index.js @@ -27,7 +27,7 @@ export default Ember.Route.extend({ this.processServiceCheckPromise(ooziePromise, serviceChecks.findBy('name', 'oozie')); this.processServiceCheckPromise(hdfsPromise, serviceChecks.findBy('name', 'hdfs')); this.processServiceCheckPromise(homeDirPromise, serviceChecks.findBy('name', 'homeDir')); - Promise.all([ooziePromise, hdfsPromise, homeDirPromise]).then(()=>{ + Ember.RSVP.Promise.all([ooziePromise, hdfsPromise, homeDirPromise]).then(()=>{ this.controllerFor('index').set('serviceChecksComplete', true); Ember.run.later(()=>{ this.transitionTo('design'); http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/services/workspace-manager.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/services/workspace-manager.js b/contrib/views/wfmanager/src/main/resources/ui/app/services/workspace-manager.js index c377ecc..e77ef7f 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/services/workspace-manager.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/services/workspace-manager.js @@ -40,11 +40,7 @@ export default Ember.Service.extend({ this.get("userInfo").getUserData().promise.then(function(data){ var tabs = localStorage.getItem(data+'-tabsInfo'); - console.log("Restoring tabs "+tabs); deferred.resolve(JSON.parse(tabs)); - - //return JSON.parse(tabs); - }.bind(this)).catch(function(e){ deferred.resolve(""); console.error(e); @@ -84,7 +80,7 @@ export default Ember.Service.extend({ localStorage.setItem(data+"-"+id, workInProgress); }.bind(this)).catch(function(e){ console.error(e); - }); + }); }, deleteWorkInProgress(id){ this.get("userInfo").getUserData().promise.then(function(data){ http://git-wip-us.apache.org/repos/asf/ambari/blob/336e8e0a/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js b/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js index 7ad4361..57b57ad 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/utils/common-utils.js @@ -33,6 +33,20 @@ export default Ember.Object.create({ decodeXml(xml){ return xml && xml.length > 0 ? xml.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '\"').replace(/'/g, '\'') : xml; }, + + toArray(map){ + var entries = map.entries(); + var mapArray = []; + while(true){ + var entry = entries.next() + if(entry.done){ + break; + } + mapArray.push(entry.value); + } + return mapArray; + }, + startsWith (string,searchString, position){ position = position || 0; return string.substr(position, searchString.length) === searchString;