Browse Source

AMBARI-11295 Enhanced Dashbaord: No metrics widget shown after quit editing a newly created widget using metric from other service. (atkach)

Andrii Tkach 10 years ago
parent
commit
0cd4aaa15c

+ 1 - 0
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);
     }
   }

+ 2 - 2
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;

+ 1 - 1
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');
         }
       }
     });

+ 1 - 1
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;