ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-12142 Strange behavior when comparing config versions of custom config group. (ababiichuk)
Date Thu, 25 Jun 2015 14:29:13 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 25ee93a67 -> 85d89c699


AMBARI-12142 Strange behavior when comparing config versions of custom config group. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 85d89c699cb357ca940d9d724b9ea7126d37175d
Parents: 25ee93a
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Wed Jun 24 18:00:59 2015 +0300
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Thu Jun 25 17:27:11 2015 +0300

----------------------------------------------------------------------
 .../common/configs/service_config_category.hbs  | 13 ++++++-----
 .../configs/widgets/combo_config_widget.hbs     |  2 +-
 .../common/configs/widgets/controls.hbs         | 22 ++++++++++++-------
 .../configs/widgets/directory_config_widget.hbs |  2 +-
 .../configs/widgets/list_config_widget.hbs      |  2 +-
 .../configs/widgets/slider_config_widget.hbs    |  2 +-
 .../configs/widgets/time_interval_spinner.hbs   |  2 +-
 .../configs/widgets/toggle_config_widget.hbs    |  2 +-
 .../configs/service_configs_by_category_view.js |  8 -------
 .../configs/widgets/config_widget_view.js       | 23 ++++++++++++++++++++
 10 files changed, 50 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/service_config_category.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs
index c6b4063..47d3a2e 100644
--- a/ambari-web/app/templates/common/configs/service_config_category.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_category.hbs
@@ -112,14 +112,15 @@
                 <span class="help-inline">{{errorMessage}}</span>
                 <span class="help-inline">{{warnMessage}}</span>
               </div>
