ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gna...@apache.org
Subject ambari git commit: AMBARI-20041. Custom job.properties are not retained in the workflow designer.(Venkata Sairam via gauravn7)
Date Thu, 16 Feb 2017 13:03:33 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 c69e7607c -> 2a5064d0a


AMBARI-20041. Custom job.properties are not retained in the workflow designer.(Venkata Sairam
via gauravn7)


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

Branch: refs/heads/branch-2.5
Commit: 2a5064d0a8cbfc030020440df5420ff5f22b3939
Parents: c69e760
Author: Gaurav Nagar <grvngr@gmail.com>
Authored: Thu Feb 16 18:33:24 2017 +0530
Committer: Gaurav Nagar <grvngr@gmail.com>
Committed: Thu Feb 16 18:33:24 2017 +0530

----------------------------------------------------------------------
 .../ui/app/components/designer-workspace.js          | 15 ++++++++++++---
 .../main/resources/ui/app/components/job-config.js   | 11 +++++++++--
 .../main/resources/ui/app/components/job-details.js  |  4 +++-
 .../src/main/resources/ui/app/routes/design.js       |  6 +++---
 .../ui/app/templates/components/flow-designer.hbs    |  2 +-
 5 files changed, 28 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5064d0/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
index f93e1b8..74de3b7 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
@@ -53,13 +53,13 @@ export default Ember.Component.extend({
         this.get('tabs').forEach((tab)=>{
           this.get('tabCounter').set(tab.type, (this.get('tabCounter').get(tab.type)) + 1);
         }, this);
-        Ember.getOwner(this).lookup('route:design').on('openNewTab', function(path, type){
+        Ember.getOwner(this).lookup('route:design').on('openNewTab', function(path, type,
isImportedFromDesigner, configuration){
           if(type === 'COORDINATOR'){
             this.createNewTab('coord', path);
           }else if(type === 'BUNDLE'){
             this.createNewTab('bundle', path);
           }else{
-            this.createNewTab('wf', path);
+            this.createNewTab('wf', path, isImportedFromDesigner, configuration);
           }
         }.bind(this));
 
@@ -103,9 +103,17 @@ export default Ember.Component.extend({
       }.bind(this));
     }, 1000);
   },
-  createNewTab : function(type, path){
+  setWFConfigProperties(tab ,isImportedFromDesigner, configuration){
+    if(isImportedFromDesigner) {
+      tab.isImportedFromDesigner = true;
+      tab.configuration = configuration;
+    }
+    return tab;
+  },
+  createNewTab : function(type, path, isImportedFromDesigner, configuration){
     var existingTab = this.get('tabs').findBy("filePath", path);
     if(existingTab && path){
+      existingTab = this.setWFConfigProperties(existingTab, isImportedFromDesigner, configuration);
       this.$('.nav-tabs a[href="#' + existingTab.id + '"]').tab("show");
       return;
     }
@@ -117,6 +125,7 @@ export default Ember.Component.extend({
     if(path){
       tab.path = path;
     }
+    tab = this.setWFConfigProperties(tab, isImportedFromDesigner, configuration);
     this.$('.nav-tabs li').removeClass('active');
     this.$('.tab-content .tab-pane').removeClass('active');
     this.get('tabs').pushObject(tab);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5064d0/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 f364e30..00dedbb 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
@@ -112,7 +112,7 @@ export default Ember.Component.extend(Validations, {
 
   extractJobProperties(){
     var jobProperties = [];
-    var jobParams = this.get("jobConfigs").params;
+    var jobParams = this.get("jobConfigs").params, self = this;
     this.get("jobProps").forEach(function(value) {
       if (value!== Constants.defaultNameNodeValue && value!==Constants.rmDefaultValue){
         var propName = value.trim().substring(2, value.length-1);
@@ -125,9 +125,16 @@ export default Ember.Component.extend(Validations, {
             isRequired = true;
           }
         }
+        let val = null, tabData = self.get("tabInfo");
+        if(tabData && tabData.isImportedFromDesigner && tabData.configuration
&& tabData.configuration.settings && tabData.configuration.settings.configuration
&& tabData.configuration.settings.configuration.property) {
+          let propVal = tabData.configuration.settings.configuration.property.findBy('name',
propName);
+          if(propVal) {
+            val = propVal.value
+          }
+        }
         var prop= Ember.Object.create({
           name: propName,
-          value: null,
+          value: val,
           isRequired : isRequired
         });
         jobProperties.push(prop);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5064d0/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 fe60793..f659317 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
@@ -480,7 +480,9 @@ export default Ember.Component.extend({
         this.sendAction('showCoord', coordId);
       },
       editWorkflow(path){
-        this.sendAction('editWorkflow', path);
+        var x2js = new X2JS();
+        var configurationObj  = x2js.xml_str2json(this.get('model.conf'));
+        this.sendAction('editWorkflow', path, null, true, {"settings":configurationObj});
       }
     }
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5064d0/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js b/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
index 25a3266..b5f0fad 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/routes/design.js
@@ -71,8 +71,8 @@ export default Ember.Route.extend(Ember.Evented, {
       this.set('failedSchemaVersions', true);
       transition.retry();
     },
-    editWorkflow(path, type){
-      this.trigger('openNewTab', path, type);
+    editWorkflow(path, type, isImportedFromDesigner, configuration){
+      this.trigger('openNewTab', path, type, isImportedFromDesigner, configuration);
     },
     showDashboard(){
       this.controller.set('dashboardShown', true);
@@ -90,4 +90,4 @@ export default Ember.Route.extend(Ember.Evented, {
       this.transitionTo('design');
     }
   }
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5064d0/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
index ff92f7d..0356e9c 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
@@ -284,7 +284,7 @@
   {{save-wf type='wf' close="closeSaveWorkflow" jobFilePath=workflowFilePath openFileBrowser="openFileBrowser"
closeFileBrowser="closeFileBrowser" jobConfigs=configForSave}}
 {{/if}}
 {{#if showingWorkflowConfigProps}}
-  {{job-config type='wf' closeJobConfigs="closeWorkflowSubmitConfigs" jobFilePath=workflowFilePath
openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=workflowSubmitConfigs
isDryrun=dryrun}}
+  {{job-config type='wf' closeJobConfigs="closeWorkflowSubmitConfigs" jobFilePath=workflowFilePath
tabInfo=tabInfo openFileBrowser="openFileBrowser" closeFileBrowser="closeFileBrowser" jobConfigs=workflowSubmitConfigs
isDryrun=dryrun}}
 {{/if}}
 {{#if showGlobalConfig}}
   {{#global-config closeGlobalConfig="closeWorkflowGlobalProps" saveGlobalConfig="saveGlobalConfig"
actionModel=globalConfig}}{{/global-config}}


Mime
View raw message