Skip to content

Commit

Permalink
Add CSV export to eval (#185)
Browse files Browse the repository at this point in the history
* Add CSV export to eval

* Nvm
  • Loading branch information
kevin-zou authored Feb 26, 2022
1 parent ed66d65 commit d773be0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions components/Assessment/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const GreyDiv = styled.div`
width: 100vw;
background: rgba(0, 0, 0, 0.4);
position: absolute;
z-index: 99;
`;

const ModalDiv = styled.div`
Expand All @@ -17,6 +18,10 @@ const ModalDiv = styled.div`
background-color: white;
transform: translate(-50%, -25%);
opacity: 100%;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
`;

export default function Modal({ children, setShowing }) {
Expand Down
8 changes: 8 additions & 0 deletions components/Evaluator/HackerList.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Icon from '../Icon';
import Input from '../input';
import { COLOR, ASSESSMENT_COLOR } from '../../constants';
import { Title5 } from '../Typography';
import ExportModal from '../Assessment/ExportModal';

const Container = styled.div`
height: 60%;
Expand Down Expand Up @@ -78,6 +79,7 @@ export default function HackerList({
// State for search and filter icons
const [searchActive, setSearchActive] = useState(false);
const [filterActive, setFilterActive] = useState(false);
const [showExportModal, setShowExportModal] = useState(false);

// debounce search
useEffect(() => {
Expand Down Expand Up @@ -143,6 +145,10 @@ export default function HackerList({
color={!filterActive && COLOR.GREY_500}
onClick={() => setFilterActive(!filterActive)}
/>
<StyledIcon
icon="file-arrow-down"
onClick={() => setShowExportModal(true)}
/>
</ButtonContainer>
</>
)}
Expand All @@ -168,6 +174,8 @@ export default function HackerList({
/>
))}
</ListContainer>

{showExportModal && <ExportModal setShowing={setShowExportModal} />}
</Container>
);
}
7 changes: 2 additions & 5 deletions utility/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ export const getApplicantsToAccept = async (score) => {
return applicants.docs
.filter((app) => {
const appStatus = app.data().status.applicationStatus;
const newHacker = app.data().basicInfo.hackathonsAttended === 0;
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;
Expand All @@ -650,12 +650,11 @@ export const getCSVData = async () => {
school,
location,
major,
hackathonsAttended,
},
status: { applicationStatus },
skills: { hackathonsAttended },
} = doc.data();
const totalScore = doc.data().score?.totalScore ?? '?';
const firstTimeHacker = hackathonsAttended === 0;
return [
firstName,
lastName,
Expand All @@ -668,7 +667,6 @@ export const getCSVData = async () => {
applicationStatus,
major,
hackathonsAttended,
firstTimeHacker,
];
});
CSV.unshift([
Expand All @@ -682,7 +680,6 @@ export const getCSVData = async () => {
'Total Score',
'Application Status',
'Major',
'# of hackathons attended',
'First time hacker?',
]);
return CSV;
Expand Down

0 comments on commit d773be0

Please sign in to comment.