SOLR-14359: Admin UI collection/core drop-downs had wrong placeholder text (#1400)

This commit is contained in:
Jan Høydahl 2020-04-03 23:16:11 +02:00 committed by GitHub
parent 9b29c2a420
commit 234e78350d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 4 deletions

View File

@ -103,6 +103,8 @@ Bug Fixes
* SOLR-14356: PeerSync should not fail with SocketTimeoutException from hanging nodes (Cao Manh Dat)
* SOLR-14359: Admin UI collection/core drop-downs had wrong placeholder text. Fixed by upgrading angular-chosen (janhoy)
Other Changes
---------------------
* SOLR-14197: SolrResourceLoader: marked many methods as deprecated, and in some cases rerouted exiting logic to avoid

View File

@ -180,7 +180,7 @@ limitations under the License.
<div ng-show="!http401">
<div id="collection-selector" ng-show="isCloudEnabled">
<div id="has-collections" ng-show="collections.length!=0">
<select data-placeholder="Collection Selector"
<select data-placeholder-text-single="Collection Selector"
ng-model="currentCollection"
chosen
ng-change="showCollection(currentCollection)"
@ -206,7 +206,7 @@ limitations under the License.
</div>
<div id="core-selector">
<div id="has-cores" ng-show="cores.length!=0">
<select data-placeholder="Core Selector"
<select data-placeholder-text-single="Core Selector"
ng-model="currentCore"
chosen
ng-change="showCore(currentCore)"

View File

@ -1,3 +1,20 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
The MIT License
Copyright (c) 2013 Localytics http://www.localytics.com
@ -20,8 +37,8 @@ THE SOFTWARE.
/**
* angular-chosen-localytics - Angular Chosen directive is an AngularJS Directive that brings the Chosen jQuery in a Angular way
* @version v1.3.0
* @version v1.9.2
* @link http://github.com/leocaseiro/angular-chosen
* @license MIT
*/
(function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};angular.module("localytics.directives",[]),angular.module("localytics.directives").directive("chosen",["$timeout",function(t){var n,r,i,s;return r=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,n=["persistentCreateOption","createOptionText","createOption","skipNoResults","noResultsText","allowSingleDeselect","disableSearchThreshold","disableSearch","enableSplitWordSearch","inheritSelectClasses","maxSelectedOptions","placeholderTextMultiple","placeholderTextSingle","searchContains","singleBackstrokeDelete","displayDisabledOptions","displaySelectedOptions","width","includeGroupLabelInSelected","maxShownResults"],s=function(e){return e.replace(/[A-Z]/g,function(e){return"_"+e.toLowerCase()})},i=function(e){var t;if(angular.isArray(e))return 0===e.length;if(angular.isObject(e))for(t in e)if(e.hasOwnProperty(t))return!1;return!0},{restrict:"A",require:"?ngModel",priority:1,link:function(a,l,o,d){var u,c,f,h,p,g,b,v,S,y,w;return a.disabledValuesHistory=a.disabledValuesHistory?a.disabledValuesHistory:[],l=$(l),l.addClass("localytics-chosen"),p=a.$eval(o.chosen)||{},angular.forEach(o,function(t,r){return e.call(n,r)>=0?o.$observe(r,function(e){return p[s(r)]="{{"===String(l.attr(o.$attr[r])).slice(0,2)?e:a.$eval(e),S()}):void 0}),b=function(){return l.addClass("loading").attr("disabled",!0).trigger("chosen:updated")},v=function(){return l.removeClass("loading"),angular.isDefined(o.disabled)?l.attr("disabled",o.disabled):l.attr("disabled",!1),l.trigger("chosen:updated")},u=null,c=!1,f=function(){var e;return u?l.trigger("chosen:updated"):(t(function(){u=l.chosen(p).data("chosen")}),angular.isObject(u)?e=u.default_text:void 0)},S=function(){return c?l.attr("data-placeholder",u.results_none_found).attr("disabled",!0):l.removeAttr("data-placeholder"),l.trigger("chosen:updated")},d?(g=d.$render,d.$render=function(){return g(),f()},l.on("chosen:hiding_dropdown",function(){return a.$apply(function(){return d.$setTouched()})}),o.multiple&&(w=function(){return d.$viewValue},a.$watch(w,d.$render,!0))):f(),o.$observe("disabled",function(){return l.trigger("chosen:updated")}),o.ngOptions&&d?(h=o.ngOptions.match(r),y=h[7],a.$watchCollection(y,function(e,n){var r;return r=t(function(){return angular.isUndefined(e)?b():(c=i(e),v(),S())})}),a.$on("$destroy",function(e){return"undefined"!=typeof timer&&null!==timer?t.cancel(timer):void 0})):void 0}}}])}).call(this);
(function(){var e,n=[].indexOf||function(e){for(var n=0,r=this.length;n<r;n++)if(n in this&&this[n]===e)return n;return-1};angular.module("localytics.directives",[]),e=angular.module("localytics.directives"),e.provider("chosen",function(){var e;return e={},{setOption:function(n){angular.extend(e,n)},$get:function(){return e}}}),e.directive("chosen",["chosen","$timeout","$parse",function(e,r,t){var i,a,s,l;return a=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,i=["allowSingleDeselect","disableSearch","disableSearchThreshold","enableSplitWordSearch","inheritSelectClasses","maxSelectedOptions","noResultsText","placeholderTextMultiple","placeholderTextSingle","searchContains","groupSearch","singleBackstrokeDelete","width","displayDisabledOptions","displaySelectedOptions","includeGroupLabelInSelected","maxShownResults","caseSensitiveSearch","hideResultsOnSelect","rtl"],l=function(e){return e.replace(/[A-Z]/g,function(e){return"_"+e.toLowerCase()})},s=function(e){var n;if(angular.isArray(e))return 0===e.length;if(angular.isObject(e))for(n in e)if(e.hasOwnProperty(n))return!1;return!0},{restrict:"A",require:["select","?ngModel"],priority:1,link:function(u,o,c,d){var f,h,g,p,S,b,v,y,w,O,m,x,C,V,A,T;if(u.disabledValuesHistory=u.disabledValuesHistory?u.disabledValuesHistory:[],o=$(o),o.addClass("localytics-chosen"),w=d[0],y=d[1],v=c.ngOptions&&c.ngOptions.match(a),A=v&&t(v[7]),V=v&&v[8],g=u.$eval(c.chosen)||{},O=angular.copy(e),angular.extend(O,g),angular.forEach(c,function(e,r){if(n.call(i,r)>=0)return c.$observe(r,function(e){var n;return n=String(o.attr(c.$attr[r])).slice(0,2),O[l(r)]="{{"===n?e:u.$eval(e),p()})}),m=function(){return o.addClass("loading").attr("disabled",!0).trigger("chosen:updated")},x=function(){return o.removeClass("loading"),angular.isDefined(c.disabled)?o.attr("disabled",c.disabled):o.attr("disabled",!1),o.trigger("chosen:updated")},h=null,S=!1,b=function(){if(!h)return u.$evalAsync(function(){if(!h)return h=o.chosen(O).data("chosen")})},p=function(){return h&&S&&o.attr("disabled",!0),o.trigger("chosen:updated")},y?(f=y.$render,y.$render=function(){var e,n,r,t;b();try{r=w.readValue()}catch(i){}f();try{n=w.readValue()}catch(i){}if(e=!V&&!c.multiple,t=e?r!==n:!angular.equals(r,n))return o.trigger("chosen:updated")},o.on("chosen:hiding_dropdown",function(){return u.$applyAsync(function(){return y.$setTouched()})}),c.multiple&&(T=function(){return y.$viewValue},u.$watch(T,y.$render,!0))):b(),c.$observe("disabled",function(){return o.trigger("chosen:updated")}),c.ngOptions&&y)return C=null,u.$watchCollection(A,function(e,n){return C=r(function(){return angular.isUndefined(e)?m():(S=s(e),x(),p())})}),u.$on("$destroy",function(e){if(null!=C)return r.cancel(C)})}}}])}).call(this);