Skip to content

Commit

Permalink
Merge pull request #641 from nwplus/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
martincai8 authored Nov 11, 2024
2 parents 4f5ab7c + 04be9c0 commit ffd6777
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
7 changes: 5 additions & 2 deletions src/components/Judging/ViewProject.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const StyledYoutube = styled(Youtube)`

const StyledP = styled(P)`
margin: 1em 0;
color: ${p => p.theme.colors.text};
`

const StyledA = styled(A)`
Expand All @@ -47,14 +48,16 @@ const StyledA = styled(A)`
`

const ExternalLink = styled(A)`
color: ${p => 'white'};
color: ${p => p.theme.colors.tertiaryHover};
font-weight: bold;
&:hover {
color: ${p => p.theme.colors.tertiaryHover};
}
`

const StyledLabel = styled(Label)`
color: ${p => p.theme.colors.textSecondary};
display: block;
margin: 1em 0 0.25em 0;
`
Expand Down Expand Up @@ -134,7 +137,7 @@ const ViewProject = ({ project, score, error, success, isSubmitting, onChange, o
<ExternalLink
target="_blank"
rel="noreferrer noopener"
href="https://www.notion.so/nwplus/Judging-Rubric-2023-026e041c729d48ca8c75efa63d430c42"
href="https://nwplus.notion.site/PUBLIC-HackCamp-2024-Peer-Judging-Rubric-23ecd01e56b04442a7dfe0c7cbabbc62"
>
Hacker Package
</ExternalLink>
Expand Down
27 changes: 13 additions & 14 deletions src/pages/Judging/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,19 @@ const StyledJudgingCard = styled(JudgingCard)`
const getProjects = async (userId, projectId, dbHackathonName) => {
const getAndAssignProjects = async () => {
try {
return db.runTransaction(async transaction => {
const projectDocs = await transaction.get(
projectsRef(dbHackathonName)
.where('draftStatus', '==', 'public')
.orderBy('countAssigned')
.limit(PROJECTS_TO_JUDGE_COUNT + 1) // get an extra in case we got our own project
)
const projectSnapshot = await projectsRef(dbHackathonName)
.where('draftStatus', '==', 'public')
.orderBy('countAssigned')
.limit(PROJECTS_TO_JUDGE_COUNT + 1)
.get()

let projectIds = projectDocs.docs.map(project => project.id)
projectIds = projectIds.filter(id => id !== projectId)
if (projectIds.length > PROJECTS_TO_JUDGE_COUNT) {
projectIds.pop()
}
let projectIds = projectSnapshot.docs.map(project => project.id)
projectIds = projectIds.filter(id => id !== projectId)
if (projectIds.length > PROJECTS_TO_JUDGE_COUNT) {
projectIds.pop()
}

// increment assigned counters
await db.runTransaction(async transaction => {
projectIds.forEach(projectId => {
const projectRef = projectsRef(dbHackathonName).doc(projectId)
transaction.update(projectRef, {
Expand All @@ -43,8 +41,9 @@ const getProjects = async (userId, projectId, dbHackathonName) => {
transaction.update(applicantRef, {
projectsAssigned: projectIds,
})
return projectIds
})

return projectIds
} catch (error) {
console.error('Error assigning projects:', error)
}
Expand Down
4 changes: 2 additions & 2 deletions src/utility/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ export const JUDGING_RUBRIC = [
// ------------------ HC
{
id: 'presentation',
label: 'Presentation',
label: 'Presentation/Pitch',
description:
'Is the presentation well-prepared and smooth? Does it make a good business case for the project? Are statistics used when relevant?',
'Is the presentation or pitch is well-prepared and smooth? Does it make a good business case for the project? Are statistics used when relevant?',
value: 5,
// weight: 3 / 18,
weight: 1 / 4,
Expand Down

0 comments on commit ffd6777

Please sign in to comment.