Repository: ambari
Updated Branches:
  refs/heads/trunk 628812a16 -> 4ae8d6459


AMBARI-11057. Configs: Misc config widget control fixes (Richard Zang via 
srimanth)


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

Branch: refs/heads/trunk
Commit: 4ae8d645999450b47e75663cb1212ce60d3eda6d
Parents: 628812a
Author: Srimanth Gunturi <sgunt...@hortonworks.com>
Authored: Tue May 12 15:22:01 2015 -0700
Committer: Srimanth Gunturi <sgunt...@hortonworks.com>
Committed: Tue May 12 15:22:01 2015 -0700

----------------------------------------------------------------------
 .../configs/objects/service_config_property.js      |  1 +
 .../common/configs/config_history_flow.hbs          |  2 +-
 .../common/configs/service_version_box.hbs          |  2 +-
 .../common/configs/widgets/combo_config_widget.hbs  |  2 +-
 .../templates/common/configs/widgets/controls.hbs   |  6 +++---
 .../common/configs/widgets/list_config_widget.hbs   |  2 +-
 .../common/configs/widgets/slider_config_widget.hbs |  2 +-
 .../configs/widgets/time_interval_spinner.hbs       |  2 +-
 .../common/configs/widgets/toggle_config_widget.hbs |  2 +-
 .../common/configs/widgets/config_widget_view.js    | 16 +++++-----------
 10 files changed, 16 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae8d645/ambari-web/app/models/configs/objects/service_config_property.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js 
