Commit c524cfac authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Make contribution graph email grouping ignore case

This makes the contribution graph grouping by contributor emails
case-insensitive

Changelog: fixed
parent 5a018bed
...@@ -7,10 +7,11 @@ export const parsedData = (state) => { ...@@ -7,10 +7,11 @@ export const parsedData = (state) => {
state.chartData.forEach(({ date, author_name, author_email }) => { state.chartData.forEach(({ date, author_name, author_email }) => {
total[date] = total[date] ? total[date] + 1 : 1; total[date] = total[date] ? total[date] + 1 : 1;
const authorData = byAuthorEmail[author_email]; const normalizedEmail = author_email.toLowerCase();
const authorData = byAuthorEmail[normalizedEmail];
if (!authorData) { if (!authorData) {
byAuthorEmail[author_email] = { byAuthorEmail[normalizedEmail] = {
name: author_name, name: author_name,
commits: 1, commits: 1,
dates: { dates: {
......
...@@ -35,7 +35,7 @@ describe('Contributors Store Getters', () => { ...@@ -35,7 +35,7 @@ describe('Contributors Store Getters', () => {
{ author_name: 'Carlson', author_email: 'carlson123@gmail.com', date: '2019-05-05' }, { author_name: 'Carlson', author_email: 'carlson123@gmail.com', date: '2019-05-05' },
{ author_name: 'John', author_email: 'jawnnypoo@gmail.com', date: '2019-04-04' }, { author_name: 'John', author_email: 'jawnnypoo@gmail.com', date: '2019-04-04' },
{ author_name: 'Johan', author_email: 'jawnnypoo@gmail.com', date: '2019-04-04' }, { author_name: 'Johan', author_email: 'jawnnypoo@gmail.com', date: '2019-04-04' },
{ author_name: 'John', author_email: 'jawnnypoo@gmail.com', date: '2019-03-03' }, { author_name: 'John', author_email: 'JAWNNYPOO@gmail.com', date: '2019-03-03' },
]; ];
parsed = getters.parsedData(state); parsed = getters.parsedData(state);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment