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

sorting candidates list, matching score - round to the whole number, … #105

Merged
merged 1 commit into from
Nov 1, 2023
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
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