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 C3F24200CDD for ; Mon, 7 Aug 2017 16:34:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C252416565B; Mon, 7 Aug 2017 14:34:23 +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 1592316565A for ; Mon, 7 Aug 2017 16:34:22 +0200 (CEST) Received: (qmail 75760 invoked by uid 500); 7 Aug 2017 14:34:22 -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 75751 invoked by uid 99); 7 Aug 2017 14:34:22 -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; Mon, 07 Aug 2017 14:34:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 15F97DFDDD; Mon, 7 Aug 2017 14:34:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: atkach@apache.org To: commits@ambari.apache.org Message-Id: <9ebfb7c12dc4415d91409ccb8fd8b116@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-21669 Provide ability on the UI to parse include/exclude files host task name. (atkach) Date: Mon, 7 Aug 2017 14:34:22 +0000 (UTC) archived-at: Mon, 07 Aug 2017 14:34:24 -0000 Repository: ambari Updated Branches: refs/heads/trunk 58827ad30 -> 153e03aa0 AMBARI-21669 Provide ability on the UI to parse include/exclude files host task name. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/153e03aa Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/153e03aa Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/153e03aa Branch: refs/heads/trunk Commit: 153e03aa024ffa483ad2f905151f1dcb8911b520 Parents: 58827ad Author: Andrii Tkach Authored: Mon Aug 7 16:24:50 2017 +0300 Committer: Andrii Tkach Committed: Mon Aug 7 17:24:41 2017 +0300 ---------------------------------------------------------------------- ambari-web/app/utils/helper.js | 11 ++++++++--- ambari-web/test/utils/helper_test.js | 5 +++++ 2 files changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/153e03aa/ambari-web/app/utils/helper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js index 4867c65..3bc247c 100644 --- a/ambari-web/app/utils/helper.js +++ b/ambari-web/app/utils/helper.js @@ -698,23 +698,28 @@ App.format = { var detailArr = command_detail.split(' '); var self = this; var result = ''; + var isIncludeExcludeFiles = false; //if an optional operation display name has been specified in the service metainfo.xml if (ops_display_name != null && ops_display_name.length > 0) { result = result + ' ' + ops_display_name; } else { detailArr.forEach( function(item) { // if the item has the pattern SERVICE/COMPONENT, drop the SERVICE part - if (item.contains('/')) { + if (item.contains('/') && !isIncludeExcludeFiles) { item = item.split('/')[1]; } - if (item == 'DECOMMISSION,') { + if (item === 'DECOMMISSION,') { // ignore text 'DECOMMISSION,'( command came from 'excluded/included'), here get the component name from request_inputs - item = (jQuery.parseJSON(request_inputs)) ? jQuery.parseJSON(request_inputs).slave_type : ''; + var parsedInputs = jQuery.parseJSON(request_inputs); + item = (parsedInputs) ? (parsedInputs.slave_type || '') : ''; + isIncludeExcludeFiles = (parsedInputs) ? parsedInputs.is_add_or_delete_slave_request === 'true' : false; } if (self.components[item]) { result = result + ' ' + self.components[item]; } else if (self.command[item]) { result = result + ' ' + self.command[item]; + } else if (isIncludeExcludeFiles) { + result = result + ' ' + item; } else { result = result + ' ' + self.role(item, false); } http://git-wip-us.apache.org/repos/asf/ambari/blob/153e03aa/ambari-web/test/utils/helper_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/helper_test.js b/ambari-web/test/utils/helper_test.js index 9dcbc4f..e64ee7e 100644 --- a/ambari-web/test/utils/helper_test.js +++ b/ambari-web/test/utils/helper_test.js @@ -280,6 +280,11 @@ describe('utils/helper', function() { it('should return install repo message', function() { expect(App.format.commandDetail(installRepo)).to.be.equal(Em.I18n.t('common.installRepo.task')); }); + it('should return raw text when is_add_or_delete_slave_request=true', function() { + var inputs = '{"is_add_or_delete_slave_request":"true"}'; + expect(App.format.commandDetail('DECOMMISSION, Update Include/Exclude Files', inputs)) + .to.be.equal(' Update Include/Exclude Files'); + }); }); describe('#taskStatus()', function(){ var testable = [