Ignore:
Timestamp:
06/20/24 11:57:13 (13 days ago)
Author:
223021 <daniel.ilievski.2@…>
Branches:
main
Children:
0f0add0
Parents:
befb988
Message:

Did more refactoring

Location:
jobvista-frontend/src/views/applications
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • jobvista-frontend/src/views/applications/ApplicationDetailsModal.js

    rbefb988 r08f82ec  
    3232
    3333    useEffect(() => {
    34         if(application) {
    35             dispatch(ApplicationActions.downloadResume(application.fileName, (success, response) => {
    36                 if(success) {
     34        if (application) {
     35            ApplicationActions.downloadResume(application.id, (success, response) => {
     36                if (success) {
    3737                    setResumeUrl(response);
    3838                }
    39             }))
     39            })
    4040        }
    41     }, [application])
     41    }, [])
     42
     43    function getFileName(path) {
     44        let fileName = path.split('\\').pop().split('/').pop();
     45
     46        fileName = fileName.trim();
     47
     48        return fileName;
     49    }
    4250
    4351    return (<div className="modal-wrap">
    4452        <button onClick={toggleModal} className="application-button">View application</button>
    45         <Modal open={modal} onClose={toggleModal} center >
     53        <Modal open={modal} onClose={toggleModal} center>
    4654            <div className="head-modal">
    4755                <h3>{application.jobSeekerName}'s application for {application.jobAdTitle}</h3>
     
    4957            </div>
    5058
    51             <div className="modal-content" >
     59            <div className="modal-content">
    5260                <form>
    5361                    <div className="row">
    5462                        <div className="col-md-6">
    5563                            <label className="label">Why are you interested in joining our company?</label>
    56                             <textarea disabled type="text" defaultValue={application.questionAnswers[0]} disabled placeholder="Write your answer here..." className="application-textarea"/>
    57 
    58 
     64                            <textarea disabled type="text" defaultValue={application.questionAnswers[0]} disabled
     65                                      placeholder="Write your answer here..." className="application-textarea"/>
     66                            <br/><br/>
    5967                            <label className="label">What makes you a good fit for this position?</label>
    60                             <textarea disabled type="text" defaultValue={application.questionAnswers[1]}  placeholder="Write your answer here..." className="application-textarea"/>
    61 
    62 
    63                             <label className="label">What do you hope to achieve in your first 6 months in this role?</label>
    64                             <textarea disabled type="text" defaultValue={application.questionAnswers[2]}  placeholder="Write your answer here..." className="application-textarea"/>
     68                            <textarea disabled type="text" defaultValue={application.questionAnswers[1]}
     69                                      placeholder="Write your answer here..." className="application-textarea"/>
     70                            <br/><br/>
     71                            <label className="label">What do you hope to achieve in your first 6 months in this
     72                                role?</label>
     73                            <textarea disabled type="text" defaultValue={application.questionAnswers[2]}
     74                                      placeholder="Write your answer here..." className="application-textarea"/>
    6575
    6676                        </div>
     
    6878                            <label htmlFor="start">Curriculum vitae (CV)</label>
    6979                            <br/>
    70                             <a className="resume-link" href={resumeUrl} target="_blank" rel="noopener noreferrer">{application.fileName}</a>
     80                            <a className="resume-link" href={resumeUrl} target="_blank"
     81                               rel="noopener noreferrer">{getFileName(application.fileName)}</a>
    7182                            <br/>
    7283
    7384                            <br/>
    7485                            <label className="label">Message to the recruiter</label>
    75                             <textarea disabled type="text" defaultValue={application.message} placeholder="Optional..." className="application-textarea"/>
     86                            <textarea disabled type="text" defaultValue={application.message} placeholder="Optional..."
     87                                      className="application-textarea"/>
    7688
    7789                        </div>
  • jobvista-frontend/src/views/applications/Applications.css

    rbefb988 r08f82ec  
    3232    padding: 20px 20px;
    3333    display: flex;
    34     justify-content: center;
    35     gap: 20px;
     34    /*justify-content: center;*/
     35    /*gap: 20px;*/
    3636    margin: 15px 0;
    3737    /*z-index: -1000;*/
     
    3939.application-card .app-job-seeker-pic {
    4040    border: 1px solid gray;
    41     border-radius: 50%
     41    border-radius: 50%;
     42    margin-right: 20px;
    4243}
    4344.application-card .app-job-seeker-pic img {
     
    4546}
    4647
     48.application-card .app-company-logo {
     49    width: 8%;
     50}
     51
    4752.application-card .app-info {
    48     width: 60%;
     53    width: 65%;
    4954    display: inline-flex;
    5055    flex-direction: column;
     
    5661.application-card .app-info .jobAd-title {
    5762    font-weight: 600;
     63    font-size: 1.2rem;
    5864    /*text-transform: uppercase;*/
    5965    font-family: 'Segoe UI', sans-serif;
    60     /*font-size: 22px;*/
     66    text-decoration: none;
     67    color: black
    6168}
    62 .application-card .app-info .jobAd-title
     69
     70.
    6371
    6472.application-card .app-info .contact-info {
     
    7886
    7987.application-card .app-status {
    80     width: 40%;
     88    width: 28%;
    8189    display: inline-flex;
    8290    justify-content: end;
  • jobvista-frontend/src/views/applications/ApplicationsByJobSeeker.js

    rbefb988 r08f82ec  
    77import {RecruiterActions} from "../../redux/actions/recruiterActions";
    88import {sortElementsBy} from "../../utils/utils";
     9import {Link} from "react-router-dom";
    910
    1011export const ApplicationsByJobSeeker = () => {
     
    9798
    9899                    <div className="app-info">
    99                         <div className="jobAd-title">{application.jobAdTitle}</div>
     100                        <Link to={`/job-advertisements/${application.jobAdId}`} className="jobAd-title">{application.jobAdTitle}</Link>
     101                        {/*<h5 className="jobAd-title"></h5>*/}
    100102                        <div className="contact-info">
    101103                            <div className="contact-item">
  • jobvista-frontend/src/views/applications/ApplyToJobAdModal.js

    rbefb988 r08f82ec  
    5151
    5252            dispatch(ApplicationActions.submitApplication(
    53                 formData,(success, response) => {
    54                     if(success) {
     53                formData, (success) => {
     54                    if (success) {
    5555                        toggleModal()
    5656                        notifyJobAdApply()
     
    6666
    6767    return (<div className="modal-wrap">
    68         {role===Roles.JOBSEEKER &&
     68        {role === Roles.JOBSEEKER &&
    6969            <>
    70                 {jobAd.active && <button onClick={toggleModal} className="apply-button apply">Apply now</button> }
    71                 {!jobAd.active && <button className="card-button apply disabled">Apply now</button> }
     70                {jobAd.active && <button onClick={toggleModal} className="apply-button apply">Apply now</button>}
     71                {!jobAd.active && <button className="card-button apply disabled">Apply now</button>}
    7272            </>
    7373        }
    74         <Modal open={modal} onClose={toggleModal} center >
     74        <Modal open={modal} onClose={toggleModal} center>
    7575            <div className="head-modal">
    7676                <h3>Applying to {jobAd.title} at {jobAd.recruiterName}</h3>
     
    7878            </div>
    7979
    80             <div className="modal-content" >
     80            <div className="modal-content">
    8181                <form onSubmit={handleSubmit(submitApplication)}>
    8282                    <div className="row">
     
    9292                            <p style={{color: "red"}}>{errors.answerTwo?.message}</p>
    9393
    94                             <label className="label">What do you hope to achieve in your first 6 months in this role?</label>
    95                             <textarea type="text"  placeholder="Write your answer here..."
    96                                    {...register("answerThree")} className="application-textarea"/>
     94                            <label className="label">What do you hope to achieve in your first 6 months in this
     95                                role?</label>
     96                            <textarea type="text" placeholder="Write your answer here..."
     97                                      {...register("answerThree")} className="application-textarea"/>
    9798                            <p style={{color: "red"}}>{errors.answerThree?.message}</p>
    9899
     
    101102                            <label htmlFor="start">Curriculum vitae (CV)</label>
    102103                            <br/>
    103                             <input {...register("file")} className="resume-link" onChange={(e) => setResumeFile(e.target.files[0])} required type="file" id="fileUpload" accept=".pdf"/>
     104                            <input {...register("file")} className="resume-link"
     105                                   onChange={(e) => setResumeFile(e.target.files[0])} required type="file"
     106                                   id="fileUpload" accept=".pdf"/>
    104107
    105108                            <br/>
     
    109112
    110113                            <br/><br/>
    111                             <p style={{color: "red"}}>Please note that your personal data from your account will be used to identify and process your application.</p>
     114                            <p style={{color: "red"}}>Please note that your personal data from your account will be used
     115                                to identify and process your application.</p>
    112116                        </div>
    113117                    </div>
Note: See TracChangeset for help on using the changeset viewer.