-              {{#if this.isOverridden}}
-                {{view App.ServiceConfigView.SCPOverriddenRowsView
-                serviceConfigPropertyBinding="this"
-                isDefaultGroupSelectedBinding="controller.selectedConfigGroup.isDefault"
-                }}
-              {{/if}}
               {{#if this.isComparison}}
                 {{view App.ServiceConfigView.SCPComparisonRowsView serviceConfigPropertyBinding="this"}}
+              {{else}}
+                {{#if this.isOverridden}}
+                  {{view App.ServiceConfigView.SCPOverriddenRowsView
+                  serviceConfigPropertyBinding="this"
+                  isDefaultGroupSelectedBinding="controller.selectedConfigGroup.isDefault"
+                  }}
+                {{/if}}
               {{/if}}
             </div>
           </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/widgets/combo_config_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/widgets/combo_config_widget.hbs b/ambari-web/app/templates/common/configs/widgets/combo_config_widget.hbs
index e29ebe8..f3d03da 100644
--- a/ambari-web/app/templates/common/configs/widgets/combo_config_widget.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/combo_config_widget.hbs
@@ -16,7 +16,7 @@
 * limitations under the License.
 }}
 {{template "templates/common/configs/widgets/config_label"}}
-<div {{bindAttr class=":pull-left view.isOriginalSCP:original-widget view.disabled:disabled
view.config.showAsTextBox:hide"}}>
+<div {{bindAttr class=":pull-left view.isOriginalSCP:original-widget view.disabled:disabled
view.doNotShowWidget:hide"}}>
   <div class="input-append">
     <div class="dropdown btn-group">
       {{view Em.TextField valueBinding="view.content.value" disabled="disabled"}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/widgets/controls.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/widgets/controls.hbs b/ambari-web/app/templates/common/configs/widgets/controls.hbs
index 8ee33ea..389006c 100644
--- a/ambari-web/app/templates/common/configs/widgets/controls.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/controls.hbs
@@ -16,11 +16,15 @@
 * limitations under the License.
 }}
 
-
+<div {{bindAttr class="view.isPropertyUndefined::hide :left :widget-config-raw"}}>
+  <i>{{t common.property.undefined}}</i>
+</div>
 {{#if view.supportSwitchToCheckBox}}
-  <div {{bindAttr class="view.config.showAsTextBox::hide :left :widget-config-raw"}}>
-    {{view App.PlainConfigTextField sectionBinding="view.section" subSectionBinding="view.subSection"
configBinding="view.config" disabledBinding="view.canNotEdit"}}
-  </div>
+  {{#unless view.isPropertyUndefined}}
+    <div {{bindAttr class="view.config.showAsTextBox::hide :left :widget-config-raw"}}>
+      {{view App.PlainConfigTextField sectionBinding="view.section" subSectionBinding="view.subSection"
configBinding="view.config" disabledBinding="view.canNotEdit"}}
+    </div>
+  {{/unless}}
 {{/if}}
 {{#if view.canEdit}}
   <div class="widget-config-controls">
@@ -128,10 +132,12 @@
 
 
 {{#if view.isOriginalSCP}}
-  {{view App.ConfigWidgetOverrideView
-  serviceConfigPropertyBinding="view.config"
-  isDefaultGroupSelectedBinding="controller.selectedConfigGroup.isDefault"
-  }}
+  {{#unless view.config.hasCompareDiffs}}
+    {{view App.ConfigWidgetOverrideView
+    serviceConfigPropertyBinding="view.config"
+    isDefaultGroupSelectedBinding="controller.selectedConfigGroup.isDefault"
+    }}
+  {{/unless}}
 {{/if}}
 
 {{#if view.isComparison}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/widgets/directory_config_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/widgets/directory_config_widget.hbs b/ambari-web/app/templates/common/configs/widgets/directory_config_widget.hbs
index 8799273..6c96af4 100644
--- a/ambari-web/app/templates/common/configs/widgets/directory_config_widget.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/directory_config_widget.hbs
@@ -18,7 +18,7 @@
 
 <div {{bindAttr class="view.isOriginalSCP:original-widget"}}>
   {{template "templates/common/configs/widgets/config_label"}}
-   <div class="directory-textarea-wrapper">
+   <div  {{bindAttr class=":directory-textarea-wrapper view.doNotShowWidget:hide"}}>
      {{view view.configView}}
    </div>
    <div class="right">

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/widgets/list_config_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/widgets/list_config_widget.hbs b/ambari-web/app/templates/common/configs/widgets/list_config_widget.hbs
index c53ebc8..439250a 100644
--- a/ambari-web/app/templates/common/configs/widgets/list_config_widget.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/list_config_widget.hbs
@@ -19,7 +19,7 @@
 <div {{bindAttr class="view.config.isHiddenByFilter:hide view.isOriginalSCP:original-widget"}}>
   {{template "templates/common/configs/widgets/config_label"}}
   <div class="pull-left btn-group">
-    <a {{bindAttr class=":btn :dropdown-toggle view.config.isEditable::disabled view.config.showAsTextBox:hide"}}
data-toggle="dropdown">{{view.displayVal}} <span class="caret"></span></a>
+    <a {{bindAttr class=":btn :dropdown-toggle view.config.isEditable::disabled view.doNotShowWidget:hide"}}
data-toggle="dropdown">{{view.displayVal}} <span class="caret"></span></a>
     <ul class="dropdown-menu">
       {{#each option in view.options}}
         <li>

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/widgets/slider_config_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/widgets/slider_config_widget.hbs b/ambari-web/app/templates/common/configs/widgets/slider_config_widget.hbs
index 1bdea83..58e3c91 100644
--- a/ambari-web/app/templates/common/configs/widgets/slider_config_widget.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/slider_config_widget.hbs
@@ -18,7 +18,7 @@
 
 <div class="widget-config slider-widget">
   {{template "templates/common/configs/widgets/config_label"}}
-  <div {{bindAttr class="view.isOriginalSCP:original-widget view.config.showAsTextBox:hide
:ui-slider-wrapper"}}>
+  <div {{bindAttr class="view.isOriginalSCP:original-widget view.doNotShowWidget:hide
:ui-slider-wrapper"}}>
     <div {{bindAttr class=":pull-left :ui-slider-wrapper-inner"}}>{{view Ember.TextField
valueBinding="view.config.value" class="input-mini slider-input"}}</div>
   </div>
   {{template "templates/common/configs/widgets/controls"}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/widgets/time_interval_spinner.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/widgets/time_interval_spinner.hbs b/ambari-web/app/templates/common/configs/widgets/time_interval_spinner.hbs
index 6714292..43e8f66 100644
--- a/ambari-web/app/templates/common/configs/widgets/time_interval_spinner.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/time_interval_spinner.hbs
@@ -17,7 +17,7 @@
 }}
 
 {{template "templates/common/configs/widgets/config_label"}}
-<div {{bindAttr class=":pull-left view.isOriginalSCP:original-widget view.config.showAsTextBox:hide"}}>
+<div {{bindAttr class=":pull-left view.isOriginalSCP:original-widget view.doNotShowWidget:hide"}}>
   {{#each spinnerContent in view.content}}
     {{view App.SpinnerInputView contentBinding="spinnerContent" disabledBinding="view.disabled"}}
   {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/templates/common/configs/widgets/toggle_config_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/widgets/toggle_config_widget.hbs b/ambari-web/app/templates/common/configs/widgets/toggle_config_widget.hbs
index a2a6e0d..9464441 100644
--- a/ambari-web/app/templates/common/configs/widgets/toggle_config_widget.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/toggle_config_widget.hbs
@@ -17,7 +17,7 @@
 }}
 
 {{template "templates/common/configs/widgets/config_label"}}
-<div {{bindAttr class=":pull-left view.config.showAsTextBox:hide view.isOriginalSCP:original-widget"}}>
+<div {{bindAttr class=":pull-left view.doNotShowWidget:hide view.isOriginalSCP:original-widget"}}>
   {{view Ember.Checkbox checkedBinding="view.switcherValue"}}
 </div>
 {{template "templates/common/configs/widgets/controls"}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/ambari-web/app/views/common/configs/service_configs_by_category_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_configs_by_category_view.js b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
index a318fd1..c564359 100644
--- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js
+++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
@@ -328,14 +328,6 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri
     });
   },
 
-  willDestroyElement: function () {
-    if (this.get('parentView.controller.name') == 'mainServiceInfoConfigsController') {
-      this.get('categoryConfigsAll').forEach(function (item) {
-        item.set('isVisible', false);
-      });
-    }
-  },
-
   /**
    * @returns {string}
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/85d89c69/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 5fcf777..83f8ca0 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
@@ -59,6 +59,24 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
   configLabelClass: '',
 
   /**
+   * defines if widget should be shown
+   * if not, text-field with config value or label "Undefined" should be shown
+   * @type {boolean}
+   */
+  doNotShowWidget: function() {
+    return this.get('isPropertyUndefined') || this.get('config.showAsTextBox');
+  }.property('isPropertyUndefined', 'config.showAsTextBox'),
+
+  /**
+   * defines if property in not defined in selected version
+   * in this case "Undefined" should be shown instead of widget
+   * @type {boolean}
+   */
+  isPropertyUndefined: function() {
+    return this.get('config.value') === "Undefined";
+  }.property('config.value'),
+
+  /**
    * Tab where current widget placed
    * Bound in the template
    * @type {App.Tab}
@@ -151,11 +169,13 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs,
App.WidgetPo
       this.errorLevelObserver();
       this.addObserver('issuedConfig.warnMessage', this, this.errorLevelObserver);
       this.addObserver('issuedConfig.errorMessage', this, this.errorLevelObserver);
+      this.addObserver('parentView.isPropertyUndefined', this, this.errorLevelObserver);
     },
 
     willDestroyElement: function() {
       this.removeObserver('issuedConfig.warnMessage', this, this.errorLevelObserver);
       this.removeObserver('issuedConfig.errorMessage', this, this.errorLevelObserver);
+      this.removeObserver('parentView.isPropertyUndefined', this, this.errorLevelObserver);
     },
 
     /**
@@ -164,6 +184,9 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
      */
     errorLevelObserver: function() {
       var messageLevel = this.get('issuedConfig.errorMessage') ? 'ERROR': this.get('issuedConfig.warnMessage')
? 'WARN' : 'NONE';
+      if (this.get('parentView.isPropertyUndefined')) {
+        messageLevel = 'NONE';
+      }
       var issue = {
         ERROR: {
           iconClass: '',


Mime
View raw message