Skip to content
Merged
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
11 changes: 9 additions & 2 deletions client/src/components/admin/tables/JudgeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { twMerge } from 'tailwind-merge';
import ActionsDropdown from '../../ActionsDropdown';
import MoveGroupPopup from './MoveGroupPopup';
import JudgeRanksPopup from './JudgeRanksPopup';
import { useNavigate } from 'react-router-dom';

interface JudgeRowProps {
judge: Judge;
Expand All @@ -27,6 +28,7 @@ const JudgeRow = ({ judge, idx }: JudgeRowProps) => {
const selected = useAdminTableStore((state) => state.selected);
const setSelected = useAdminTableStore((state) => state.setSelected);
const projects = useAdminStore((state) => state.projects);
const navigate = useNavigate();

useEffect(() => {
function closeClick(event: MouseEvent) {
Expand Down Expand Up @@ -62,6 +64,10 @@ const JudgeRow = ({ judge, idx }: JudgeRowProps) => {
fetchJudges();
};

const loginAsJudge = () => {
navigate(`/judge/login?code=${judge.code}`);
}

const idToProj = (id: string) => {
if (!id || id === '') {
return 'None';
Expand Down Expand Up @@ -103,15 +109,16 @@ const JudgeRow = ({ judge, idx }: JudgeRowProps) => {
<ActionsDropdown
open={popup}
setOpen={setPopup}
actions={['Scores', 'Edit', judge.active ? 'Hide' : 'Unhide', 'Move Group', 'Delete']}
actions={['Scores', 'Edit', judge.active ? 'Hide' : 'Unhide', 'Move Group', 'Login as Judge', 'Delete']}
actionFunctions={[
setRanksPopup.bind(null, true),
setEditPopup.bind(null, true),
hideJudge,
setMovePopup.bind(null, true),
loginAsJudge,
setDeletePopup.bind(null, true),
]}
redIndices={[4]}
redIndices={[5]}
/>
<span
className="cursor-pointer px-1 hover:text-primary duration-150"
Expand Down
Loading