Commit 5eda1d85 authored by H.M.C. Nadunithara Wijerathne's avatar H.M.C. Nadunithara Wijerathne

Merge branch 'IT19953298' into 'master'

Fix UI

See merge request !5
parents 44b973f1 b4bbfb19
import {
AddressType,
ApplicationType,
CandidateType,
OrganizationType,
Reducers,
......@@ -53,7 +52,7 @@ export const getUserId = (state: Reducers): string => {
return profile._id as string;
};
export const getStatusColor = (status?: ApplicationType["status"]) => {
export const getStatusColor = (status?: string) => {
const color =
status === "Accepted"
? "text-bg-success"
......
......@@ -216,7 +216,7 @@ export type ApplicationPayloadType = {
_id: string;
candidate: CandidateType;
job: string;
status: "Pending" | "Accepted" | "In progress" | "Rejected";
status: string;
interview?: {
date: string;
time: string;
......
......@@ -57,7 +57,7 @@ const Applicant = ({ application }: OwnProps) => {
<textarea
className="form-control"
rows={3}
value={getAddress(candidate.contacts.address)}
value={getAddress(candidate.contacts?.address)}
disabled
/>
</div>
......@@ -71,7 +71,7 @@ const Applicant = ({ application }: OwnProps) => {
type="text"
className="form-control"
name="phone"
value={candidate.contacts?.phone}
value={candidate.contacts?.phone || ""}
disabled
/>
</div>
......
......@@ -20,7 +20,7 @@ import {
import Progress from "../Progress";
import { fileStorage } from "../../common/config";
import { useDispatch } from "react-redux";
import { updateApplication } from "../../common/actions/common";
import { getJobs, updateApplication } from "../../common/actions/common";
import { getVerificationColor } from "../../common/lib/util";
type OwnProps = {
......@@ -46,6 +46,10 @@ const Interview = ({ application }: OwnProps) => {
const _video = useRef<ReactPlayer>(null);
const _hiddenFileInput = useRef<HTMLInputElement>(null);
useEffect(() => {
dispatch(getJobs());
}, []);
const onPressStartFacialExpression = () => {
setIsFacialAnalyzing(true);
const url = `ws://127.0.0.1:8000/facial/ws/emotions?application_id=${application._id}`;
......@@ -214,7 +218,9 @@ const Interview = ({ application }: OwnProps) => {
</strong>
);
}
return null;
return (
<strong className="text-primary">Voice verification: Pending</strong>
);
};
return (
......
......@@ -52,12 +52,14 @@ const Jobs = ({ jobs, onSelectJob, selectedIndex }: OwnProps) => {
Salary : {job.salary.min} - {job.salary.max} {job.salary.currency}{" "}
</p>
<p className="desc">{job.description.slice(0, 200)}...</p>
{userType === USER_TYPE.ORGANIZATION && (
<p className="desc mt-2">
<label>Applicattions : </label>{" "}
<a href={`/applications?jobId=${job._id}`}>
({job.applications?.length}) Candidates
</a>
</p>
)}
</div>
);
};
......
......@@ -14,24 +14,24 @@ const Application = () => {
const dispatch = useDispatch();
const [searchParams] = useSearchParams();
const [selectedTab, setSelectedTab] = useState("Candidate");
const [status, setStatus] = useState("Pending");
const job = useOutletContext<JobPayloadType>();
const applicationId = searchParams.get("applicationId");
const application = (job.applications as ApplicationPayloadType[])?.find(
(_application) => _application._id === applicationId
);
const [status, setStatus] = useState(application?.status);
const statusValues = useMemo(() => {
if (status === "Pending") {
return ["Schedule", "Reject"];
} else if (status === "Schedule") {
} else if (status === "In progress") {
return ["Accept", "Reject"];
} else if (status === "Rejected") {
return ["Pending", "Schedule"];
} else {
return [];
}
}, [status]);
}, []);
useEffect(() => {
if (application) {
......@@ -54,6 +54,7 @@ const Application = () => {
} else if (status === "Reject") {
applicationStatus = "Rejected";
}
dispatch(
updateApplication({
applicationId: application._id,
......@@ -64,7 +65,9 @@ const Application = () => {
};
const onChangeStatus = (e: ChangeEvent<HTMLSelectElement>) => {
if (e.target.value !== "select") {
setStatus(e.target.value);
}
};
const renderOptions = (option: string, index: number) => (
......@@ -92,6 +95,7 @@ const Application = () => {
value={status}
onChange={onChangeStatus}
>
<option value="select">Select</option>
{statusValues.map(renderOptions)}
</select>
<button
......
......@@ -13,7 +13,7 @@ const Applications = () => {
useEffect(() => {
if (job) {
sortApplications("skills", job);
sortApplications("total", job);
}
}, [job]);
......@@ -91,9 +91,9 @@ const Applications = () => {
aria-label="Default select example"
onChange={onSelectSort}
>
<option value="total">Total score</option>
<option value="skills">Skills score</option>
<option value="similarity">Similarity</option>
<option value="total">Total score</option>
</select>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment