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 C88DC200C32 for ; Thu, 9 Mar 2017 17:39:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C761C160B9D; Thu, 9 Mar 2017 16:39:33 +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 9B0EA160B95 for ; Thu, 9 Mar 2017 17:39:32 +0100 (CET) Received: (qmail 4838 invoked by uid 500); 9 Mar 2017 16:39:31 -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 3731 invoked by uid 99); 9 Mar 2017 16:39:31 -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, 09 Mar 2017 16:39:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id ECC00F3206; Thu, 9 Mar 2017 16:39:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: oleewere@apache.org To: commits@ambari.apache.org Date: Thu, 09 Mar 2017 16:40:00 -0000 Message-Id: In-Reply-To: <89e11229f30c401f85abf06d78317c4b@git.apache.org> References: <89e11229f30c401f85abf06d78317c4b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [31/50] [abbrv] ambari git commit: AMBARI-20337.Need to show timer while loading coordinator name while bundle creation.(Madhan Mohan Reddy via gauravn7) archived-at: Thu, 09 Mar 2017 16:39:34 -0000 AMBARI-20337.Need to show timer while loading coordinator name while bundle creation.(Madhan Mohan Reddy via gauravn7) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/934f3f18 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/934f3f18 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/934f3f18 Branch: refs/heads/branch-dev-logsearch Commit: 934f3f18277b3cb48e1e8c9a16836aebdec1d1b0 Parents: ba04d22 Author: Gaurav Nagar Authored: Wed Mar 8 17:24:45 2017 +0530 Committer: Gaurav Nagar Committed: Wed Mar 8 17:24:45 2017 +0530 ---------------------------------------------------------------------- .../ui/app/components/bundle-coord-config.js | 28 +++++++++++++++++--- .../app/templates/components/bundle-config.hbs | 4 +-- .../components/bundle-coord-config.hbs | 5 +++- 3 files changed, 30 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/934f3f18/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-coord-config.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-coord-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-coord-config.js index 2280f82..c2ac96b 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-coord-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-coord-config.js @@ -26,6 +26,7 @@ const Validations = buildValidations({ }) }); export default Ember.Component.extend(Validations, { + propertyExtractor : Ember.inject.service('property-extractor'), initialize : function(){ this.on('fileSelected',function(fileName){ this.set(this.get('filePathModel'), fileName); @@ -52,8 +53,8 @@ export default Ember.Component.extend(Validations, { } }).done(function(data){ deferred.resolve(data); - }).fail(function(){ - deferred.reject(); + }).fail(function(data){ + deferred.reject(data); }); return deferred; }, @@ -95,13 +96,32 @@ export default Ember.Component.extend(Validations, { }, showCoordinatorName(){ this.set('coordinatorName', null); - var deferred = this.readFromHdfs(this.get('coordinator.appPath')); + this.set('errorMsg', ''); + if (this.get('coordinator.appPath') === '') { + return; + } + var path = this.get('appendFileName')(this.get('coordinator.appPath'), 'coord'); + if (this.get('propertyExtractor').containsParameters(path)) { + this.set('containsParameteriedPaths', true); + this.set('parameterizedPathWarning', 'Coordinator path contains variables'); + return; + } else { + this.set('containsParameteriedPaths', false); + this.set('parameterizedPathWarning', ''); + } + this.set('coordNameFetchingInProgress', true); + var deferred = this.readFromHdfs(path); deferred.promise.then(function(data){ var x2js = new X2JS(); var coordJson = x2js.xml_str2json(data); this.set('coordinator.name', coordJson["coordinator-app"]._name); - }.bind(this)).catch(function(){ + this.set('coordNameFetchingInProgress', false); + }.bind(this)).catch(function(data){ + console.error(data); this.set('coordinatorName', null); + this.set('errorMsg', 'There is some problem while fetching coordinator name.'); + this.set('data', data); + this.set('coordNameFetchingInProgress', false); }.bind(this)); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/934f3f18/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs index 2d374a5..39ab06d 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs @@ -103,10 +103,10 @@ {{#field-error model=this field='bundle.coordinators' showErrorMessage=showErrorMessage}}{{/field-error}} {{#if coordinatorCreateMode}} - {{#bundle-coord-config coordinator=currentCoordinator openTab="openTab" openFileBrowser="openFileBrowser" add="addCoordinator" cancel="cancelCoordinatorOperation" createMode=coordinatorCreateMode}}{{/bundle-coord-config}} + {{#bundle-coord-config coordinator=currentCoordinator openTab="openTab" openFileBrowser="openFileBrowser" add="addCoordinator" cancel="cancelCoordinatorOperation" createMode=coordinatorCreateMode errorMsg=errorMsg data=data appendFileName=appendFileName}}{{/bundle-coord-config}} {{/if}} {{#if coordinatorEditMode}} - {{#bundle-coord-config coordinator=currentCoordinator openTab="openTab" openFileBrowser="openFileBrowser" update="updateCoordinator" cancel="cancelCoordinatorOperation" editMode=coordinatorEditMode}}{{/bundle-coord-config}} + {{#bundle-coord-config coordinator=currentCoordinator openTab="openTab" openFileBrowser="openFileBrowser" update="updateCoordinator" cancel="cancelCoordinatorOperation" editMode=coordinatorEditMode errorMsg=errorMsg data=data appendFileName=appendFileName}}{{/bundle-coord-config}} {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/934f3f18/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-coord-config.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-coord-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-coord-config.hbs index 56cacd6..1ac1414 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-coord-config.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-coord-config.hbs @@ -23,9 +23,12 @@ {{input type="text" class="form-control" name="appPath" focus-out="showCoordinatorName" value=coordinator.appPath placeholder="Path of the coordinator file"}} - + + {{#if coordNameFetchingInProgress}} + {{spin-spinner lines=8 length=5 width=3 radius=5 top=16 left=440}} + {{/if}} {{#field-error model=this field='coordinator.appPath' showErrorMessage=showErrorMessage}}{{/field-error}}