You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2016/03/01 15:52:48 UTC
ambari git commit: AMBARI-15244. JS Error on ASW step4 (onechiporenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 4019afa25 -> 8db1e302a
AMBARI-15244. JS Error on ASW step4 (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8db1e302
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8db1e302
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8db1e302
Branch: refs/heads/trunk
Commit: 8db1e302ac689459f58d6527f667144d10123fdf
Parents: 4019afa
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Tue Mar 1 13:13:21 2016 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Tue Mar 1 16:52:33 2016 +0200
----------------------------------------------------------------------
ambari-web/app/utils/configs/theme/theme.js | 9 +++++----
ambari-web/test/mappers/service_metrics_mapper_test.js | 4 ++--
2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/8db1e302/ambari-web/app/utils/configs/theme/theme.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/theme/theme.js b/ambari-web/app/utils/configs/theme/theme.js
index 236faa8..a7d3b68 100644
--- a/ambari-web/app/utils/configs/theme/theme.js
+++ b/ambari-web/app/utils/configs/theme/theme.js
@@ -26,14 +26,15 @@ App.configTheme = Em.Object.create({
* @param {Array} configs
*/
resolveConfigThemeConditions: function (configs) {
+ var self = this;
App.ThemeCondition.find().forEach(function (configCondition) {
var _configs = Em.A(configCondition.get('configs'));
if (configCondition.get("resource") === 'config' && _configs.length > 0) {
- var isConditionTrue = this.calculateConfigCondition(configCondition.get("if"), configs);
+ var isConditionTrue = self.calculateConfigCondition(configCondition.get("if"), configs);
var action = isConditionTrue ? configCondition.get("then") : configCondition.get("else");
if (configCondition.get('id')) {
var valueAttributes = action.property_value_attributes;
- if (valueAttributes && !Em.none(valueAttributes['visible'])) {
+ if (valueAttributes && !Em.none(valueAttributes.visible)) {
var themeResource;
if (configCondition.get('type') === 'subsection') {
themeResource = App.SubSection.find().findProperty('name', configCondition.get('name'));
@@ -52,7 +53,7 @@ App.configTheme = Em.Object.create({
// if config has already been hidden by condition with "subsection" or "subsectionTab" type
// then ignore condition of "config" type
if (configCondition.get('type') === 'config' && item.hiddenBySection) return false;
- item.hiddenBySection = !valueAttributes['visible'];
+ item.hiddenBySection = !valueAttributes.visible;
}
});
}, this);
@@ -78,7 +79,7 @@ App.configTheme = Em.Object.create({
var condition = _condition.trim();
if (condition === '&&' || condition === '||') {
allConditionResult.push(_condition);
- } else {
+ } else {
var splitIfCondition = condition.split('===');
var ifCondition = splitIfCondition[0];
var result = splitIfCondition[1] || "true";
http://git-wip-us.apache.org/repos/asf/ambari/blob/8db1e302/ambari-web/test/mappers/service_metrics_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/service_metrics_mapper_test.js b/ambari-web/test/mappers/service_metrics_mapper_test.js
index 4e0f216..04dbce0 100644
--- a/ambari-web/test/mappers/service_metrics_mapper_test.js
+++ b/ambari-web/test/mappers/service_metrics_mapper_test.js
@@ -112,8 +112,8 @@ describe('App.serviceMetricsMapper', function () {
tests.forEach(function (test) {
it(test.message, function () {
- services[0].components[0].host_components[0].metrics.dfs.FSNamesystem['HAState'] = test.haStateForNn1;
- services[0].components[0].host_components[1].metrics.dfs.FSNamesystem['HAState'] = test.haStateForNn2;
+ services[0].components[0].host_components[0].metrics.dfs.FSNamesystem.HAState = test.haStateForNn1;
+ services[0].components[0].host_components[1].metrics.dfs.FSNamesystem.HAState = test.haStateForNn2;
App.serviceMetricsMapper.computeAdditionalRelations(hostComponents, services);
expect(hostComponents[0].display_name_advanced).to.equal(test.expectedNameForNn1);
expect(hostComponents[1].display_name_advanced).to.equal(test.expectedNameForNn2);