diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-13 16:26:48 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-13 16:26:48 +0300 |
commit | 31e9f82ebc24ff04cb4eeaf933f6f3b158a38a62 (patch) | |
tree | 6e06dbb2b782cb1304f82cff82e67b80ddb3c1b7 /app/assets/javascripts/stat_graph_contributors_util.js.coffee | |
parent | 7825830ca51dc7bf84ca6216c3b66e3ce1c63c44 (diff) | |
download | gitlab-ce-31e9f82ebc24ff04cb4eeaf933f6f3b158a38a62.tar.gz |
Improve repository graph
Diffstat (limited to 'app/assets/javascripts/stat_graph_contributors_util.js.coffee')
-rw-r--r-- | app/assets/javascripts/stat_graph_contributors_util.js.coffee | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/assets/javascripts/stat_graph_contributors_util.js.coffee b/app/assets/javascripts/stat_graph_contributors_util.js.coffee index 8f816313db3..364cab18377 100644 --- a/app/assets/javascripts/stat_graph_contributors_util.js.coffee +++ b/app/assets/javascripts/stat_graph_contributors_util.js.coffee @@ -4,9 +4,9 @@ window.ContributorsStatGraphUtil = by_author = {} for entry in log @add_date(entry.date, total) unless total[entry.date]? - @add_author(entry.author, by_author) unless by_author[entry.author]? - @add_date(entry.date, by_author[entry.author]) unless by_author[entry.author][entry.date] - @store_data(entry, total[entry.date], by_author[entry.author][entry.date]) + @add_author(entry, by_author) unless by_author[entry.author_name]? + @add_date(entry.date, by_author[entry.author_name]) unless by_author[entry.author_name][entry.date] + @store_data(entry, total[entry.date], by_author[entry.author_name][entry.date]) total = _.toArray(total) by_author = _.toArray(by_author) total: total, by_author: by_author @@ -16,8 +16,9 @@ window.ContributorsStatGraphUtil = collection[date].date = date add_author: (author, by_author) -> - by_author[author] = {} - by_author[author].author = author + by_author[author.author_name] = {} + by_author[author.author_name].author_name = author.author_name + by_author[author.author_name].author_email = author.author_email store_data: (entry, total, by_author) -> @store_commits(total, by_author) @@ -71,10 +72,11 @@ window.ContributorsStatGraphUtil = parse_log_entry: (log_entry, field, date_range) -> parsed_entry = {} - parsed_entry.author = log_entry.author + parsed_entry.author_name = log_entry.author_name + parsed_entry.author_email = log_entry.author_email parsed_entry.dates = {} parsed_entry.commits = parsed_entry.additions = parsed_entry.deletions = 0 - _.each(_.omit(log_entry, 'author'), (value, key) => + _.each(_.omit(log_entry, 'author_name', 'author_email'), (value, key) => if @in_range(value.date, date_range) parsed_entry.dates[value.date] = value[field] parsed_entry.commits += value.commits @@ -88,4 +90,4 @@ window.ContributorsStatGraphUtil = true else false -
\ No newline at end of file + |