ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject [38/52] [abbrv] ambari git commit: AMBARI-21669 Provide ability on the UI to parse include/exclude files host task name. (atkach)
Date Wed, 09 Aug 2017 15:55:51 GMT
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/branch-feature-AMBARI-14714
Commit: 153e03aa024ffa483ad2f905151f1dcb8911b520
Parents: 58827ad
Author: Andrii Tkach <atkach@apache.org>
Authored: Mon Aug 7 16:24:50 2017 +0300
Committer: Andrii Tkach <atkach@apache.org>
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 = [


Mime
View raw message