ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [2/3] ambari git commit: AMBARI-11496. No tooltip shown when configuration is in Edit (escape hatch) mode (alexantonenko)
Date Thu, 28 May 2015 18:16:13 GMT
AMBARI-11496. No tooltip shown when configuration is in Edit (escape hatch) mode (alexantonenko)


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

Branch: refs/heads/trunk
Commit: be7aa40d5fbf267359c29209e66bc03fd184ad12
Parents: 7dfcbe2
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Thu May 28 21:14:55 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Thu May 28 21:14:55 2015 +0300

----------------------------------------------------------------------
 .../service/configs/widget_popover_support.js    |  7 +++++--
 .../common/configs/widgets/controls.hbs          |  2 +-
 .../configs/widgets/plain_config_text_field.js   | 19 ++++++++++++-------
 3 files changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/be7aa40d/ambari-web/app/mixins/main/service/configs/widget_popover_support.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/service/configs/widget_popover_support.js b/ambari-web/app/mixins/main/service/configs/widget_popover_support.js
index ca381ce..3974465 100644
--- a/ambari-web/app/mixins/main/service/configs/widget_popover_support.js
+++ b/ambari-web/app/mixins/main/service/configs/widget_popover_support.js
@@ -48,8 +48,11 @@ App.WidgetPopoverSupport = Em.Mixin.create({
 
   initPopover: function () {
     if (this.get('isPopoverEnabled') !== false) {
-      var leftPopoverTemplate = '<div class="popover config-widget-left-popover"><div
class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div
class="popover-content"><p></p></div></div></div>';
-      App.popover(this.$('.original-widget'), {
+      var leftPopoverTemplate = '<div class="popover config-widget-left-popover"><div
class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div
class="popover-content"><p></p></div></div></div>',
+        isWidget = !Em.isEmpty(this.$('.original-widget')),
+        popoverSelector = isWidget ? this.$('.original-widget') : this.$('.input-append');
+
+      App.popover(popoverSelector, {
         template: this.get('popoverPlacement') == 'left'? leftPopoverTemplate : undefined,
         title: Em.I18n.t('installer.controls.serviceConfigPopover.title').format(
           this.get('configLabel'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/be7aa40d/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 4e634cb..da8e1ac 100644
--- a/ambari-web/app/templates/common/configs/widgets/controls.hbs
+++ b/ambari-web/app/templates/common/configs/widgets/controls.hbs
@@ -19,7 +19,7 @@
 
 {{#if view.supportSwitchToCheckBox}}
   <div {{bindAttr class="view.config.showAsTextBox::hide :left :widget-config-raw"}}>
-    {{view App.PlainConfigTextField serviceConfigBinding="view.config" disabledBinding="view.canNotEdit"}}
+    {{view App.PlainConfigTextField sectionBinding="view.section" subSectionBinding="view.subSection"
configBinding="view.config" disabledBinding="view.canNotEdit"}}
   </div>
 {{/if}}
 {{#if view.canEdit}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/be7aa40d/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js b/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
index 05f3584..e49bba0 100644
--- a/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
+++ b/ambari-web/app/views/common/configs/widgets/plain_config_text_field.js
@@ -24,15 +24,19 @@
 var App = require('app');
 require('views/common/controls_view');
 
-App.PlainConfigTextField = Ember.View.extend(App.SupportsDependentConfigs, {
+App.PlainConfigTextField = Ember.View.extend(App.SupportsDependentConfigs, App.WidgetPopoverSupport,
{
   templateName: require('templates/common/configs/widgets/plain_config_text_field'),
-  valueBinding: 'serviceConfig.value',
+  valueBinding: 'config.value',
   classNames: ['widget-config-plain-text-field'],
-  placeholderBinding: 'serviceConfig.savedValue',
+  placeholderBinding: 'config.savedValue',
+
+  configLabel: function() {
+    return this.get('config.stackConfigProperty.displayName') || this.get('config.displayName')
|| this.get('config.name');
+  }.property('config.name', 'config.displayName'),
 
   unit: function() {
-    return Em.getWithDefault(this, 'serviceConfig.stackConfigProperty.valueAttributes.unit',
false);
-  }.property('serviceConfig.stackConfigProperty.valueAttributes.unit'),
+    return Em.getWithDefault(this, 'config.stackConfigProperty.valueAttributes.unit', false);
+  }.property('config.stackConfigProperty.valueAttributes.unit'),
 
   displayUnit: function() {
     var unit = this.get('unit');
@@ -43,7 +47,7 @@ App.PlainConfigTextField = Ember.View.extend(App.SupportsDependentConfigs,
{
   }.property('unit'),
 
   focusOut: function () {
-    this.sendRequestRorDependentConfigs(this.get('serviceConfig'));
+    this.sendRequestRorDependentConfigs(this.get('config'));
   },
 
   insertNewline: function() {
@@ -52,7 +56,8 @@ App.PlainConfigTextField = Ember.View.extend(App.SupportsDependentConfigs,
{
 
   didInsertElement: function() {
     this._super();
-    this.set('serviceConfig.displayType', Em.getWithDefault(this, 'serviceConfig.stackConfigProperty.valueAttributes.type',
'string'));
+    this.initPopover();
+    this.set('config.displayType', Em.getWithDefault(this, 'config.stackConfigProperty.valueAttributes.type',
'string'));
   }
 
 });


Mime
View raw message