Repository: ambari Updated Branches: refs/heads/branch-2.1 0beae63e2 -> a77004034
AMBARI-14060. Hive View Settings don't persist properly. (Pallav Kulshreshtha via Jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a7700403 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a7700403 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a7700403 Branch: refs/heads/branch-2.1 Commit: a77004034142e876c85a557e6f2e839d5533ca0f Parents: 0beae63 Author: Jaimin Jetly <[email protected]> Authored: Sun Nov 29 20:18:24 2015 -0800 Committer: Jaimin Jetly <[email protected]> Committed: Sun Nov 29 20:18:54 2015 -0800 ---------------------------------------------------------------------- .../hive-web/app/components/typeahead-widget.js | 15 ++++++++++++++ .../ui/hive-web/app/templates/settings.hbs | 21 +++++++++++--------- .../ui/hive-web/app/utils/constants.js | 5 +++++ 3 files changed, 32 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a7700403/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js index f9233a0..5bc0bda 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/typeahead-widget.js @@ -31,6 +31,21 @@ export default Typeahead.extend(Ember.I18n.TranslateableProperties, { if($('.selectize-input')) {$('.selectize-input').addClass( "mozBoxSizeFix" );} + var currentKeyName = this.get('safeValue'); + var currentTypehead = $('*[keyname="' + currentKeyName +'"]'); + + if (currentTypehead.find($('.selectize-input')).has('.item').length == 0) { + currentTypehead.find($('.selectize-input')).addClass("has-options has-items "); + + currentTypehead.find($('.selectized option:selected')).val(currentKeyName); + currentTypehead.find($('.selectized option:selected')).text(currentKeyName); + + currentTypehead.find($('.selectize-input input')).css({'opacity': 0 , 'position': 'absolute' , 'left': '-10000px'}); + + var itemHtml = '<div data-value=' + currentKeyName + ' class=item >' + currentKeyName + '</div>'; + currentTypehead.find($('.selectize-input')).append( itemHtml ); + + } }, removeExcludedObserver: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/a7700403/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/settings.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/settings.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/settings.hbs index 55b659a..c320a1c 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/settings.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/settings.hbs @@ -33,17 +33,20 @@ <div class="form-group"> <div class="input-group"> <div class="input-group-addon"> - {{typeahead-widget - options=predefinedSettings - excluded=excluded - optionLabelPath="name" - optionValuePath="name" - selection=setting.key - create="addKey" - }} + + <div {{bind-attr keyname="setting.key.name"}} class="typeahead-container"> + {{typeahead-widget + options=predefinedSettings + excluded=excluded + optionLabelPath="name" + optionValuePath="name" + selection=setting.key + safeValue = setting.key.name + create="addKey" + }} + </div> </div> <div {{bind-attr class=":input-group-addon setting.valid::has-error"}}> - <div class="setting-input-value"> {{#if setting.key.values}} {{select-widget items=setting.key.values http://git-wip-us.apache.org/repos/asf/ambari/blob/a7700403/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js index 199677d..4b9899a 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/utils/constants.js @@ -90,6 +90,7 @@ export default Ember.Object.create({ name: 'hive.tez.container.size', validate: helpers.regexes.digits }, + { name: 'hive.prewarm.enabled', values: helpers.validationValues.bool @@ -111,6 +112,10 @@ export default Ember.Object.create({ values: helpers.validationValues.bool }, { + name: 'hive.auto.convert.join', + values: helpers.validationValues.bool + }, + { name: 'tez.am.resource.memory.mb', validate: helpers.regexes.digits },
