Repository: ambari Updated Branches: refs/heads/trunk 1ac5c58e6 -> 955cfce2c
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/955cfce2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/955cfce2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/955cfce2 Branch: refs/heads/trunk Commit: 955cfce2c37f282f4600ab6b86f31c865ef4f883 Parents: 1ac5c58 Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Sun Jun 28 21:01:23 2015 +0300 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Sun Jun 28 21:01:23 2015 +0300 ---------------------------------------------------------------------- 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/955cfce2/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/955cfce2/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 () {