зеркало из https://github.com/mozilla/treeherder.git
Bug 1490967 - Fix filtering with uppercase email address (#4032)
This commit is contained in:
Родитель
c251ab9439
Коммит
d19f0a791c
|
@ -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] } :
|
||||
|
|
Загрузка…
Ссылка в новой задаче