-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding new Contributors option. #264
Conversation
@rhithesh is attempting to deploy a commit to the Open Healthcare Network Team on Vercel. A member of the Team first needs to authorize it. |
lib/types.ts
Outdated
@@ -39,6 +39,7 @@ export interface Highlights { | |||
pr_collaborated: number; | |||
issue_assigned: number; | |||
issue_opened: number; | |||
newContributor?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhithesh let's store the first_activity
date instead of a boolean field as that'd allow us to show "Contributing since " in contributors' profiles, and filtering can be done by doing a comparison of is within the last N days or not against this field.
lib/types.ts
Outdated
@@ -39,6 +39,7 @@ export interface Highlights { | |||
pr_collaborated: number; | |||
issue_assigned: number; | |||
issue_opened: number; | |||
newContributor?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, move this field to the "Contributor" type instead of keeping it under "Highlights", since it's specific to a contributor. Highlights are used in multiple other ways where field newContributor
wouldn't be a right fit.
lib/api.ts
Outdated
return { | ||
let a = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert unrelated changes
app/api/leaderboard/functions.ts
Outdated
} else if (sortBy == "new_contributors") { | ||
return b.summary["points"] - a.summary["points"]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new_contributors
is a boolean field, how would sort happen exactly? And why is it sorted by points here?
Sort by "date of first activity" instead
app/api/leaderboard/functions.ts
Outdated
.filter((contributor) => contributor.summary.points) | ||
.filter((contributor) => { | ||
return contributor.summary.points; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert unrelated changes
app/api/leaderboard/functions.ts
Outdated
@@ -32,17 +32,22 @@ export const getLeaderboardData = async ( | |||
const shouldReverse = !ordering.startsWith("-"); | |||
|
|||
const contributors = await getContributors(); | |||
// console.log(contributors); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert unrelated changes
#153 fixes.