AMBARI-19602. Input logic tags are missing in the coordinator xml(Padma Priya N via gauravn7)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f7155d9c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f7155d9c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f7155d9c Branch: refs/heads/branch-dev-patch-upgrade Commit: f7155d9c40362d084bae5e695b0af1fe8fd584c3 Parents: f684c2b Author: Gaurav Nagar <[email protected]> Authored: Wed Jan 18 17:00:01 2017 +0530 Committer: Gaurav Nagar <[email protected]> Committed: Wed Jan 18 17:00:01 2017 +0530 ---------------------------------------------------------------------- .../resources/ui/app/components/coord-config.js | 12 ++++++++++++ .../main/resources/ui/app/components/job-config.js | 17 ++++++++++++----- .../domain/coordinator/coordinator-xml-importer.js | 12 ++++++++++++ .../ui/app/templates/components/coord-config.hbs | 11 +++++++---- .../ui/app/templates/components/job-config.hbs | 4 +++- 5 files changed, 46 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f7155d9c/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 eb0d585..26b94cf 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 @@ -298,6 +298,10 @@ export default Ember.Component.extend(Validations, Ember.Evented, { if(coordinator.get('dataInputType') === 'logical'){ this.set('conditionalDataInExists', true); } + if(coordinator.get('inputLogic')){ + this.set('inputLogicExists', true); + this.set('inputLogicEnabled', true); + } }, validateChildComponents(){ var isChildComponentsValid = true; @@ -403,7 +407,15 @@ export default Ember.Component.extend(Validations, Ember.Evented, { this.set('dataOutputEditMode', false); this.set('dataOutputCreateMode', false); }, + dryrunCoordinator(){ + this.set('dryrun', true); + this.send('submit'); + }, submitCoordinator(){ + this.set('dryrun', false); + this.send('submit'); + }, + submit(){ var isChildComponentsValid = this.validateChildComponents(); if(this.get('validations.isInvalid') || !isChildComponentsValid) { this.set('showErrorMessage', true); http://git-wip-us.apache.org/repos/asf/ambari/blob/f7155d9c/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 0979c25..beb15f6 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 @@ -207,11 +207,18 @@ export default Ember.Component.extend(Validations, { data: this.get("jobXml"), success: function(response) { var result=JSON.parse(response); - this.showNotification({ - "type": "success", - "message": this.get('displayName') +" saved.", - "details": "Job id :"+result.id - }); + if(this.get('isDryrun')){ + this.showNotification({ + "type": "success", + "message": `${this.get('displayName')} is valid.` + }); + }else{ + this.showNotification({ + "type": "success", + "message": this.get('displayName') +" saved.", + "details": "Job id :"+result.id + }); + } this.set("savingInProgress",false); }.bind(this), error: function(response) { http://git-wip-us.apache.org/repos/asf/ambari/blob/f7155d9c/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 9b54495..ddb2b43 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 @@ -95,6 +95,9 @@ var CoordinatorXmlImporter= Ember.Object.extend({ coordinator.supportsConditionalDataInput = true; this.extractLogicalInputEvents(coordinatorApp, coordinator); } + if(coordinatorApp['input-logic']){ + this.extractInputLogic(coordinatorApp, coordinator); + } this.extractOutputEvents(coordinatorApp, coordinator); this.extractAction(coordinatorApp, coordinator); this.extractParameters(coordinatorApp, coordinator); @@ -187,6 +190,15 @@ var CoordinatorXmlImporter= Ember.Object.extend({ this.parseConditionTree(conditionJson[key], condition); }, this); }, + extractInputLogic(coordinatorApp, coordinator){ + var conditionJson = coordinatorApp['input-logic']; + var condition = {}; + coordinator.inputLogic = condition; + Object.keys(conditionJson).forEach((key)=>{ + condition.operator = key; + this.parseConditionTree(conditionJson[key], condition); + }, this); + }, extractDataInputOperand(operandJson){ var operand = {}; operand.name = operandJson._name; http://git-wip-us.apache.org/repos/asf/ambari/blob/f7155d9c/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs index f906fd5..dc69382 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs @@ -35,7 +35,7 @@ <ul class="dropdown-menu"> <li> <a class="pointer" title="Import workflow" {{action "openFileBrowser" "coordinatorFilePath"}}> - <i class="fa fa-download"> Import</i> + <i class="fa fa-download marginright5"></i>Import </a> </li> <li> @@ -78,6 +78,9 @@ <button id="save-coord" type="button" class="btn btn-default" title="Save coordinator in HDFS" {{action "save"}}> <i class="fa fa-floppy-o"></i> Save </button> + <button type="button" class="btn btn-default" title="Validate Coordinator" {{action "dryrunCoordinator"}}> + <i class="fa fa-play marginright5"></i>Validate + </button> <button type="button" class="btn btn-primary" title="Submit Coordinator" {{action "submitCoordinator"}}> <i class="fa fa-upload marginright5"></i>Submit </button> @@ -245,7 +248,7 @@ <ul class="list-groups"> {{#if conditionalDataInExists}} <li class="list-group-item"> - {{#conditional-data-input condition=coordinator.conditionalDataInput datasets=datasetsForInputs isToplevel=true register="registerChild" deregister="deregisterChild"}} + {{#conditional-data-input condition=coordinator.conditionalDataInput datasets=coordinator.dataInputs isToplevel=true register="registerChild" deregister="deregisterChild"}} <span class="pull-right"> <i class="fa fa-trash-o" title="Delete" {{action "deleteCondition" index bubbles=false}}></i> </span> @@ -271,7 +274,7 @@ <ul class="list-group"> {{#if inputLogicExists}} <li class="list-group-item"> - {{#conditional-data-input condition=coordinator.inputLogic datasets=datasetsForInputs isToplevel=true register="registerChild" deregister="deregisterChild"}} + {{#conditional-data-input condition=coordinator.inputLogic datasets=coordinator.dataInputs isToplevel=true register="registerChild" deregister="deregisterChild"}} <span class="pull-right"> <i class="fa fa-trash-o" title="Delete" {{action "deleteInputLogic" index bubbles=false}}></i> </span> @@ -336,7 +339,7 @@ parameterizedWorkflowPath=parameterizedWorkflowPath extractProperties="extractProperties" containsParameteriedPaths=containsParameteriedPaths jobFilePath=coordinatorFilePath openFileBrowser="openFileBrowser" - closeFileBrowser="closeFileBrowser" jobConfigs=coordinatorConfigs}} + closeFileBrowser="closeFileBrowser" jobConfigs=coordinatorConfigs isDryrun=dryrun}} {{/if}} {{#if showingResetConfirmation}} {{#confirmation-dialog title="Confirm Coordinator Reset" http://git-wip-us.apache.org/repos/asf/ambari/blob/f7155d9c/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-config.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-config.hbs index b33420a..7ffdf5f 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-config.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-config.hbs @@ -174,7 +174,9 @@ {{#if isDryrun}} <button type="button" class="btn btn-primary" {{action "dryrun"}}>Validate</button> {{else}} - <button type="button" class="btn btn-default" {{action "dryrun"}}>Validate</button> + {{#if (not (eq type 'bundle'))}} + <button type="button" class="btn btn-default" {{action "dryrun"}}>Validate</button> + {{/if}} <button type="button" class="btn btn-primary" {{action "save"}}>Submit</button> {{/if}} {{/if}}
