Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
"Global Configurations" defined in workflow XML are being lost during…
… Import workflow (or) during "Reset workflow" (#2856)

* wfm spark name node appending

* Global Configurations defined in workflow XML are being lost during Import workflow (or) during Reset workflow
  • Loading branch information
venkatasairamlanka committed Mar 13, 2019
1 parent 5cc3594 commit e366b43f499812df6005bb51f295bfd6a5f642fa
Showing 4 changed files with 37 additions and 0 deletions.
@@ -54,6 +54,7 @@ export default Ember.Component.extend(Validations,{
this.set('isJar', this.get('actionModel.jar') && this.get('actionModel.jar').endsWith('.jar'));
this.sendAction('register','sparkAction', this);
}.on('init'),
appendNameNode: false,
initialize : function(){
this.on('fileSelected',function(fileName){
this.set(this.get('filePathModel'), fileName);
@@ -105,6 +106,20 @@ export default Ember.Component.extend(Validations,{
this.$('#collapseOne').collapse('show');
}
}.on('didUpdate'),
validateJarPathAndAppend() {
let nameNode = this.get('actionModel.nameNode'), jar = this.get('actionModel.jar');
if(!jar) {
return;
}
this.toggleProperty('appendNameNode');
if(!jar.startsWith('${nameNode}') && this.get('appendNameNode')) {
this.set('actionModel.jar', `${nameNode}${jar}`);
} else if(jar.startsWith('${nameNode}') && this.get('appendNameNode')) {
this.set('actionModel.jar', `${jar}`);
} else {
this.set('actionModel.jar', jar.replace('${nameNode}', ''));
}
},
actions : {
openFileBrowser(model, context){
if(undefined === context){
@@ -116,6 +131,9 @@ export default Ember.Component.extend(Validations,{
register (name, context){
this.sendAction('register',name , context);
},
appendNamenode() {
this.validateJarPathAndAppend();
},
onMasterChange (elt){
var value = this.$(elt).val();
if(value !== 'other'){
@@ -63,6 +63,15 @@ var WorkflowImporter= Ember.Object.extend({
var nodeMap=this.setupNodeMap(workflowAppJson,workflow,Ember.$(xmlDoc));
this.setupTransitions(workflowAppJson,nodeMap);
workflow.set("startNode",nodeMap.get("start").node);
let globalProperties = workflowJson["workflow-app"].global.configuration.property;
if(workflowJson["workflow-app"].global) {
if(Ember.isArray(globalProperties)) {
workflow.set("globalSetting", workflowJson["workflow-app"].global);
} else {
workflow.set("globalSetting", {configuration : { property:[globalProperties] }} );
}
}

this.populateKillNodes(workflow,nodeMap);
return {workflow: workflow, errors: errors};
},
@@ -1824,4 +1824,7 @@ input:invalid {
.note-info {
position: relative;
top: 10px;
}
.spark-namenode {
top: 15px;
}
@@ -48,6 +48,13 @@
</div>
</div>
{{/if}}
<div class="form-group">
<label for="inputEmail" class="control-label col-xs-2">Append master<span class="requiredField">&nbsp;*</span></label>
<div class="col-xs-2 spark-namenode">
<input type="checkbox" name="master" checked={{appendNameNode}} value="other" onchange={{action "appendNamenode" value="target"}}>
</div>
</div>

<div class="form-group">
<label for="inputEmail" class="control-label col-xs-2">Runs On<span class="requiredField">&nbsp;*</span></label>
{{#each mastersList as |master|}}

0 comments on commit e366b43

Please sign in to comment.