Repository: ambari Updated Branches: refs/heads/branch-2.4 3433bbfcf -> 4aece9f10
AMBARI-17001. Additional OS are added with empty Base URL (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4aece9f1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4aece9f1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4aece9f1 Branch: refs/heads/branch-2.4 Commit: 4aece9f1059f10f1efa8d8f37ec0a4648163cd6e Parents: 3433bbf Author: Oleg Nechiporenko <[email protected]> Authored: Thu Jun 2 12:28:34 2016 +0300 Committer: Oleg Nechiporenko <[email protected]> Committed: Thu Jun 2 13:14:36 2016 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/wizard/step1_controller.js | 2 +- ambari-web/app/mappers/stack_mapper.js | 3 ++- ambari-web/app/models/repository.js | 3 ++- ambari-web/test/models/repository_test.js | 2 +- ambari-web/test/utils/configs/config_initializer_test.js | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4aece9f1/ambari-web/app/controllers/wizard/step1_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step1_controller.js b/ambari-web/app/controllers/wizard/step1_controller.js index 5ff34bd..3af28de 100644 --- a/ambari-web/app/controllers/wizard/step1_controller.js +++ b/ambari-web/app/controllers/wizard/step1_controller.js @@ -246,7 +246,7 @@ App.WizardStep1Controller = Em.Controller.extend({ */ doRestoreDefaultValue: function (event) { var repo = event.contexts[0]; - repo.set('baseUrl', repo.get('latestBaseUrl')); + repo.set('baseUrl', repo.get('baseUrlInit')); }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/4aece9f1/ambari-web/app/mappers/stack_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/stack_mapper.js b/ambari-web/app/mappers/stack_mapper.js index e421e2e..b1a5faf 100644 --- a/ambari-web/app/mappers/stack_mapper.js +++ b/ambari-web/app/mappers/stack_mapper.js @@ -75,6 +75,7 @@ App.stackMapper = App.QuickDataMapper.create({ configRepository: { id: 'id', base_url: 'base_url', + base_url_init: 'base_url', default_base_url: 'default_base_url', latest_base_url: 'latest_base_url', mirrors_list: 'mirrors_list', @@ -118,7 +119,7 @@ App.stackMapper = App.QuickDataMapper.create({ operatingSystems.id = stack.id + "-" + operatingSystems.os_type; operatingSystems.stack_id = operatingSystems.stack_name + "-" + operatingSystems.stack_version; operatingSystems.repositories = repositoriesArray; - operatingSystems.is_selected = (ops.isSelected == true || ops.isSelected == undefined); + operatingSystems.is_selected = ops.isSelected == true || ops.isSelected == undefined; resultOS.push(this.parseIt(operatingSystems, this.get('configOS'))); operatingSystemsArray.pushObject(operatingSystems); http://git-wip-us.apache.org/repos/asf/ambari/blob/4aece9f1/ambari-web/app/models/repository.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/repository.js b/ambari-web/app/models/repository.js index 37ef0b3..6fc5731 100644 --- a/ambari-web/app/models/repository.js +++ b/ambari-web/app/models/repository.js @@ -25,6 +25,7 @@ App.Repository = DS.Model.extend({ repoId: DS.attr('string'), osType: DS.attr('string'), baseUrl: DS.attr('string'), + baseUrlInit: DS.attr('string'), defaultBaseUrl: DS.attr('string'), latestBaseUrl: DS.attr('string'), repoName: DS.attr('string'), @@ -53,7 +54,7 @@ App.Repository = DS.Model.extend({ return this.get('repoName').contains('UTILS'); }.property('repoName'), - undo: Em.computed.notEqualProperties('baseUrl', 'latestBaseUrl'), + undo: Em.computed.notEqualProperties('baseUrl', 'baseUrlInit'), notEmpty: Em.computed.notEqual('baseUrl', ''), http://git-wip-us.apache.org/repos/asf/ambari/blob/4aece9f1/ambari-web/test/models/repository_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/models/repository_test.js b/ambari-web/test/models/repository_test.js index d3a2875..02416d0 100644 --- a/ambari-web/test/models/repository_test.js +++ b/ambari-web/test/models/repository_test.js @@ -32,7 +32,7 @@ describe('App.Repository', function () { model = getModel(); }); - App.TestAliases.testAsComputedNotEqualProperties(getModel(), 'undo', 'baseUrl', 'latestBaseUrl'); + App.TestAliases.testAsComputedNotEqualProperties(getModel(), 'undo', 'baseUrl', 'baseUrlInit'); App.TestAliases.testAsComputedAlias(getModel(), 'isSelected', 'operatingSystem.isSelected', 'boolean'); http://git-wip-us.apache.org/repos/asf/ambari/blob/4aece9f1/ambari-web/test/utils/configs/config_initializer_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/configs/config_initializer_test.js b/ambari-web/test/utils/configs/config_initializer_test.js index 7eeea6d..48eae23 100644 --- a/ambari-web/test/utils/configs/config_initializer_test.js +++ b/ambari-web/test/utils/configs/config_initializer_test.js @@ -1220,7 +1220,7 @@ describe('App.ConfigInitializer', function () { }); describe('#_filterMountPoint', function() { - var cases = [ + [ { mPoint: { mountpoint: '/' @@ -1366,7 +1366,7 @@ describe('App.ConfigInitializer', function () { ].forEach(function(test) { it('mount point "{0}" should be {1}'.format(test.mPoint.mountpoint, test.e ? 'valid' : 'invalid'), function() { var fFn = App.ConfigInitializer._filterMountPoint(test.localDB); - expect(fFn(test.mPoint)).to.be.eql(test.e); + expect(fFn(test.mPoint)).to.be.equal(test.e); }); }); });
