diff options
author | Mike Greiling <mike@pixelcog.com> | 2016-12-10 01:36:05 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2016-12-10 09:59:39 +0300 |
commit | 9355ba238b7ffde61888fb21a1ed1b33414a7d9a (patch) | |
tree | be8f99636e12673eae73ed458d813d3da516db1f /app/assets/javascripts/graphs | |
parent | 3f768f9a14ad90bbd79d384e3c287db4feea3e35 (diff) |
normalize author email so we can treat it as case insensitive
Diffstat (limited to 'app/assets/javascripts/graphs')
-rw-r--r-- | app/assets/javascripts/graphs/stat_graph_contributors_util.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/graphs/stat_graph_contributors_util.js b/app/assets/javascripts/graphs/stat_graph_contributors_util.js index 051ff98c774..1982f4af939 100644 --- a/app/assets/javascripts/graphs/stat_graph_contributors_util.js +++ b/app/assets/javascripts/graphs/stat_graph_contributors_util.js @@ -2,7 +2,7 @@ (function() { window.ContributorsStatGraphUtil = { parse_log: function(log) { - var by_author, by_email, data, entry, i, len, total; + var by_author, by_email, data, entry, i, len, total, normalized_email; total = {}; by_author = {}; by_email = {}; @@ -11,7 +11,8 @@ if (total[entry.date] == null) { this.add_date(entry.date, total); } - data = by_author[entry.author_name] || by_email[entry.author_email]; + normalized_email = entry.author_email.toLowerCase(); + data = by_author[entry.author_name] || by_email[normalized_email]; if (data == null) { data = this.add_author(entry, by_author, by_email); } @@ -32,12 +33,14 @@ return collection[date].date = date; }, add_author: function(author, by_author, by_email) { - var data; + var data, normalized_email; data = {}; data.author_name = author.author_name; data.author_email = author.author_email; + normalized_email = author.author_email.toLowerCase(); by_author[author.author_name] = data; - return by_email[author.author_email] = data; + by_email[normalized_email] = data; + return data; }, store_data: function(entry, total, by_author) { this.store_commits(total, by_author); |