ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: Revert "AMBARI-11484. Configs: when doing override, it's hard to find config override (onechiporenko)"
Date Thu, 28 May 2015 14:54:18 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 1f1742b1d -> aba28e05e


Revert "AMBARI-11484. Configs: when doing override, it's hard to find config override (onechiporenko)"

This reverts commit 1f1742b1d7f2eb4f4e5bfd1b64c565fcdcf18553.


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

Branch: refs/heads/trunk
Commit: aba28e05e975adedeb6f76a4e88b209d9b6f7397
Parents: 1f1742b
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Thu May 28 17:52:11 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Thu May 28 17:52:11 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/styles/widgets.less              | 20 ------------
 .../configs/widgets/config_widget_view.js       |  2 +-
 .../widgets/slider_config_widget_view.js        | 34 ++++----------------
 3 files changed, 8 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/aba28e05/ambari-web/app/styles/widgets.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/widgets.less b/ambari-web/app/styles/widgets.less
index 897c6e5..efaf7b7 100644
--- a/ambari-web/app/styles/widgets.less
+++ b/ambari-web/app/styles/widgets.less
@@ -20,8 +20,6 @@
 @undo-btn-margin: 10px;
 @controls-min-width: 55px;
 @combo-widget-width: 100px;
-@overriden-property-bg-color: rgba(211, 237, 247, 0.39);
-@overriden-property-widget-padding: 8px;
 @green: #6ebd45;
 @slider-light-grey: #e6e6e6;
 @slider-dark-grey: #aaaaaa;
@@ -115,24 +113,6 @@
     margin-right: 0;
     padding-left: 20px;
   }
-  // background hack instead of increasing padding,
-  // because we have lack of space for widget container.
-  &.overridden-property {
-    background-color: @overriden-property-bg-color;
-    position: relative;
-    &:before {
-      height: 100%;
-      width: @overriden-property-widget-padding;
-      content: '';
-      position: absolute;
-      top: 0;
-      display: block;
-      background-color: @overriden-property-bg-color;
-    }
-    &:before {
-      left: -@overriden-property-widget-padding;
-    }
-  }
 }
 
 .directory-textarea-wrapper {

http://git-wip-us.apache.org/repos/asf/ambari/blob/aba28e05/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 5d1dcab..92dc8c1 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
@@ -117,7 +117,7 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
    */
   isComparisonBinding: 'config.isComparison',
 
-  classNameBindings:['isComparison:compare-mode', 'config.overrides.length:overridden-property'],
+  classNameBindings:['isComparison:compare-mode'],
 
   issueMessage: '',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/aba28e05/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 7732026..d8434b5 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
@@ -27,8 +27,6 @@ var validator = require('utils/validator');
  */
 App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
 
-  classNames: ['widget-config'],
-
   templateName: require('templates/common/configs/widgets/slider_config_widget'),
 
   supportSwitchToCheckBox: true,
@@ -276,7 +274,7 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
       config = this.get('config'),
       valueAttributes = config.get('stackConfigProperty.valueAttributes'),
       parseFunction = this.get('parseFunction'),
-      ticks = [this.valueForTick(this.get('minMirrorValue'), true)],
+      ticks = [this.get('minMirrorValue')],
       ticksLabels = [],
       recommendedValue = this.valueForTick(+this.get('widgetRecommendedValue')),
       range = this.get('maxMirrorValue') - this.get('minMirrorValue'),
@@ -289,24 +287,15 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
     for (var i = 1; i <= 3; i++) {
       var val = this.get('minMirrorValue') + range * (i / (isSmallInt ? 3 : 4));
       // if value's type is float, ticks may be float too
-      ticks.push(this.valueForTick(val, false));
+      ticks.push(this.valueForTick(val));
     }
 
-    ticks.push(this.valueForTick(this.get('maxMirrorValue'), false));
+    ticks.push(this.get('maxMirrorValue'));
     ticks = ticks.uniq();
     ticks.forEach(function (tick, index, items) {
       ticksLabels.push((items.length < 5 || index % 2 === 0 || items.length - 1 == index)
? tick + ' ' + self.get('unitLabel') : '');
     });
 
-    if(!isSmallInt) {
-      ticks.push(this.get('maxMirrorValue'));
-    }
-    var ticksLength = ticks.length;
-    ticks = ticks.uniq();
-    if (ticksLength === ticks.length) {
-      ticksLabels.insertAt(1, '');
-    }
-
     // default marker should be added only if recommendedValue is in range [min, max]
     if (recommendedValue <= this.get('maxMirrorValue') && recommendedValue >=
this.get('minMirrorValue') && recommendedValue != '') {
       // process additional tick for default value if it not defined in previous computation
@@ -333,8 +322,7 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
         ticks.insertAt(recommendedValueMirroredId, this.valueForTick((ticks[recommendedValueMirroredId]
+ ticks[recommendedValueMirroredId - 1]) / 2));
         // get new index for default value
         recommendedValueId = ticks.indexOf(recommendedValue);
-      }
-      else {
+      } else {
         recommendedValueId = ticks.indexOf(recommendedValue);
       }
     }
@@ -343,7 +331,7 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
      * Slider some times change config value while being created,
      * this may happens when slider recreating couple times during small period.
      * To cover this situation need to reset config value after slider initializing
-     * @type {String}
+     * @type {Sting}
      */
     var correctConfigValue = this.get('config.value');
 
@@ -406,19 +394,11 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
    *
    * @method valueForTick
    * @param {Number} val
-   * @param {Boolean} [toGreater]
    * @private
    * @returns {Number}
    */
-  valueForTick: function(val, toGreater) {
-    toGreater = toGreater || false;
-    var func = toGreater ? Math.round : Math.floor;
-    if (this.get('unitType') === 'int') {
-      return func(val);
-    }
-    var mirrorStep = this.get('mirrorStep');
-    var r = func(val / mirrorStep);
-    return parseFloat((r * mirrorStep).toFixed(3));
+  valueForTick: function(val) {
+    return this.get('unitType') === 'int' ? Math.round(val) : parseFloat(val.toFixed(3));
   },
 
   /**


Mime
View raw message