AMBARI-11295 Enhanced Dashbaord: No metrics widget shown after quit editing a newly created widget using metric from other service. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0cd4aaa1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0cd4aaa1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0cd4aaa1 Branch: refs/heads/trunk Commit: 0cd4aaa15cce3ddf264df1a8f9790bda4e0ed01f Parents: 4b528d1 Author: Andrii Tkach <[email protected]> Authored: Thu May 21 14:03:14 2015 +0300 Committer: Andrii Tkach <[email protected]> Committed: Thu May 21 14:52:49 2015 +0300 ---------------------------------------------------------------------- ambari-web/app/mappers/widget_mapper.js | 1 + ambari-web/app/mixins/common/widgets/widget_mixin.js | 4 ++-- ambari-web/app/views/common/widget/graph_widget_view.js | 2 +- ambari-web/app/views/common/widget/heatmap_widget_view.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0cd4aaa1/ambari-web/app/mappers/widget_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/widget_mapper.js b/ambari-web/app/mappers/widget_mapper.js index 0250b2b..0991d4f 100644 --- a/ambari-web/app/mappers/widget_mapper.js +++ b/ambari-web/app/mappers/widget_mapper.js @@ -51,6 +51,7 @@ App.widgetMapper = App.QuickDataMapper.create({ result.push(this.parseIt(item.WidgetInfo, this.config)); }, this); + App.store.commit(); App.store.loadMany(this.get('model'), result); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/0cd4aaa1/ambari-web/app/mixins/common/widgets/widget_mixin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js b/ambari-web/app/mixins/common/widgets/widget_mixin.js index 7f9834d..5f91be5 100644 --- a/ambari-web/app/mixins/common/widgets/widget_mixin.js +++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js @@ -445,7 +445,7 @@ App.WidgetMixin = Ember.Mixin.create({ return metrics.findProperty('name', match).data; } else { validExpression = false; - console.error('Metrics with name "' + match + '" not found to compute expression'); + console.warn('Metrics with name "' + match + '" not found to compute expression'); } } else { return match; @@ -455,7 +455,7 @@ App.WidgetMixin = Ember.Mixin.create({ //check for correct math expression if (!(validExpression && this.get('MATH_EXPRESSION_REGEX').test(beforeCompute))) { validExpression = false; - console.error('Value for metric is not correct mathematical expression: ' + beforeCompute); + console.warn('Value for metric is not correct mathematical expression: ' + beforeCompute); } result['${' + _expression + '}'] = (validExpression) ? Number(window.eval(beforeCompute)).toString() : value; http://git-wip-us.apache.org/repos/asf/ambari/blob/0cd4aaa1/ambari-web/app/views/common/widget/graph_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/widget/graph_widget_view.js b/ambari-web/app/views/common/widget/graph_widget_view.js index 856d0e8..b81e019 100644 --- a/ambari-web/app/views/common/widget/graph_widget_view.js +++ b/ambari-web/app/views/common/widget/graph_widget_view.js @@ -125,7 +125,7 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, { dataLength = (dataLinks[match].length > dataLength) ? dataLinks[match].length : dataLength; } else { validExpression = false; - console.error('Metrics with name "' + match + '" not found to compute expression'); + console.warn('Metrics with name "' + match + '" not found to compute expression'); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/0cd4aaa1/ambari-web/app/views/common/widget/heatmap_widget_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/widget/heatmap_widget_view.js b/ambari-web/app/views/common/widget/heatmap_widget_view.js index 4153f30..c89275a 100644 --- a/ambari-web/app/views/common/widget/heatmap_widget_view.js +++ b/ambari-web/app/views/common/widget/heatmap_widget_view.js @@ -92,7 +92,7 @@ App.HeatmapWidgetView = Em.View.extend(App.WidgetMixin, { return _metric.data; } else { validExpression = false; - console.error('Metrics with name "' + match + '" not found to compute expression'); + console.warn('Metrics with name "' + match + '" not found to compute expression'); } } else { return match;
