ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-11638. Configs: Different values in warnings tooltip when config is in raw mode. (Richard Zang via yusaku)
Date Mon, 08 Jun 2015 04:42:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 9d038ca94 -> 60f1b553b


AMBARI-11638. Configs: Different values in warnings tooltip when config is in raw mode. (Richard
Zang via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/60f1b553
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/60f1b553
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/60f1b553

Branch: refs/heads/branch-2.1
Commit: 60f1b553bcfd361aa011f5ae9111ba1f7561c8c6
Parents: 9d038ca
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Sun Jun 7 21:41:26 2015 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Sun Jun 7 21:42:21 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/views/common/configs/widgets/config_widget_view.js  | 2 +-
 .../app/views/common/configs/widgets/slider_config_widget_view.js  | 2 ++
 .../views/common/configs/widgets/slider_config_widget_view_test.js | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/60f1b553/ambari-web/app/views/common/configs/widgets/config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/config_widget_view.js b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
index 86792be..4cf30b4 100644
--- a/ambari-web/app/views/common/configs/widgets/config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
@@ -432,8 +432,8 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
   updateWarningsForCompatibilityWithWidget: function (message) {
     this.setProperties({
       warnMessage: message,
+      'config.warnMessage': message,
       issueMessage: message,
-      iconClass: message ? 'warning' : '',
       configLabelClass: message ? 'text-warning' : ''
     });
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/60f1b553/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
index 46a0657..6f6b9e3 100644
--- a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
@@ -525,6 +525,7 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
       if (this.get('config.stackConfigProperty.valueAttributes.minimum')) {
         var min = this.get('parseFunction')(this.get('config.stackConfigProperty.valueAttributes.minimum'));
         if (configValue < min) {
+          min = this.widgetValueByConfigAttributes(min);
           this.updateWarningsForCompatibilityWithWidget(Em.I18n.t('config.warnMessage.outOfBoundaries.less').format(min
+ this.get('unitLabel')));
           return false;
         }
@@ -532,6 +533,7 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
       if (this.get('config.stackConfigProperty.valueAttributes.maximum')) {
         var max = this.get('parseFunction')(this.get('config.stackConfigProperty.valueAttributes.maximum'));
         if (configValue > max) {
+          max = this.widgetValueByConfigAttributes(max);
           this.updateWarningsForCompatibilityWithWidget(Em.I18n.t('config.warnMessage.outOfBoundaries.greater').format(max
+ this.get('unitLabel')));
           return false;
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/60f1b553/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
b/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
index 8a227ef..e4e8a7b 100644
--- a/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
+++ b/ambari-web/test/views/common/configs/widgets/slider_config_widget_view_test.js
@@ -375,7 +375,7 @@ describe('App.SliderConfigWidgetView', function () {
 
     beforeEach(function() {
       viewInt.set('config', {});
-      stackConfigProperty = App.StackConfigProperty.createRecord({name: 'p1', valueAttributes:
{minimum: 1, maximum: 10, increment_step: 4, type: 'int'}});
+      stackConfigProperty = App.StackConfigProperty.createRecord({name: 'p1', widget: { units:
[ { 'unit-name': "int"}]}, valueAttributes: {minimum: 1, maximum: 10, increment_step: 4, type:
'int'}});
       viewInt.set('config.stackConfigProperty', stackConfigProperty);
       viewInt.set('config.isValid', true);
     });


Mime
View raw message