Skip to content

Commit

Permalink
sorting candidates list, matching score - round to the whole number, …
Browse files Browse the repository at this point in the history
…tooltip subst. for HtmlTooltip designed
  • Loading branch information
Corrigan14 committed Nov 1, 2023
1 parent f000c82 commit d192e25
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const CandidateCard: React.FC<CandidateProps> = ({
whiteSpace: "nowrap",
}}
>
{candidate.full_match_score.toFixed(2)}% match
{candidate.full_match_score.toFixed(0)}% match
</div>
</CardContent>
<CardContent
Expand Down
13 changes: 11 additions & 2 deletions frontend/src/app/(site)/company/candidates/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ const options: IFuseOptions<CandidateForJobList> = {
shouldSort: true,
findAllMatches: true,
threshold: 0,
keys: ["job_title", "full_match_score", "soft_skills", "hard_skills", "name"],
keys: [
"job_title",
"full_match_score",
"soft_skills",
"hard_skills",
"preferred_name",
],
};

export default function CandidatesPage(ctx: any) {
Expand All @@ -31,7 +37,10 @@ export default function CandidatesPage(ctx: any) {
const filteredCandidates = useMemo(() => {
const fuse = new Fuse(listOfCandidates, options);
return fuse.search(searchTerm, { limit: 20 });
}, [listOfCandidates, searchTerm]);
}, [
listOfCandidates.sort((a, b) => b.full_match_score - a.full_match_score),
searchTerm,
]);

return (
<Container>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/(site)/company/jobs/jobPostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export const JobPostCard: React.FC<JobPostProps> = ({ job }) => {
const router = useRouter();
const handleShowMatchesSubmit = (
event: FormEvent<HTMLButtonElement>,
jobId: string,
jobid: string,
) => {
event.preventDefault();
router.replace(`/company/candidates/?jobId=${jobId}`);
router.replace(`/company/candidates/?jobid=${jobid}`);
};

const handleViewPostSubmit = (
Expand Down
23 changes: 19 additions & 4 deletions frontend/src/app/(site)/company/jobs/jobPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import HomeWorkIcon from "@mui/icons-material/HomeWork";
import WorkIcon from "@mui/icons-material/Work";
import PermContactCalendarIcon from "@mui/icons-material/PermContactCalendar";
import Box from "@mui/material/Box";
import Tooltip from "@mui/material/Tooltip";
import { HtmlTooltip } from "@/components/site/candidateProfile/candidateHelpers";

interface JobPreviewInterface {
jobPost: JobPost;
Expand All @@ -36,7 +36,7 @@ export const JobPreview: React.FC<JobPreviewInterface> = ({
jobId: string,
) => {
event.preventDefault();
router.replace(`/company/candidates/?jobId=${jobId}`);
router.replace(`/company/candidates/?jobid=${jobId}`);
};
return (
<>
Expand Down Expand Up @@ -103,7 +103,22 @@ export const JobPreview: React.FC<JobPreviewInterface> = ({
>
Find match
</Button>
<Tooltip title="When you choose a balanced match, you'll still receive the same matching score, but we'll prioritize presenting suggested candidates in a balanced way to support underrepresented groups. It's all about creating a fair and diverse hiring experience">
<HtmlTooltip
title={
<>
<Typography color="inherit">
<strong>What is the Balanced Match?</strong>
</Typography>
<Typography color="inherit">
When you choose a balanced match, you'll still receive the
same matching score, but we'll prioritize presenting suggested
candidates in a balanced way to support underrepresented
groups. It's all about creating a fair and diverse hiring
experience
</Typography>
</>
}
>
<Button
type="submit"
variant="outlined"
Expand All @@ -117,7 +132,7 @@ export const JobPreview: React.FC<JobPreviewInterface> = ({
>
Find balanced match
</Button>
</Tooltip>
</HtmlTooltip>
</ButtonGroup>
</Stack>
<Card
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/providers/SignInProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export const SignInProvider: FC<PropsWithChildren> = ({ children }) => {
if (!auth?.authenticated) {
return false;
}
//@TODO check token expiration time
return true;
};

Expand Down

0 comments on commit d192e25

Please sign in to comment.