b/ambari-web/app/models/configs/objects/service_config_property.js
index eeec1b1..c04b85b 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -73,6 +73,7 @@ App.ServiceConfigProperty = Em.Object.extend({
   hasInitialValue: false, //if true then property value is defined and saved 
to server
   isHiddenByFilter: false, //if true then hide this property (filtered out)
   rowStyleClass: null, // CSS-Class to be applied on the row showing this 
config
+  showAsTextBox: false,
 
   /**
    * value that is returned from server as recommended

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae8d645/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs 
b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index a1f610d..7a2d50b 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -102,7 +102,7 @@
                 <span class="label 
label-info">{{view.displayedServiceVersion.versionText}}</span>
               {{/if}}
               {{#if view.displayedServiceVersion.isCurrent}}
-                  <span class="label-current label label-success icon-ok" 
data-toggle="tooltip" title="Current"></span>
+                  <span class="label-current label label-success icon-ok" 
data-toggle="tooltip" {{translateAttr title="common.current"}}></span>
               {{/if}}
               {{#if view.displayedServiceVersion.author}}
                 
<strong>{{view.displayedServiceVersion.author}}</strong>&nbsp;{{t 
dashboard.configHistory.info-bar.authoredOn}}&nbsp;<strong>{{view.displayedServiceVersion.createdDate}}</strong>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae8d645/ambari-web/app/templates/common/configs/service_version_box.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_version_box.hbs 
b/ambari-web/app/templates/common/configs/service_version_box.hbs
index 354ed8d..f2c769e 100644
--- a/ambari-web/app/templates/common/configs/service_version_box.hbs
+++ b/ambari-web/app/templates/common/configs/service_version_box.hbs
@@ -28,7 +28,7 @@
       <div class="stack-label">{{serviceVersion.stackVersion}}</div>
       {{#if serviceVersion.isCurrent}}
         <div class="current-label">
-          <span class="label label-success label-current icon-ok" 
data-toggle="tooltip" title="Current">
+          <span class="label label-success label-current icon-ok" 
data-toggle="tooltip" {{translateAttr title="common.current"}}>
           </span>
         </div>
       {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae8d645/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 eed3559..e29ebe8 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.showAsTextBox:hide"}}>
+<div {{bindAttr class=":pull-left view.isOriginalSCP:original-widget 
view.disabled:disabled view.config.showAsTextBox: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/4ae8d645/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 a80fdee..1e0ea6c 100644
--- a/ambari-web/app/templates/common/configs/widgets/controls.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/controls.hbs
@@ -18,7 +18,7 @@
 
 {{#if view.canEdit}}
   {{#if view.supportSwitchToCheckBox}}
-    <div {{bindAttr class="view.showAsTextBox::hide :left 
:widget-config-raw"}}>
+    <div {{bindAttr class="view.config.showAsTextBox::hide :left 
:widget-config-raw"}}>
       {{view App.PlainConfigTextField serviceConfigBinding="view.config"}}
     </div>
   {{/if}}
@@ -37,7 +37,7 @@
         {{#if view.isWidgetViewAllowed}}
           <a href="#"
             data-toggle="tooltip" {{translateAttr 
data-original-title="common.edit"}}
-            {{bindAttr class=":icon-pencil :widget-action 
:widget-action-switch-view view.isHover::hide view.showAsTextBox::active"}}
+            {{bindAttr class=":icon-pencil :widget-action 
:widget-action-switch-view view.isHover::hide 
view.config.showAsTextBox::active"}}
             {{action "toggleWidgetView" target="view"}}>
           </a>
         {{else}}
@@ -103,7 +103,7 @@
     {{#if controller.selectedConfigGroup.isDefault}}
       <span class="label label-info">{{t 
dashboard.configHistory.table.version.prefix}}{{controller.selectedVersion}}</span>
       {{#if controller.isCurrentSelected}}
-        <span class="label label-success icon-ok label-current" 
data-toggle="tooltip" title="Current"></span>
+        <span class="label label-success icon-ok label-current" 
data-toggle="tooltip" {{translateAttr title="common.current"}}></span>
       {{/if}}
     {{else}}
       <span class="label label-info">{{t common.default}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4ae8d645/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 5b0cb05..c2a2175 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 :widget-config :list-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.showAsTextBox:hide"}} 
data-toggle="dropdown">{{view.displayVal}} <span class="caret"></span></a>
+    <a {{bindAttr class=":btn :dropdown-toggle 
view.config.isEditable::disabled view.config.showAsTextBox: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/4ae8d645/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 a1892de..1bdea83 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.showAsTextBox:hide :ui-slider-wrapper"}}>
+  <div {{bindAttr class="view.isOriginalSCP:original-widget 
view.config.showAsTextBox: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/4ae8d645/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 b03a5c7..6714292 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.showAsTextBox:hide"}}>
+<div {{bindAttr class=":pull-left view.isOriginalSCP:original-widget 
view.config.showAsTextBox: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/4ae8d645/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 f9f7fd7..a2a6e0d 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.showAsTextBox:hide 
view.isOriginalSCP:original-widget"}}>
+<div {{bindAttr class=":pull-left view.config.showAsTextBox: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/4ae8d645/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 d94c477..0b3939c 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
@@ -78,12 +78,6 @@ App.ConfigWidgetView = 
Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
   subSection: null,
 
   /**
-   * true if text filed is shown
-   * @type {boolean}
-   */
-  showAsTextBox: false,
-
-  /**
    * Determines if user can switch custom widget-view to the input-field
    * @type {boolean}
    */
@@ -330,7 +324,7 @@ App.ConfigWidgetView = 
Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
     if (!this.get('isWidgetViewAllowed')) {
       return false;
     }
-    if (this.get('showAsTextBox')) {
+    if (this.get('config.showAsTextBox')) {
       this.textBoxToWidget();
     } else {
       this.widgetToTextBox();
@@ -342,7 +336,7 @@ App.ConfigWidgetView = 
Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
    * @method widgetToTextBox
    */
   widgetToTextBox: function() {
-    this.set("showAsTextBox", true);
+    this.set("config.showAsTextBox", true);
   },
 
   /**
@@ -352,7 +346,7 @@ App.ConfigWidgetView = 
Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
   textBoxToWidget: function() {
     if (this.isValueCompatibleWithWidget()) {
       this.setValue(this.get('config.value'));
-      this.set("showAsTextBox", false);
+      this.set("config.showAsTextBox", false);
     }
   },
 
@@ -369,11 +363,11 @@ App.ConfigWidgetView = 
Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
    * @returns {Boolean}
    */
   isWidgetViewAllowed: function() {
-    if (!this.get('showAsTextBox')) {
+    if (!this.get('config.showAsTextBox')) {
       return true;
     }
     return this.isValueCompatibleWithWidget();
-  }.property('config.value', 'showAsTextBox'),
+  }.property('config.value', 'config.showAsTextBox'),
 
   /**
    * @method setRecommendedValue

Reply via email to