|
|
|
|
|
|
|
|
import React, { useState, useEffect, useRef } from "react"; |
|
|
|
|
|
|
|
|
import React, { useEffect, useRef } from "react"; |
|
|
import arrow_left from "../../assets/images/arrow_left.png"; |
|
|
import arrow_left from "../../assets/images/arrow_left.png"; |
|
|
import arrow_right from "../../assets/images/arrow_right.png"; |
|
|
import arrow_right from "../../assets/images/arrow_right.png"; |
|
|
import { useParams } from "react-router-dom"; |
|
|
import { useParams } from "react-router-dom"; |
|
|
import { useTranslation } from "react-i18next"; |
|
|
import { useTranslation } from "react-i18next"; |
|
|
import { Link } from "react-router-dom"; |
|
|
import { Link } from "react-router-dom"; |
|
|
import AddAdModal from "../../components/Ads/AddAdModal"; |
|
|
|
|
|
import AdFilters from "../../components/Ads/AdFilters"; |
|
|
|
|
|
import { useDispatch } from "react-redux"; |
|
|
import { useDispatch } from "react-redux"; |
|
|
import { useSelector } from "react-redux"; |
|
|
import { useSelector } from "react-redux"; |
|
|
import FilterButton from "../../components/Button/FilterButton"; |
|
|
|
|
|
import Slider from "react-slick"; |
|
|
import Slider from "react-slick"; |
|
|
import "slick-carousel/slick/slick.css"; |
|
|
import "slick-carousel/slick/slick.css"; |
|
|
import "slick-carousel/slick/slick-theme.css"; |
|
|
import "slick-carousel/slick/slick-theme.css"; |
|
|
|
|
|
|
|
|
import { setProcessesReq } from "../../store/actions/processes/processesAction" |
|
|
import { setProcessesReq } from "../../store/actions/processes/processesAction" |
|
|
import { selectProcesses } from "../../store/selectors/processesSelectors" |
|
|
import { selectProcesses } from "../../store/selectors/processesSelectors" |
|
|
import { selectApplicant } from "../../store/selectors/applicantWithProcessSelector" |
|
|
import { selectApplicant } from "../../store/selectors/applicantWithProcessSelector" |
|
|
import {setApplicantReq } from "../../store/actions/processes/applicantAction" |
|
|
|
|
|
|
|
|
import { setApplicantReq } from "../../store/actions/processes/applicantAction" |
|
|
|
|
|
|
|
|
const SelectionProcessOfApplicantPage = () => { |
|
|
const SelectionProcessOfApplicantPage = () => { |
|
|
const theme = useTheme(); |
|
|
const theme = useTheme(); |
|
|
const matches = useMediaQuery(theme.breakpoints.down("sm")); |
|
|
const matches = useMediaQuery(theme.breakpoints.down("sm")); |
|
|
const [toggleFiltersDrawer, setToggleFiltersDrawer] = useState(false); |
|
|
|
|
|
const [toggleModal, setToggleModal] = useState(false); |
|
|
|
|
|
const applicant = useSelector(selectApplicant) |
|
|
const applicant = useSelector(selectApplicant) |
|
|
const processes = applicant?.selectionProcesses; |
|
|
const processes = applicant?.selectionProcesses; |
|
|
const levels = useSelector(selectProcesses) |
|
|
const levels = useSelector(selectProcesses) |
|
|
|
|
|
|
|
|
dispatch(setProcessesReq()); |
|
|
dispatch(setProcessesReq()); |
|
|
}, []); |
|
|
}, []); |
|
|
|
|
|
|
|
|
const handleToggleFiltersDrawer = () => { |
|
|
|
|
|
setToggleFiltersDrawer((oldState) => !oldState); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handleToggleModal = () => { |
|
|
|
|
|
setToggleModal((oldState) => !oldState); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var settings = { |
|
|
var settings = { |
|
|
dots: false, |
|
|
dots: false, |
|
|
|
|
|
|
|
|
status={"Čeka na zakazivanje"} |
|
|
status={"Čeka na zakazivanje"} |
|
|
id={id} |
|
|
id={id} |
|
|
key={i} />); |
|
|
key={i} />); |
|
|
} |
|
|
|
|
|
applicantSelections.push(<ApplicantSelection key={i} className="hiddenAd" |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
applicantSelections.push(<ApplicantSelection key={i} className="hiddenAd" |
|
|
date={""} />); |
|
|
date={""} />); |
|
|
return applicantSelections; |
|
|
return applicantSelections; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
<div className="l-t-rectangle"></div> |
|
|
<div className="l-t-rectangle"></div> |
|
|
<div className="r-b-rectangle"></div> |
|
|
<div className="r-b-rectangle"></div> |
|
|
{/* <AdFilters /> */} |
|
|
{/* <AdFilters /> */} |
|
|
<AdFilters |
|
|
|
|
|
open={toggleFiltersDrawer} |
|
|
|
|
|
handleClose={handleToggleFiltersDrawer} |
|
|
|
|
|
/> |
|
|
|
|
|
<AddAdModal open={toggleModal} handleClose={handleToggleModal} /> |
|
|
|
|
|
<div className="ads"> |
|
|
<div className="ads"> |
|
|
{processes && processes.length > 0 && ( |
|
|
{processes && processes.length > 0 && ( |
|
|
<div className="active-ads"> |
|
|
<div className="active-ads"> |
|
|
<div className="active-ads-header"> |
|
|
<div className="active-ads-header"> |
|
|
<h1>{t("selection.title")} |
|
|
|
|
|
<span className="level-header-spliter"> |
|
|
|
|
|
| |
|
|
|
|
|
</span> |
|
|
|
|
|
<span className="level-header-subheader"> |
|
|
|
|
|
{applicant.firstName + " " + applicant.lastName} |
|
|
|
|
|
|
|
|
<h1>{t("selection.title")} |
|
|
|
|
|
<span className="level-header-spliter"> |
|
|
|
|
|
| |
|
|
|
|
|
</span> |
|
|
|
|
|
<span className="level-header-subheader"> |
|
|
|
|
|
{applicant.firstName + " " + applicant.lastName} |
|
|
</span> |
|
|
</span> |
|
|
</h1> |
|
|
|
|
|
<FilterButton onShowFilters={handleToggleFiltersDrawer} /> |
|
|
|
|
|
|
|
|
</h1> |
|
|
</div> |
|
|
</div> |
|
|
<div className="active-ads-ads"> |
|
|
<div className="active-ads-ads"> |
|
|
<div className="active-ads-ads-a"> |
|
|
<div className="active-ads-ads-a"> |
|
|
|
|
|
|
|
|
style={{ width: "100%" }} |
|
|
style={{ width: "100%" }} |
|
|
ref={activeAdsSliderRef} |
|
|
ref={activeAdsSliderRef} |
|
|
> |
|
|
> |
|
|
{processes.map((process, index) => |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
{processes.map((process, index) => { |
|
|
return <ApplicantSelection |
|
|
return <ApplicantSelection |
|
|
levelNumber={index + 1} |
|
|
levelNumber={index + 1} |
|
|
levelName={process.selectionLevel.name} |
|
|
levelName={process.selectionLevel.name} |
|
|
|
|
|
|
|
|
key={index} |
|
|
key={index} |
|
|
className={index === processes.length - 1 ? "active-process" : ""} |
|
|
className={index === processes.length - 1 ? "active-process" : ""} |
|
|
/> |
|
|
/> |
|
|
})} |
|
|
|
|
|
|
|
|
})} |
|
|
{processes.length < levels.length && concatLevels()} |
|
|
{processes.length < levels.length && concatLevels()} |
|
|
</Slider> |
|
|
</Slider> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
)} |
|
|
)} |
|
|
|
|
|
<div className="active-process-tip"> |
|
|
|
|
|
<h3> |
|
|
|
|
|
{t("selection.tipHeader")} |
|
|
|
|
|
</h3> |
|
|
|
|
|
<p> |
|
|
|
|
|
{t("selection.tipBody")} |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div className="add-ad"> |
|
|
<div className="add-ad"> |
|
|
<Link className="ad-details-buttons-link" to="/selectionflow"> |
|
|
<Link className="ad-details-buttons-link" to="/selectionflow"> |