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

Did more refactoring

Location:
jobvista-frontend/src/views
Files:
10 added
15 edited
1 moved

Legend:

Unmodified
Added
Removed
  • jobvista-frontend/src/views/admin_panel/AdminPanel.css

    rbefb988 r08f82ec  
    33}
    44
     5.table tbody tr:nth-child(even) {
     6    background-color: #fff; /* Light gray */
     7}
     8
     9.table tbody tr:nth-child(odd) {
     10    background-color: #f2f2f2; /* White */
     11}
    512/* The switch - the box around the slider */
    613.switch {
  • jobvista-frontend/src/views/admin_panel/AdminPanel.js

    rbefb988 r08f82ec  
    5454    return (
    5555        <div className="custom-container mt-5">
    56             <table className="table table-striped">
     56            <table className="table">
    5757                <thead>
    5858                <tr>
  • 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>
  • jobvista-frontend/src/views/auth/SignUpRecruiterForm.js

    rbefb988 r08f82ec  
    1313    const schema = yup.object().shape({
    1414        companyNameReg: yup.string().required("Company name is required."),
    15         phoneNumberReg: yup.number().required("Phone number is required"),
     15        phoneNumberReg: yup.string().required("Phone number is required"),
    1616        companyEmailReg: yup.string().required("Email is required.").email("Email is not valid."),
    1717        passwordReg: yup.string().min(6, "Password must be at least 6 characters.").required("Password is required."),
     
    3232                    //     theme: success ? 'success' : 'error'
    3333                    // });
    34                     success && navigate("/");
     34                    success && navigate("/no-access");
    3535                }));
    3636        } catch (err) {
  • jobvista-frontend/src/views/dashboard/Dashboard.js

    rbefb988 r08f82ec  
    3434
    3535
    36 
    37     // const [user, setUser] = useState(null);
    38     //
    39     // useEffect(() => {
    40     //     const token = localStorage.getItem(AUTH_TOKEN);
    41     //     if (token!=null) {
    42     //         try {
    43     //             const decodedToken = jwtDecode(token);
    44     //             setUser({
    45     //                 name: decodedToken.name,
    46     //                 role: decodedToken.role,
    47     //                 hasAccess: decodedToken.access,
    48     //             });
    49     //         } catch (error) {
    50     //             console.error('Failed to decode token', error);
    51     //         }
    52     //     }
    53     //     console.log(user)
    54     // }, [auth]);
    55 
    56     // useEffect(() => {
    57     //     if (auth) {
    58     //         setRole(auth.role);
    59     //     }
    60     //     console.log(props)
    61     // }, [auth]);
    62 
    6336    useEffect(() => {
    6437        if (!jobDispatched && jobAdvertisementsState.length == 0) {
     
    7245
    7346        } else {
    74             setJobAdvertisements(jobAdvertisementsState)
     47            setJobAdvertisements(sortElementsBy(jobAdvertisementsState, "postedOn"))
    7548            console.log("Fetch all job advertisements STATE")
    7649
     
    160133                    jobAdvertisements.map((jobAd, index) => (
    161134                        <div key={index} className="col">
    162                             <div className="custom-card">
     135                            <div className="custom-card dashboard-card">
    163136                                <div className="card-head">
    164137                                    <span className="hourly-salary"><b>${jobAd.startingSalary}/hr</b></span>
     
    187160                                    </div>
    188161
    189                                     <div className="aligned">
    190                                         <Link to={`/job-advertisements/${jobAd.id}`} className="card-button">Read
    191                                             more</Link>
    192                                     </div>
    193 
     162                                </div>
     163                                <div className="card-foot">
     164                                    <Link to={`/job-advertisements/${jobAd.id}`} className="card-button">Read
     165                                        more</Link>
    194166                                </div>
    195167                            </div>
  • jobvista-frontend/src/views/job_advertisements/AddJobAdModal.js

    rbefb988 r08f82ec  
    4343
    4444    const addJobAdvertisement = async (values) => {
    45         //const description = values.description.replace(/\n/g, "\\n");
    4645        try {
    4746            dispatch(JobAdvertisementActions.addJobAdvertisement(
     
    5554                    jobType: values.jobType.value,
    5655                    employmentStatus: values.employmentStatus.value,
    57                 }, (success, response) => {
     56                }, (success) => {
    5857                    if (success) {
    59                         // console.log("Job Advertisement added")
    6058                        toggleModal()
    6159                        notifyJobAdPost()
  • jobvista-frontend/src/views/job_advertisements/DeleteJobAdModal.js

    rbefb988 r08f82ec  
    2626    };
    2727
    28     const addJobAdvertisement = async () => {
     28    const deleteJobAdvertisement = async () => {
    2929        try {
    30             dispatch(JobAdvertisementActions.deleteJobAdvertisement(jobAd.props.id, (success, response) => {
     30            dispatch(JobAdvertisementActions.deleteJobAdvertisement(jobAd.props.id, (success) => {
    3131                if (success) {
    32                     // console.log("Job Advertisement deleted")
    3332                    toggleModal()
    3433                    notifyJobAdDelete()
     
    5453                <div className="modal-delete-buttons">
    5554                    <button className="cancel-btn" onClick={toggleModal}>Cancel</button>
    56                     <button className="delete-btn" onClick={addJobAdvertisement}> Delete</button>
     55                    <button className="delete-btn" onClick={deleteJobAdvertisement}> Delete</button>
    5756                </div>
    5857            </div>
  • jobvista-frontend/src/views/job_advertisements/EditJobAdModal.js

    rbefb988 r08f82ec  
    5454                    jobType: values.jobType.value,
    5555                    employmentStatus: values.employmentStatus.value,
    56                 }, jobAd.props.id, (success, response) => {
     56                }, jobAd.props.id, (success) => {
    5757                    if(success) {
    58                         // console.log("Job Advertisement edited")
    5958                        toggleModal()
    6059                        notifyJobAdEdit()
  • jobvista-frontend/src/views/job_advertisements/JobAdDetails.css

    rbefb988 r08f82ec  
    2020    /*scrollbar-width: thin; !* "auto" hides scrollbar on some browsers, "thin" shows a thin scrollbar *!*/
    2121    /*scrollbar-color: #999999 #fff;*/
     22}
     23
     24.min-wrap {
     25    min-height: 80vh;
    2226}
    2327
  • jobvista-frontend/src/views/job_advertisements/JobAdDetails.js

    rbefb988 r08f82ec  
    6363        <div className="row">
    6464            <div className="col-md-9">
    65                 <div className="details-wrap">
     65                <div className="details-wrap min-wrap">
    6666                    <div className="row">
    6767                        <div className="col-md-9">
  • jobvista-frontend/src/views/job_advertisements/JobManagementHub.js

    rbefb988 r08f82ec  
    6666
    6767    let filterJobAdvertisements = () => {
    68         JobAdvertisementActions.filterJobAdvertisementsByRecruiter({
     68        JobAdvertisementActions.filterJobAdvertisementsByRecruiter(auth.id, {
    6969            searchTerm: searchTerm, industry: selectedIndustry, sortOrder: selectedSortOrder
    7070        }, (success, response) => {
     
    127127                {jobAdvertisementsByRecruiter && jobAdvertisementsByRecruiter.map((jobAd, index) => (
    128128                    <div key={index} className="col">
    129                         <div className="custom-card">
     129                        <div className="custom-card hub-card">
    130130                            <div className="card-head">
    131131                                <span className="hourly-salary"><b>${jobAd.startingSalary}/hr</b></span>
     
    150150                                </div>
    151151
    152                                 <div className="aligned">
    153                                     <Link to={`/job-management-hub/applications/${jobAd.id}`}
    154                                           className="card-button solo">View applications</Link>
    155                                 </div>
     152                            </div>
    156153
     154
     155                            <div className="card-foot">
     156                                <Link to={`/job-management-hub/applications/${jobAd.id}`}
     157                                      className="card-button">View applications</Link>
    157158                            </div>
    158159                        </div>
  • jobvista-frontend/src/views/shared_css/Modal.css

    rbefb988 r08f82ec  
    8989.application-textarea {
    9090    height: 100px;
     91    /*margin-bottom: 20px;*/
    9192}
    9293
  • jobvista-frontend/src/views/static/Header.css

    rbefb988 r08f82ec  
    1919
    2020.navbar {
    21     width: calc(100% - 17px);
     21    width: 100%;
    2222    height: 80px;
    2323    background-color: #f8f9fa;
Note: See TracChangeset for help on using the changeset viewer.