Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 57317adaa -> 1c5fc7ccc


AMBARI-12193. Step2 installer. Popup with hosts contains duplicates 
(onechiporenko)


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

Branch: refs/heads/branch-2.1
Commit: 1c5fc7ccc44e8bd15c00413985ef902dff41755b
Parents: 57317ad
Author: Oleg Nechiporenko <onechipore...@apache.org>
Authored: Sun Jun 28 21:01:23 2015 +0300
Committer: Oleg Nechiporenko <onechipore...@apache.org>
Committed: Wed Dec 2 13:33:36 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard/step2_controller.js |  2 +-
 ambari-web/test/controllers/wizard/step2_test.js      | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1c5fc7cc/ambari-web/app/controllers/wizard/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step2_controller.js 
b/ambari-web/app/controllers/wizard/step2_controller.js
index 3daf977..3b51761 100644
--- a/ambari-web/app/controllers/wizard/step2_controller.js
+++ b/ambari-web/app/controllers/wizard/step2_controller.js
@@ -345,7 +345,7 @@ App.WizardStep2Controller = Em.Controller.extend({
         hostNames.push(a);
       }
     });
-    this.set('hostNameArr', hostNames);
+    this.set('hostNameArr', hostNames.uniq());
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/1c5fc7cc/ambari-web/test/controllers/wizard/step2_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step2_test.js 
b/ambari-web/test/controllers/wizard/step2_test.js
index e244f85..d62b247 100644
--- a/ambari-web/test/controllers/wizard/step2_test.js
+++ b/ambari-web/test/controllers/wizard/step2_test.js
@@ -422,7 +422,16 @@ describe('App.WizardStep2Controller', function () {
         }
       }
       expect(result).to.equal(true);
-    })
+    });
+
+    it('should skip duplicates', function () {
+      var controller = App.WizardStep2Controller.create({
+        hostNameArr: ['host[1-3]', 'host2']
+      });
+      controller.parseHostNamesAsPatternExpression();
+      expect(controller.get('hostNameArr')).to.eql(['host1', 'host2', 
'host3']);
+    });
+
   });
 
   describe('#proceedNext()', function () {

Reply via email to