Bug 1490967 - Fix filtering with uppercase email address (#4032)

This commit is contained in:
Cameron Dawson 2018-09-14 13:08:52 -07:00 коммит произвёл GitHub
Родитель c251ab9439
Коммит d19f0a791c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -78,5 +78,18 @@ describe('FilterModel', () => {
searchStr: ['linux', 'x64', 'debug', 'build-linux64-base-toolchains/debug', '(bb)'],
});
});
it('should preserve the case in email addresses', () => {
location.hash = '?repo=mozilla-inbound&author=VYV03354@nifty.ne.jp';
const urlParams = FilterModel.getUrlParamsWithDefaults();
expect(urlParams).toEqual({
repo: ['mozilla-inbound'],
resultStatus: ['testfailed', 'busted', 'exception', 'success', 'retry', 'usercancel', 'running', 'pending', 'runnable'],
classifiedState: ['classified', 'unclassified'],
tier: ['1', '2'],
author: ['VYV03354@nifty.ne.jp'],
});
});
});
});

Просмотреть файл

@ -31,7 +31,7 @@ export default class FilterModel {
// Also remove usage of the 'filter-' prefix.
const groupedValues = [...getAllUrlParams().entries()].reduce((acc, [urlField, urlValue]) => {
const field = urlField.replace(deprecated_thFilterPrefix, '');
const value = urlValue.toLowerCase().split(/,| /);
const value = field === 'author' ? [urlValue] : urlValue.toLowerCase().split(/,| /);
return field in acc ?
{ ...acc, [field]: [...acc[field], ...value] } :