Skip to content

Commit

Permalink
Bug 1490967 - Fix filtering with uppercase email address (#4032)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Dawson committed Sep 14, 2018
1 parent c251ab9 commit d19f0a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/ui/unit/models/filter.tests.js
Expand Up @@ -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'],
});
});
});
});
2 changes: 1 addition & 1 deletion ui/models/filter.js
Expand Up @@ -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] } :
Expand Down

0 comments on commit d19f0a7

Please sign in to comment.