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

Did more refactoring

File:
1 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>
Note: See TracChangeset for help on using the changeset viewer.