Skip to content
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

Migrate accept button to evaluator tab #231

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/Evaluator/HackerList.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
import styled from 'styled-components'
import { ASSESSMENT_COLOR, COLOR } from '../../constants'
import ExportModal from '../Assessment/ExportModal'
import AcceptingModal from '../Assessment/acceptingModal'
import Icon from '../Icon'
import { Title5 } from '../Typography'
import Input from '../input'
Expand Down Expand Up @@ -86,6 +87,7 @@ export default function HackerList({ applicants, selectedApplicant, setSelectedA
const [search, setSearch] = useState('')
const [debouncedSearch, setDebouncedSearch] = useState('')
const [filtered, setFiltered] = useState([])
const [showAcceptance, setShowAcceptance] = useState(false)
// State for search and filter icons
const [searchActive, setSearchActive] = useState(false)
const [filterActive, setFilterActive] = useState(false)
Expand Down Expand Up @@ -140,6 +142,7 @@ export default function HackerList({ applicants, selectedApplicant, setSelectedA

return (
<Container>
{showAcceptance && <AcceptingModal setShowing={setShowAcceptance} />}
<HeadContainer>
{searchActive ? (
<SearchContainer>
Expand All @@ -163,6 +166,7 @@ export default function HackerList({ applicants, selectedApplicant, setSelectedA
color={!filterActive && COLOR.GREY_500}
onClick={() => setFilterActive(!filterActive)}
/>
<StyledIcon icon="check" onClick={() => setShowAcceptance(true)} />
<StyledIcon icon="file-arrow-down" onClick={() => setShowExportModal(true)} />
</ButtonContainer>
</>
Expand Down
10 changes: 4 additions & 6 deletions utility/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,7 @@ export const getApplicantsToAccept = async score => {
return applicants.docs
.filter(app => {
const appStatus = app.data().status.applicationStatus
const newHacker = app.data().skills.hackathonsAttended === 0
if (appStatus !== APPLICATION_STATUS.scored.text) return false
if (newHacker) return true
return app.data().score.totalScore >= score
})
.map(doc => doc.data())
Expand All @@ -603,9 +601,9 @@ export const getCSVData = async () => {
.get()
const CSV = apps.docs.map(doc => {
const {
basicInfo: { firstName, lastName, email, educationLevel, phoneNumber, school, location, major },
basicInfo: { firstName, lastName, email, educationLevel, phoneNumber, school, countryOfResidence, major },
status: { applicationStatus },
skills: { hackathonsAttended },
skills: { firstTimeHacker },
} = doc.data()
const totalScore = doc.data().score?.totalScore ?? '?'
return [
Expand All @@ -615,11 +613,11 @@ export const getCSVData = async () => {
phoneNumber,
school,
educationLevel,
location,
countryOfResidence,
totalScore,
applicationStatus,
major,
hackathonsAttended,
firstTimeHacker,
]
})
CSV.unshift([
Expand Down
Loading