Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D539177C3 for ; Tue, 30 Sep 2014 20:48:08 +0000 (UTC) Received: (qmail 21699 invoked by uid 500); 30 Sep 2014 20:48:08 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 21620 invoked by uid 500); 30 Sep 2014 20:48:08 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 21097 invoked by uid 99); 30 Sep 2014 20:48:07 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2014 20:48:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A9986A0C3D0; Tue, 30 Sep 2014 20:48:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jonathanhurley@apache.org To: commits@ambari.apache.org Date: Tue, 30 Sep 2014 20:48:32 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/35] git commit: AMBARI-7558. Slider View: 'Enable Metrics' should not be checked by default. (onechiporenko) AMBARI-7558. Slider View: 'Enable Metrics' should not be checked by default. (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5518104c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5518104c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5518104c Branch: refs/heads/branch-alerts-dev Commit: 5518104c102e0ea9ad01bcff9161638f83146f12 Parents: d8f4b1e Author: Oleg Nechiporenko Authored: Tue Sep 30 17:40:02 2014 +0300 Committer: Oleg Nechiporenko Committed: Tue Sep 30 17:40:02 2014 +0300 ---------------------------------------------------------------------- .../createAppWizard/step3_controller.js | 20 +++++++++----------- .../src/main/resources/ui/app/helpers/ajax.js | 2 +- .../ui/app/views/common/config_set_view.js | 7 ++++--- 3 files changed, 14 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/5518104c/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js index ef28d66..ac635cb 100644 --- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js +++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js @@ -155,10 +155,9 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({ delete configSet.configNames; if (configSet.name === 'ganglia_metrics') { configSet.trigger.readOnly = (!App.get('gangliaClusters') || App.get('gangliaClusters').length === 0); - configSet.trigger.value = (App.get('gangliaClusters') && App.get('gangliaClusters').length > 0); } configSet.trigger = App.ConfigProperty.create(configSet.trigger); - this.initConfigSetDependecies(configSet); + this.initConfigSetDependencies(configSet); configs.unshift(configSet); } }, this); @@ -167,16 +166,16 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({ }.observes('newAppConfigs'), /** - * initialize dependecies map for config set by name + * initialize dependencies map for config set by name * configSet map changed by reference * * @param {object} configSet - * @method initConfigSetDependecies + * @method initConfigSetDependencies */ - initConfigSetDependecies: function (configSet) { + initConfigSetDependencies: function (configSet) { configSet.dependencies.forEach(function (item) { item.map = Em.get(item.name); - }) + }); }, /** @@ -193,10 +192,10 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({ * @method validateConfigs */ validateConfigs: function () { - var self = this; - var result = true; - var configs = this.addConfigSetProperties(this.get('configs')); - var configsObject = {}; + var self = this, + result = true, + configs = this.addConfigSetProperties(this.get('configs')), + configsObject = {}; try { configs.forEach(function (item) { @@ -216,7 +215,6 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({ * @return {Array} */ addConfigSetProperties: function (configs) { - var configSets = configs.filterBy('isSet'); var newConfigs = []; configs.filterBy('isSet').forEach(function (item) { if (item.trigger.value) { http://git-wip-us.apache.org/repos/asf/ambari/blob/5518104c/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js index 8447d3c..dfee360 100644 --- a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js +++ b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js @@ -131,7 +131,7 @@ var urls = { 'createNewApp': { real: 'apps', - mock: '', + mock: '/data/resource/empty_json.json', headers: { "Content-Type": "text/plain; charset=utf-8" }, http://git-wip-us.apache.org/repos/asf/ambari/blob/5518104c/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js b/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js index b421129..388b9ff 100644 --- a/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js +++ b/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js @@ -39,14 +39,15 @@ App.ConfigSetView = Ember.View.extend({ }.property('configSet.trigger.value'), /** - * observe change of config values to resolve their dependecies + * observe change of config values to resolve their dependencies + * @method changeConfigValues */ changeConfigValues: function () { var configs = this.get('configs'); - var dependecies = this.get('configSet.dependencies'); + var dependencies = this.get('configSet.dependencies'); if (configs.length > 0) { - dependecies.forEach(function (item) { + dependencies.forEach(function (item) { var origin = configs.findBy('name', item.origin); var dependent = configs.findBy('name', item.dependent); item.mapFunction(origin, dependent);