Repository: ambari Updated Branches: refs/heads/trunk 391b45e93 -> ea0f60b60
AMBARI-15809 Web Client Does Not Expose Parameters For All Alert Types (zhewang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ea0f60b6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ea0f60b6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ea0f60b6 Branch: refs/heads/trunk Commit: ea0f60b606960dc1efd7db4c5e6cf3879d948e60 Parents: 391b45e Author: Zhe (Joe) Wang <zhew...@apache.org> Authored: Tue Apr 12 13:43:28 2016 -0700 Committer: Zhe (Joe) Wang <zhew...@apache.org> Committed: Tue Apr 12 13:43:44 2016 -0700 ---------------------------------------------------------------------- .../alerts/definition_configs_controller.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ea0f60b6/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 d5b27c5..82263f7 100644 --- a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js +++ b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js @@ -417,6 +417,26 @@ App.MainAlertDefinitionConfigsController = Em.Controller.extend({ }) ]); + var mixins = { + STRING: App.AlertConfigProperties.Parameters.StringMixin, + NUMERIC: App.AlertConfigProperties.Parameters.NumericMixin, + PERCENT: App.AlertConfigProperties.Parameters.PercentageMixin + }; + alertDefinition.get('parameters').forEach(function (parameter) { + var mixin = mixins[parameter.get('type')] || {}; // validation depends on parameter-type + result.push(App.AlertConfigProperties.Parameter.create(mixin, { + value: isWizard ? '' : parameter.get('value'), + apiProperty: parameter.get('name'), + description: parameter.get('description'), + label: isWizard ? '' : parameter.get('displayName'), + threshold: isWizard ? '' : parameter.get('threshold'), + units: isWizard ? '' : parameter.get('units'), + type: isWizard ? '' : parameter.get('type'), + hidden: parameter.get('visibility') === "HIDDEN", + readonly: parameter.get('visibility') === "READ_ONLY" + })); + }); + return result; },