/team: Make the contributor list more fair.

Don't display contributors with less commits than the 100th server
contributor (the Github API limits the output of users to 100).
This commit is contained in:
Tommy Ip 2017-11-22 13:09:51 +00:00 committed by Tim Abbott
parent e44b8809b2
commit db240de555
2 changed files with 10 additions and 1 deletions

View File

@ -21,6 +21,14 @@ function contrib_total_commits(contrib) {
export default function render_tabs() {
var template = _.template($('#contributors-template').html());
// Since the Github API limits the number of output to 100, we want to
// remove anyone in the total tab with less commits than the 100th
// contributor to the server repo. (See #7470)
var least_server_commits = _.chain(contributors_list)
.filter('server')
.sortBy('server')
.value()[0].server;
var total_tab_html = _.chain(contributors_list)
.map(function (c) {
return {
@ -31,6 +39,7 @@ export default function render_tabs() {
})
.sortBy('commits')
.reverse()
.filter(function (c) { return c.commits >= least_server_commits; })
.map(function (c) { return template(c); })
.value()
.join('');

View File

@ -131,7 +131,7 @@
</p>
<input id="total" type="radio" name="tabs" checked>
<label for="total"><i class="fa fa-globe" aria-hidden="true"></i>&nbsp; All contributions</label>
<label for="total"><i class="fa fa-globe" aria-hidden="true"></i>&nbsp; Top contributions</label>
<input id="server" type="radio" name="tabs">
<label for="server"><i class="fa fa-server" aria-hidden="true"></i>&nbsp; Zulip server</label>