ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-17701. Deleting the selected llap queue breaks the UI. (jaimin)
Date Thu, 14 Jul 2016 19:14:19 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9d695478d -> 1f628f8c3


AMBARI-17701. Deleting the selected llap queue breaks the UI. (jaimin)


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

Branch: refs/heads/trunk
Commit: 1f628f8c3ca4854ad947560261f1ba8b0d97c0ca
Parents: 9d69547
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Thu Jul 14 12:16:29 2016 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Thu Jul 14 12:17:56 2016 -0700

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  1 +
 .../configs/widgets/combo_config_widget_view.js | 30 ++++++++++++++++++--
 2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1f628f8c/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index e7a6df7..ea53262 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -3070,6 +3070,7 @@ Em.I18n.translations = {
   'config.group.description.default': 'New configuration group created on {0}',
 
   'config.infoMessage.wrong.value.for.widget': 'Configuration value cannot be converted into
UI control value',
+  'config.infoMessage.wrong.value.for.combobox.widget': '"{0}" is not available in the list
of valid values',
   'config.warnMessage.outOfBoundaries.greater': 'Values greater than {0} are not recommended',
   'config.warnMessage.outOfBoundaries.less': 'Values smaller than {0} are not recommended',
   'config.warnMessage.llap_queue_capacity.max': 'LLAP will consume entire Yarn queue',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f628f8c/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
index ce9de0e..b579cae 100644
--- a/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/combo_config_widget_view.js
@@ -96,7 +96,7 @@ App.ComboConfigWidgetView = App.ConfigWidgetView.extend({
     if (this.isValueCompatibleWithWidget()) {
       return this.get('content.valuesList').findProperty('configValue', value).get('widgetValue');
     }
-    return null;
+    return value;
   },
 
   /**
@@ -165,10 +165,36 @@ App.ComboConfigWidgetView = App.ConfigWidgetView.extend({
      this.setConfigValue({ context: this.get('config.value') });
    },
 
+  /**
+   * switch display of config to widget
+   * @override
+   * @method textBoxToWidget
+   */
+  textBoxToWidget: function() {
+    this.setValue(this.get('config.value'));
+    this.set("config.showAsTextBox", false);
+  },
+
+  /**
+   * Returns <code>true</code> if raw value can be used by widget or widget view
is activated.
+   * @override
+   * @returns {Boolean}
+   */
+  isWidgetViewAllowed: true,
+
+  /**
+   * Initialize widget with incompatible value as textbox
+   * @override
+   */
+  initIncompatibleWidgetAsTextBox : function() {
+    this.isValueCompatibleWithWidget();
+  },
+
+
   isValueCompatibleWithWidget: function() {
     var res = this._super() && this.get('content.valuesList').someProperty('configValue',
this.get('config.value'));
     if (!res) {
-      this.updateWarningsForCompatibilityWithWidget(Em.I18n.t('config.infoMessage.wrong.value.for.widget'));
+      this.updateWarningsForCompatibilityWithWidget(Em.I18n.t('config.infoMessage.wrong.value.for.combobox.widget').format(this.get('config.value')));
       return false;
     }
     this.updateWarningsForCompatibilityWithWidget('');


Mime
View raw message