mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 19:53:53 -06:00
FIX: case sensitive unconditional add of exact match in user search
This commit is contained in:
parent
a5fc51a967
commit
556ef4cfbd
@ -4,6 +4,10 @@ import userSearch from 'discourse/lib/user-search';
|
||||
import { findRawTemplate } from 'discourse/lib/raw-templates';
|
||||
|
||||
export default TextField.extend({
|
||||
autocorrect: false,
|
||||
autocapitalize: false,
|
||||
name: 'user-selector',
|
||||
|
||||
@observes('usernames')
|
||||
_update() {
|
||||
if (this.get('canReceiveUpdates') === 'true')
|
||||
|
@ -61,7 +61,7 @@ function organizeResults(r, options) {
|
||||
|
||||
if (r.groups) {
|
||||
r.groups.every(function(g) {
|
||||
if (results.length > limit && options.term !== g.name) return false;
|
||||
if (results.length > limit && options.term.toLowerCase() !== g.name.toLowerCase()) return false;
|
||||
if (exclude.indexOf(g.name) === -1) {
|
||||
groups.push(g);
|
||||
results.push(g);
|
||||
|
@ -145,7 +145,7 @@ class Autospec::Manager
|
||||
# try focus tag
|
||||
if failed_specs.length > 0
|
||||
filename,_ = failed_specs[0].split(":")
|
||||
if filename && File.exist?(filename)
|
||||
if filename && File.exist?(filename) && !File.directory?(filename)
|
||||
spec = File.read(filename)
|
||||
start,_ = spec.split(/\S*#focus\S*$/)
|
||||
if start.length < spec.length
|
||||
|
@ -58,7 +58,7 @@ module("lib:user-search", {
|
||||
});
|
||||
|
||||
test("it places groups unconditionally for exact match", function() {
|
||||
return userSearch({term: 'team'}).then((results)=>{
|
||||
return userSearch({term: 'Team'}).then((results)=>{
|
||||
equal(results[results.length-1]["name"], "team");
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user