From 3223f9483b93065d6d3546454962fe81f10d3e1c Mon Sep 17 00:00:00 2001 From: JAMIE XIAO Date: Thu, 27 Nov 2025 16:36:19 -0500 Subject: [PATCH 1/2] reviewer mode toggle button --- src/features/Search/Filters.tsx | 144 +++++++++++++++++---------- src/features/Search/ResultsTable.tsx | 32 +++--- src/features/Search/Search.tsx | 65 ++++++++++-- 3 files changed, 167 insertions(+), 74 deletions(-) diff --git a/src/features/Search/Filters.tsx b/src/features/Search/Filters.tsx index f9731517..51080078 100644 --- a/src/features/Search/Filters.tsx +++ b/src/features/Search/Filters.tsx @@ -17,12 +17,14 @@ import Button, { ButtonVariant } from '../../shared/Elements/Button'; import { Form } from '../../shared/Form'; import * as FormikElements from '../../shared/Form/FormikElements'; import { getOptionsFromEnum } from '../../util'; +import { cut } from 'clipboard'; interface IFilterProps { initFilters: ISearchParameter[]; onChange: (newFilters: ISearchParameter[], reviewStatus?: number[], reviewScore?: number[]) => void; onResetForm: () => void; loading: boolean; + reviewerModeOpen: boolean; } class FilterComponent extends React.Component { @@ -112,38 +114,42 @@ class FilterComponent extends React.Component { component={FormikElements.Select} value={fp.values.status} /> - - + {(this.props.reviewerModeOpen && ( + <> + + + + ))} { component={FormikElements.Select} value={fp.values.jobInterest} /> - - + {(this.props.reviewerModeOpen && ( + <> + + + + + + ))} +
{/* add space under filter */} ); } @@ -246,6 +277,16 @@ class FilterComponent extends React.Component { 'reviewerName2', values.reviewer2 ); + // const cutoffObjectId = new ObjectId(Math.floor((new Date(values.cutoffTime)).getTime() / 1000).toString(16) + "0000000000000000"); + // const cutoffTimeParam = values.cutoffTime + // ? [ + // { + // raw: { + // _id: { $lte: cutoffObjectId} + // } + // }, + // ] + // : []; let search: ISearchParameter[] = []; search = search.concat( schoolSearchParam, @@ -255,7 +296,8 @@ class FilterComponent extends React.Component { skillsParam, jobInterestParam, reviewer1Param, - reviewer2Param + reviewer2Param, + // cutoffTimeParam ); // this.props.onChange(search); // this.props.onChange(search, values.reviewStatus); diff --git a/src/features/Search/ResultsTable.tsx b/src/features/Search/ResultsTable.tsx index 03c98c84..7af440d8 100644 --- a/src/features/Search/ResultsTable.tsx +++ b/src/features/Search/ResultsTable.tsx @@ -16,6 +16,7 @@ interface IResultsTableProps { filter: string; canEditAllStatuses?: boolean; triggerUpdate: () => void; + reviewerModeOpen: boolean; } // calculate review status @@ -86,22 +87,25 @@ const ResultsTable: React.FunctionComponent = (props) => { Header: 'Status', accessor: 'hacker.status', }, - { // Number of reviewers that have reviewed this hacker - Header: 'Review Status', - id: 'reviewStatus', // required since accessor is a non-string - accessor: (row: any) => calculateReviewStatusCount(row.hacker), - Cell: (cellProps: any) => { - return cellProps.value; + ...props.reviewerModeOpen ? [ + { // Number of reviewers that have reviewed this hacker + Header: 'Review Status', + id: 'reviewStatus', // required since accessor is a non-string + accessor: (row: any) => calculateReviewStatusCount(row.hacker), + Cell: (cellProps: any) => { + return cellProps.value; + }, }, - }, - { // Average score of the reviews for this hacker - Header: 'Review Score', - id: 'reviewScore', // required since accessor is a non-string - accessor: (row: any) => calculateReviewScoreCount(row.hacker), - Cell: (cellProps: any) => { - return cellProps.value; + { // Average score of the reviews for this hacker + Header: 'Review Score', + id: 'reviewScore', // required since accessor is a non-string + accessor: (row: any) => calculateReviewScoreCount(row.hacker), + Cell: (cellProps: any) => { + return cellProps.value; + }, }, - }, + ] + : [], { Header: 'Job Interest', accessor: 'hacker.application.general.jobInterest', diff --git a/src/features/Search/Search.tsx b/src/features/Search/Search.tsx index 8d209a60..86609e58 100644 --- a/src/features/Search/Search.tsx +++ b/src/features/Search/Search.tsx @@ -55,6 +55,7 @@ interface ISearchState { reviewScoreFilter: number[]; emailModalOpen: boolean; reviewerModalOpen: boolean; + reviewerModeOpen: boolean; emailSending: boolean; emailStatus: string; emailConfirming: boolean; @@ -83,6 +84,7 @@ class SearchContainer extends React.Component<{}, ISearchState> { reviewScoreFilter: [], emailModalOpen: false, reviewerModalOpen: false, + reviewerModeOpen: false, emailSending: false, emailStatus: '', emailConfirming: false, @@ -100,6 +102,8 @@ class SearchContainer extends React.Component<{}, ISearchState> { this.closeEmailModal = this.closeEmailModal.bind(this); this.openReviewerModal = this.openReviewerModal.bind(this); this.closeReviewerModal = this.closeReviewerModal.bind(this); + this.openReviewerMode = this.openReviewerMode.bind(this); + this.closeReviewerMode = this.closeReviewerMode.bind(this); this.startEmailConfirmation = this.startEmailConfirmation.bind(this); this.backFromEmailConfirmation = this.backFromEmailConfirmation.bind(this); this.confirmSendEmails = this.confirmSendEmails.bind(this); @@ -108,6 +112,7 @@ class SearchContainer extends React.Component<{}, ISearchState> { ...this.state, emailModalOpen: false, reviewerModalOpen: false, + reviewerModeOpen: false, emailSending: false, emailStatus: '', emailConfirming: false, @@ -136,6 +141,13 @@ class SearchContainer extends React.Component<{}, ISearchState> { this.setState({ reviewerModalOpen: false }); } + openReviewerMode() { + this.setState({ reviewerModeOpen: true }); + } + closeReviewerMode() { + this.setState({ reviewerModeOpen: false }); + } + async startEmailConfirmation(status: string) { try { // Fetch the count of emails to be sent @@ -213,6 +225,42 @@ class SearchContainer extends React.Component<{}, ISearchState> { account && account.accountType === UserType.STAFF ? true : false; return ( + + + Search | {HACKATHON_NAME} @@ -231,6 +279,7 @@ class SearchContainer extends React.Component<{}, ISearchState> { onChange={this.onFilterChange} onResetForm={this.onResetForm} loading={loading} + reviewerModeOpen={this.state.reviewerModeOpen} /> @@ -284,6 +333,12 @@ class SearchContainer extends React.Component<{}, ISearchState> { Send Emails )} + @@ -294,6 +349,7 @@ class SearchContainer extends React.Component<{}, ISearchState> { filter={searchBar} canEditAllStatuses={isStaffAccount} triggerUpdate={this.triggerSearch} + reviewerModeOpen={this.state.reviewerModeOpen} /> @@ -466,15 +522,6 @@ class SearchContainer extends React.Component<{}, ISearchState> { )} {/* Reviewer Modal */} - - {/* { - this.state.reviewerModalOpen && ( - - ) - } */} {this.state.reviewerModalOpen && (
Date: Sat, 29 Nov 2025 12:27:59 -0500 Subject: [PATCH 2/2] . --- src/features/Search/Filters.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/Search/Filters.tsx b/src/features/Search/Filters.tsx index 51080078..95420ceb 100644 --- a/src/features/Search/Filters.tsx +++ b/src/features/Search/Filters.tsx @@ -203,12 +203,12 @@ class FilterComponent extends React.Component { component={FormikElements.Select} value={fp.values.reviewStatus} /> - + /> */} ))}