team: Count contributors with 20+ commits too.

This is a useful supplement to the number for 100+ commits.
This commit is contained in:
Tim Abbott 2024-07-23 13:25:49 -07:00
parent 9716ad9e84
commit 2e252ec502
2 changed files with 10 additions and 1 deletions

View File

@ -154,7 +154,9 @@ contributors, and more than 75 with 100+ commits." %}
<script type="text/template" id="total-count-template">
<p class="contributor-count">
<%= contributor_count %> total contributors (<%= hundred_plus_contributor_count %> with 100+ commits)
<%= contributor_count %> total contributors
(<%= hundred_plus_contributor_count %> with 100+ commits;
<%= twenty_plus_contributor_count %> with 20+ commits)
</p>
</script>

View File

@ -152,6 +152,7 @@ export default function render_tabs(contributors: Contributor[]): void {
.map((c) => template(c))
.join("");
const twenty_plus_total_contributors = mapped_contributors_list.filter((c) => c.commits >= 20);
const hundred_plus_total_contributors = mapped_contributors_list.filter(
(c) => c.commits >= 100,
);
@ -162,6 +163,7 @@ export default function render_tabs(contributors: Contributor[]): void {
total_count_template({
contributor_count: contributors_list.length,
tab_name: "total",
twenty_plus_contributor_count: twenty_plus_total_contributors.length,
hundred_plus_contributor_count: hundred_plus_total_contributors.length,
}),
),
@ -213,6 +215,10 @@ export default function render_tabs(contributors: Contributor[]): void {
const commits = c.total_commits;
return commits >= 100;
}).length;
const twenty_plus_contributor_count = filtered_by_tab.filter((c) => {
const commits = c.total_commits;
return commits >= 20;
}).length;
const repo_url_list = repo_list.map(
(repo_name) => `https://github.com/zulip/${repo_name}`,
);
@ -222,6 +228,7 @@ export default function render_tabs(contributors: Contributor[]): void {
contributor_count,
repo_list,
repo_url_list,
twenty_plus_contributor_count,
hundred_plus_contributor_count,
}),
),