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:41:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4cbd1dc27 -> aac067e52


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/aac067e5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aac067e5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aac067e5

Branch: refs/heads/trunk
Commit: aac067e52c30e3e79356d5d8d24da86a53cbb1aa
Parents: 4cbd1dc
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:41:26 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/aac067e5/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/aac067e5/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/aac067e5/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