mirror of
https://github.com/reiyua/github-profile-trophy-reiyua-mirror.git
synced 2026-11-17 06:02:09 +11:00
Added Total Reviews Trophy (#200)
This commit is contained in:
parent
5378858628
commit
450f208327
4 changed files with 56 additions and 0 deletions
|
|
@ -38,6 +38,7 @@ export class GithubAPIClient {
|
||||||
contributionsCollection {
|
contributionsCollection {
|
||||||
totalCommitContributions
|
totalCommitContributions
|
||||||
restrictedContributionsCount
|
restrictedContributionsCount
|
||||||
|
totalPullRequestReviewContributions
|
||||||
}
|
}
|
||||||
organizations(first: 1) {
|
organizations(first: 1) {
|
||||||
totalCount
|
totalCount
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,56 @@ export class OGAccountTrophy extends Trophy{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class TotalReviewsTrophy extends Trophy {
|
||||||
|
constructor(score: number) {
|
||||||
|
const rankConditions = [
|
||||||
|
new RankCondition(
|
||||||
|
RANK.SSS,
|
||||||
|
"God Reviewer",
|
||||||
|
70,
|
||||||
|
),
|
||||||
|
new RankCondition(
|
||||||
|
RANK.SS,
|
||||||
|
"Deep Reviewer",
|
||||||
|
57,
|
||||||
|
),
|
||||||
|
new RankCondition(
|
||||||
|
RANK.S,
|
||||||
|
"Super Reviewer",
|
||||||
|
45,
|
||||||
|
),
|
||||||
|
new RankCondition(
|
||||||
|
RANK.AAA,
|
||||||
|
"Ultra Reviewer",
|
||||||
|
30,
|
||||||
|
),
|
||||||
|
new RankCondition(
|
||||||
|
RANK.AA,
|
||||||
|
"Hyper Reviewer",
|
||||||
|
20,
|
||||||
|
),
|
||||||
|
new RankCondition(
|
||||||
|
RANK.A,
|
||||||
|
"Active Reviewer",
|
||||||
|
8,
|
||||||
|
),
|
||||||
|
new RankCondition(
|
||||||
|
RANK.B,
|
||||||
|
"Intermediate Reviewer",
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
new RankCondition(
|
||||||
|
RANK.C,
|
||||||
|
"New Reviewer",
|
||||||
|
1,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
super(score, rankConditions);
|
||||||
|
this.title = "Reviews";
|
||||||
|
this.filterTitles = ["Review", "Reviews"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class TotalStarTrophy extends Trophy {
|
export class TotalStarTrophy extends Trophy {
|
||||||
constructor(score: number) {
|
constructor(score: number) {
|
||||||
const rankConditions = [
|
const rankConditions = [
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import {
|
||||||
TotalIssueTrophy,
|
TotalIssueTrophy,
|
||||||
TotalPullRequestTrophy,
|
TotalPullRequestTrophy,
|
||||||
TotalRepositoryTrophy,
|
TotalRepositoryTrophy,
|
||||||
|
TotalReviewsTrophy,
|
||||||
MultipleLangTrophy,
|
MultipleLangTrophy,
|
||||||
LongTimeAccountTrophy,
|
LongTimeAccountTrophy,
|
||||||
AncientAccountTrophy,
|
AncientAccountTrophy,
|
||||||
|
|
@ -28,6 +29,7 @@ export class TrophyList {
|
||||||
new TotalIssueTrophy(userInfo.totalIssues),
|
new TotalIssueTrophy(userInfo.totalIssues),
|
||||||
new TotalPullRequestTrophy(userInfo.totalPullRequests),
|
new TotalPullRequestTrophy(userInfo.totalPullRequests),
|
||||||
new TotalRepositoryTrophy(userInfo.totalRepositories),
|
new TotalRepositoryTrophy(userInfo.totalRepositories),
|
||||||
|
new TotalReviewsTrophy(userInfo.totalReviews),
|
||||||
);
|
);
|
||||||
// Secret trophies
|
// Secret trophies
|
||||||
this.trophies.push(
|
this.trophies.push(
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ export type GitHubUserActivity = {
|
||||||
contributionsCollection: {
|
contributionsCollection: {
|
||||||
totalCommitContributions: number;
|
totalCommitContributions: number;
|
||||||
restrictedContributionsCount: number;
|
restrictedContributionsCount: number;
|
||||||
|
totalPullRequestReviewContributions: number;
|
||||||
};
|
};
|
||||||
organizations: {
|
organizations: {
|
||||||
totalCount: number;
|
totalCount: number;
|
||||||
|
|
@ -45,6 +46,7 @@ export class UserInfo {
|
||||||
public readonly totalIssues: number;
|
public readonly totalIssues: number;
|
||||||
public readonly totalOrganizations: number;
|
public readonly totalOrganizations: number;
|
||||||
public readonly totalPullRequests: number;
|
public readonly totalPullRequests: number;
|
||||||
|
public readonly totalReviews: number;
|
||||||
public readonly totalStargazers: number;
|
public readonly totalStargazers: number;
|
||||||
public readonly totalRepositories: number;
|
public readonly totalRepositories: number;
|
||||||
public readonly languageCount: number;
|
public readonly languageCount: number;
|
||||||
|
|
@ -94,6 +96,7 @@ export class UserInfo {
|
||||||
this.totalIssues = userIssue.openIssues.totalCount + userIssue.closedIssues.totalCount;
|
this.totalIssues = userIssue.openIssues.totalCount + userIssue.closedIssues.totalCount;
|
||||||
this.totalOrganizations = userActivity.organizations.totalCount;
|
this.totalOrganizations = userActivity.organizations.totalCount;
|
||||||
this.totalPullRequests = userPullRequest.pullRequests.totalCount;
|
this.totalPullRequests = userPullRequest.pullRequests.totalCount;
|
||||||
|
this.totalReviews = userActivity.contributionsCollection.totalPullRequestReviewContributions;
|
||||||
this.totalStargazers = totalStargazers;
|
this.totalStargazers = totalStargazers;
|
||||||
this.totalRepositories = userRepository.repositories.totalCount;
|
this.totalRepositories = userRepository.repositories.totalCount;
|
||||||
this.languageCount = languages.size;
|
this.languageCount = languages.size;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue