+
{
{snapshot.repositoryContributions &&
Object.keys(snapshot.repositoryContributions).length > 0 &&
(() => {
- const sortedRepos = Object.entries(snapshot.repositoryContributions).sort(
- ([, a], [, b]) => (b as number) - (a as number)
+ const sortedRepos = sortByContributionCount(
+ Object.entries(snapshot.repositoryContributions)
)
const topRepo = sortedRepos[0]
const [topRepoName, topRepoCount] = topRepo
@@ -508,24 +621,9 @@ const BoardCandidatesPage = () => {
{sortedRepos.length > 1 && (
)}
@@ -549,80 +647,7 @@ const BoardCandidatesPage = () => {
)}
- {/* Top 5 Active Channels */}
- {snapshot &&
- (() => {
- const hasChannels =
- snapshot.channelCommunications &&
- Object.keys(snapshot.channelCommunications).length > 0
-
- if (!hasChannels) {
- return (
-
-
- Top 5 Active Channels
-
-
- No Engagement
-
-
- )
- }
-
- return (() => {
- const sortedChannels = Object.entries(snapshot.channelCommunications).sort(
- ([, a], [, b]) => (Number(b) || 0) - (Number(a) || 0)
- )
-
- if (sortedChannels.length === 0) return null
-
- const topChannel = sortedChannels[0]
- const [topChannelName, topChannelCount] = topChannel
-
- return (
-
-
- {sortedChannels.length > 1 && (
-
- )}
-
- )
- })()
- })()}
+ {renderTopActiveChannels()}
{/* Additional Information */}
{(candidate.member?.isOwaspBoardMember ||
diff --git a/frontend/src/types/project.ts b/frontend/src/types/project.ts
index 1d64b23444..a774a4d7ba 100644
--- a/frontend/src/types/project.ts
+++ b/frontend/src/types/project.ts
@@ -7,6 +7,8 @@ import type { Organization } from 'types/organization'
import type { PullRequest } from 'types/pullRequest'
import type { Release } from 'types/release'
+export type ProjectHealthType = 'healthy' | 'needsAttention' | 'unhealthy'
+
export type ProjectStats = {
contributors: number
forks: number