Repository: ambari Updated Branches: refs/heads/trunk b900d03a9 -> d036fc017
AMBARI-15037. When saving a SCRIPT edit, it loses the script path (Joe Wang via rzang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d036fc01 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d036fc01 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d036fc01 Branch: refs/heads/trunk Commit: d036fc0170521a46b4b8977ef5d2d71f3daacfb7 Parents: b900d03 Author: Richard Zang <[email protected]> Authored: Tue Feb 16 11:09:09 2016 -0800 Committer: Richard Zang <[email protected]> Committed: Tue Feb 16 11:09:09 2016 -0800 ---------------------------------------------------------------------- .../app/controllers/main/alerts/definition_configs_controller.js | 4 ++-- .../main/alerts/definitions_configs_controller_test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d036fc01/ambari-web/app/controllers/main/alerts/definition_configs_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js index ec5680c..130434f 100644 --- a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js +++ b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js @@ -542,10 +542,10 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({ // `source.parameters` is an array and should be updated separately from other configs if (this.get('content.parameters.length')) { - propertiesToUpdate['AlertDefinition/source/parameters'] = this.get('content.rawSourceData.parameters'); + propertiesToUpdate['AlertDefinition/source'] = this.get('content.rawSourceData'); var parameterConfigs = this.get('configs').filterProperty('name', 'parameter'); parameterConfigs.forEach(function (parameter) { - propertiesToUpdate['AlertDefinition/source/parameters'].findProperty('name', parameter.get('apiProperty')).value = parameter.get('apiFormattedValue'); + propertiesToUpdate['AlertDefinition/source'].parameters.findProperty('name', parameter.get('apiProperty')).value = parameter.get('apiFormattedValue'); }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/d036fc01/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js b/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js index c957efd..f3cf28c 100644 --- a/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js +++ b/ambari-web/test/controllers/main/alerts/definitions_configs_controller_test.js @@ -537,8 +537,8 @@ describe('App.MainAlertDefinitionConfigsController', function () { }); it('should update parameters', function () { - expect(this.result['AlertDefinition/source/parameters']).to.have.property('length').equal(4); - expect(this.result['AlertDefinition/source/parameters'].mapProperty('value')).to.be.eql(['v11', 'v21', 'v31', 'v41']); + expect(this.result['AlertDefinition/source'].parameters).to.have.property('length').equal(4); + expect(this.result['AlertDefinition/source'].parameters.mapProperty('value')).to.be.eql(['v11', 'v21', 'v31', 'v41']); }); });
