| @@ -15,7 +15,6 @@ import { | |||
| CANDIDATES_PAGE, | |||
| USER_DETAILS_PAGE, | |||
| CANDIDATES_DETAILS_PAGE, | |||
| USER_DETAILS_PAGE, | |||
| SELECTION_PROCESS_PAGE, | |||
| SELECTION_PROCESS_OF_APPLICANT_PAGE | |||
| } from "./constants/pages"; | |||
| @@ -1,6 +1,7 @@ | |||
| import React from "react"; | |||
| import PropTypes from "prop-types"; | |||
| import { formatDate } from "../../util/helpers/dateHelpers"; | |||
| import { Link } from "react-router-dom"; | |||
| const ApplicantSelection = ({ | |||
| levelNumber, | |||
| @@ -9,10 +10,10 @@ const ApplicantSelection = ({ | |||
| link, | |||
| date, | |||
| status, | |||
| id, | |||
| onShowAdDetails, | |||
| className, | |||
| }) => { | |||
| return ( | |||
| <div className={`active-process-card ${className}`} onClick={onShowAdDetails}> | |||
| <div className="active-process-card-header"> | |||
| @@ -44,10 +45,8 @@ const ApplicantSelection = ({ | |||
| </div> | |||
| <div className="active-process-card-link"> | |||
| <a href="#"> | |||
| {(link && status === "Odrađen") ? "Detaljni izveštaj" : ""} | |||
| {(link && status !== "Odrađen") ? "Link do Google Meet-a" : ""} | |||
| </a> | |||
| {(status === "Odrađen") && <Link className="ad-details-buttons-link" to={"/candidates/" + id}>Detaljni izveštaja</Link>} | |||
| {(link && status !== "Odrađen") && <a href={link} className="ad-details-buttons-link">Link do Google Meet-a</a>} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -55,7 +54,7 @@ const ApplicantSelection = ({ | |||
| }; | |||
| ApplicantSelection.propTypes = { | |||
| id: PropTypes.number, | |||
| id: PropTypes.string, | |||
| levelNumber: PropTypes.number, | |||
| levelName: PropTypes.string, | |||
| schedguler: PropTypes.string, | |||
| @@ -43,7 +43,7 @@ const CandidateDetailsPage = () => { | |||
| }; | |||
| const getArray = () => { | |||
| let newArray = users.map(function (value) { | |||
| let newArray = users?.map(function (value) { | |||
| return { id: value.id, display: value.firstName + value.lastName }; | |||
| }); | |||
| @@ -51,7 +51,6 @@ const CandidateDetailsPage = () => { | |||
| }; | |||
| const tranformDisplay = (id, display) => { | |||
| console.log(id); | |||
| return "@" + display + " "; | |||
| }; | |||
| @@ -110,7 +109,7 @@ const CandidateDetailsPage = () => { | |||
| : "Experience:" + candidate.experience} | |||
| </p> | |||
| <div className="technologies-candidate-container"> | |||
| {candidate.technologyApplicants.map((obj, index) => ( | |||
| {candidate?.technologyApplicants?.map((obj, index) => ( | |||
| <div className="technology-candidate-card" key={index}> | |||
| {obj.technology.name} | |||
| </div> | |||
| @@ -167,7 +166,7 @@ const CandidateDetailsPage = () => { | |||
| }} | |||
| ref={messageContainer} | |||
| > | |||
| {candidate.comments.map((comment, index) => ( | |||
| {candidate?.comments?.map((comment, index) => ( | |||
| <div className="comment-sub-container" key={index}> | |||
| <div className="comment-sender"> | |||
| <p> | |||
| @@ -236,7 +235,7 @@ const CandidateDetailsPage = () => { | |||
| <div className="applicant-ads-container"> | |||
| <p>Sve prijave</p> | |||
| <div className="applicant-ads-sub-container"> | |||
| {candidate.ads.map((add, index) => ( | |||
| {candidate?.ads?.map((add, index) => ( | |||
| <div key={index} className="applicant-add"> | |||
| <p className="applicant-add-date"> | |||
| {formatDate(add.createdAt)} | |||
| @@ -35,7 +35,6 @@ const SelectionProcessOfApplicantPage = () => { | |||
| useEffect(() => { | |||
| dispatch(setApplicantProcessesReq(id)); | |||
| dispatch(setProcessesReq()); | |||
| console.log(processes) | |||
| }, []); | |||
| const handleToggleFiltersDrawer = () => { | |||
| @@ -90,25 +89,21 @@ const SelectionProcessOfApplicantPage = () => { | |||
| const concatLevels = () => { | |||
| const applicantSelections = []; | |||
| console.log(processes.length) | |||
| console.log(levels.length) | |||
| let i = processes.lengthdo | |||
| for (let i = processes.length; i < levels.length; i++) { | |||
| for (var i = processes.length; i < levels.length; i++) { | |||
| applicantSelections.push(<ApplicantSelection | |||
| levelNumber={levels[i].id} | |||
| levelName={levels[i].name} | |||
| schedguler={""} | |||
| date={""} | |||
| status={"Čeka na zakazivanje"} | |||
| id={id} | |||
| key={i} />); | |||
| } | |||
| applicantSelections.push(<ApplicantSelection key={i} className="hiddenAd" | |||
| } | |||
| applicantSelections.push(<ApplicantSelection key={i} className="hiddenAd" | |||
| date={""} />); | |||
| return applicantSelections; | |||
| }; | |||
| return ( | |||
| <> | |||
| <div className="l-t-rectangle"></div> | |||
| @@ -123,7 +118,14 @@ const SelectionProcessOfApplicantPage = () => { | |||
| {processes && processes.length > 0 && ( | |||
| <div className="active-ads"> | |||
| <div className="active-ads-header"> | |||
| <h1>{t("ads.activeAds")}</h1> | |||
| <h1>{t("selection.title")} | |||
| <span className="level-header-spliter"> | |||
| | | |||
| </span> | |||
| <span className="level-header-subheader"> | |||
| {id} | |||
| </span> | |||
| </h1> | |||
| <FilterButton onShowFilters={handleToggleFiltersDrawer} /> | |||
| </div> | |||
| <div className="active-ads-ads"> | |||
| @@ -147,18 +149,20 @@ const SelectionProcessOfApplicantPage = () => { | |||
| style={{ width: "100%" }} | |||
| ref={activeAdsSliderRef} | |||
| > | |||
| {processes.map((process, index) => ( | |||
| <ApplicantSelection | |||
| {processes.map((process, index) => | |||
| { | |||
| return <ApplicantSelection | |||
| levelNumber={index + 1} | |||
| levelName={process.selectionLevel.name} | |||
| schedguler={"SAfet Purkovic"} | |||
| link={process.link} | |||
| date={new Date(process.date)} | |||
| status={process.status} | |||
| id={id} | |||
| key={index} | |||
| className={index === processes.length - 1 ? "active-process" : ""} | |||
| /> | |||
| ))} | |||
| })} | |||
| {processes.length < levels.length && concatLevels()} | |||
| </Slider> | |||
| </div> | |||
| @@ -9,17 +9,17 @@ import { useDispatch } from "react-redux"; | |||
| import AdFilters from "../../components/Ads/AdFilters"; | |||
| import { setDoneProcess } from "../../store/actions/processes/processAction"; | |||
| import { setProcessesReq } from "../../store/actions/processes/processesAction"; | |||
| import { selectDoneProcess, selectDoneProcessError } from "../../store/selectors/processSelectors"; | |||
| import { selectProcesses, selectProcessesError } from "../../store/selectors/processesSelectors" | |||
| import { selectDoneProcess } from "../../store/selectors/processSelectors"; | |||
| import { selectProcesses } from "../../store/selectors/processesSelectors" | |||
| import PropTypes from "prop-types"; | |||
| const SelectionProcessPage = ({history}) => { | |||
| const [toggleFiltersDrawer, setToggleFiltersDrawer] = useState(false); | |||
| const [toggleModal, setToggleModal] = useState(false); | |||
| const errorMessage = useSelector(selectProcessesError); | |||
| // const errorMessage = useSelector(selectProcessesError); | |||
| const process = useSelector(selectDoneProcess); | |||
| const processes = useSelector(selectProcesses); | |||
| const doneErrorMessage = useSelector(selectDoneProcessError); | |||
| // const doneErrorMessage = useSelector(selectDoneProcessError); | |||
| const { t } = useTranslation(); | |||
| const dispatch = useDispatch(); | |||
| @@ -27,16 +27,12 @@ const SelectionProcessPage = ({history}) => { | |||
| dispatch(setProcessesReq()); | |||
| }, []); | |||
| console.log(process) | |||
| useEffect(() => { | |||
| dispatch(setProcessesReq()); | |||
| dispatch(setDoneProcess(false)); | |||
| },[process.process.doneProcess]) | |||
| console.log(errorMessage); | |||
| console.log(doneErrorMessage); | |||
| const handleToggleFiltersDrawer = () => { | |||
| setToggleFiltersDrawer((oldState) => !oldState); | |||
| }; | |||
| @@ -4,7 +4,6 @@ import loadingReducer from './loading/loadingReducer'; | |||
| import userReducer from './user/userReducer'; | |||
| import randomDataReducer from './randomData/randomDataReducer'; | |||
| import usersReducer from './user/usersReducer'; | |||
| import candidatesReducer from './candidates/candidatesReducer'; | |||
| import candidateReducer from './candidate/candidateReducer'; | |||
| import adsReducer from "./ad/adsReducer"; | |||
| import adReducer from "./ad/adReducer"; | |||
| @@ -20,7 +19,6 @@ export default combineReducers({ | |||
| loading: loadingReducer, | |||
| randomData: randomDataReducer, | |||
| users: usersReducer, | |||
| candidates:candidatesReducer, | |||
| candidate:candidateReducer, | |||
| ads: adsReducer, | |||
| ad: adReducer, | |||
| @@ -76,7 +76,6 @@ function* fetchUser({ payload }) { | |||
| function* forgetPassword({ payload }) { | |||
| try { | |||
| // console.log(payload) | |||
| const { data } = yield call(forgetPasswordEmailSend, payload); | |||
| yield put(forgetPasswordSuccess(data)); | |||
| if (payload.handleApiResponseSuccess) { | |||
| @@ -98,9 +97,7 @@ function* forgetPassword({ payload }) { | |||
| function* resetPassword({ payload }) { | |||
| try { | |||
| // console.log(payload) | |||
| const { data } = yield call(sendResetPassword, payload); | |||
| // console.log(data); | |||
| yield put(forgetPasswordSuccess(data)); | |||
| if (payload.handleApiResponseSuccess) { | |||
| yield call(payload.handleApiResponseSuccess); | |||
| @@ -26,7 +26,6 @@ export function* finishProcess(payload) { | |||
| export function* getApplicantProcesses(payload) { | |||
| try { | |||
| console.log(payload) | |||
| const id = payload.payload; | |||
| const result = yield call(getProcessesOfApplicant,id); | |||
| yield put(setApplicantProcesses(result.data.selectionProcesses)); | |||