Added pr reviews to stats (#1404)

* Added pr reviews to stats

* Add 'show' query parameter

* Fix show test

* refactoring

* cleanup

* refactor: restructure stats-card code

---------

Co-authored-by: Markus <markus.tyrkko@gmail.com>
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: rickstaa <rick.staa@outlook.com>
This commit is contained in:
Markus Tyrkkö
2023-06-15 09:35:09 +02:00
committed by GitHub
co-authored by Markus Alexandr rickstaa
parent c86cc72df2
commit 1bb65ddc29
10 changed files with 112 additions and 34 deletions
+5 -1
View File
@@ -45,7 +45,8 @@ const GRAPHQL_STATS_QUERY = `
name
login
contributionsCollection {
totalCommitContributions
totalCommitContributions,
totalPullRequestReviewContributions
}
repositoriesContributedTo(first: 1, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {
totalCount
@@ -185,6 +186,7 @@ const fetchStats = async (
const stats = {
name: "",
totalPRs: 0,
totalReviews: 0,
totalCommits: 0,
totalIssues: 0,
totalStars: 0,
@@ -227,6 +229,8 @@ const fetchStats = async (
}
stats.totalPRs = user.pullRequests.totalCount;
stats.totalReviews =
user.contributionsCollection.totalPullRequestReviewContributions;
stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
stats.contributedTo = user.repositoriesContributedTo.totalCount;
+1
View File
@@ -18,6 +18,7 @@ export type RepositoryData = {
export type StatsData = {
name: string;
totalPRs: number;
totalReviews: number;
totalCommits: number;
totalIssues: number;
totalStars: number;