mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -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';
|
import { findRawTemplate } from 'discourse/lib/raw-templates';
|
||||||
|
|
||||||
export default TextField.extend({
|
export default TextField.extend({
|
||||||
|
autocorrect: false,
|
||||||
|
autocapitalize: false,
|
||||||
|
name: 'user-selector',
|
||||||
|
|
||||||
@observes('usernames')
|
@observes('usernames')
|
||||||
_update() {
|
_update() {
|
||||||
if (this.get('canReceiveUpdates') === 'true')
|
if (this.get('canReceiveUpdates') === 'true')
|
||||||
|
@ -61,7 +61,7 @@ function organizeResults(r, options) {
|
|||||||
|
|
||||||
if (r.groups) {
|
if (r.groups) {
|
||||||
r.groups.every(function(g) {
|
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) {
|
if (exclude.indexOf(g.name) === -1) {
|
||||||
groups.push(g);
|
groups.push(g);
|
||||||
results.push(g);
|
results.push(g);
|
||||||
|
@ -145,7 +145,7 @@ class Autospec::Manager
|
|||||||
# try focus tag
|
# try focus tag
|
||||||
if failed_specs.length > 0
|
if failed_specs.length > 0
|
||||||
filename,_ = failed_specs[0].split(":")
|
filename,_ = failed_specs[0].split(":")
|
||||||
if filename && File.exist?(filename)
|
if filename && File.exist?(filename) && !File.directory?(filename)
|
||||||
spec = File.read(filename)
|
spec = File.read(filename)
|
||||||
start,_ = spec.split(/\S*#focus\S*$/)
|
start,_ = spec.split(/\S*#focus\S*$/)
|
||||||
if start.length < spec.length
|
if start.length < spec.length
|
||||||
|
@ -58,7 +58,7 @@ module("lib:user-search", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("it places groups unconditionally for exact match", function() {
|
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");
|
equal(results[results.length-1]["name"], "team");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user