Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4A966200C1D for ; Thu, 16 Feb 2017 14:03:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 49133160B61; Thu, 16 Feb 2017 13:03:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6CCC0160B57 for ; Thu, 16 Feb 2017 14:03:36 +0100 (CET) Received: (qmail 86815 invoked by uid 500); 16 Feb 2017 13:03:34 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 86806 invoked by uid 99); 16 Feb 2017 13:03:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2017 13:03:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F1820DFB0E; Thu, 16 Feb 2017 13:03:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gnagar@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Thu, 16 Feb 2017 13:03:37 -0000 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 Authored: Thu Feb 16 18:33:24 2017 +0530 Committer: Gaurav Nagar 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}}