Skip to content

Commit fa70d7c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent cb6196f commit fa70d7c

File tree

5 files changed

+257
-229
lines changed

5 files changed

+257
-229
lines changed

frontend/src/components/CreateJobModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function CreateJobModal(props) {
6767
console.error(error);
6868
});
6969
};
70-
70+
7171
const submitNewJob = async (event) => {
7272
event.preventDefault();
7373
const formData = new FormData(event.target);

frontend/src/components/RecruiterApplicantsComponents.jsx

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
3-
import { Box, Checkbox, TableRow, TableCell, TableHead, TableSortLabel, Toolbar, Tooltip, IconButton, Typography, OutlinedInput, InputAdornment } from '@mui/material';
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import {
4+
Box,
5+
Checkbox,
6+
TableRow,
7+
TableCell,
8+
TableHead,
9+
TableSortLabel,
10+
Toolbar,
11+
Tooltip,
12+
IconButton,
13+
Typography,
14+
OutlinedInput,
15+
InputAdornment,
16+
} from "@mui/material";
417

518
// Label Component
619
const Label = ({ color, children }) => {
720
return (
821
<Box
922
sx={{
10-
display: 'inline-flex',
11-
alignItems: 'center',
12-
justifyContent: 'center',
13-
borderRadius: '8px',
23+
display: "inline-flex",
24+
alignItems: "center",
25+
justifyContent: "center",
26+
borderRadius: "8px",
1427
minWidth: 72,
1528
minHeight: 32,
1629
px: 1,
17-
color: 'white',
18-
backgroundColor: color === 'success' ? 'success.main' : 'error.main',
30+
color: "white",
31+
backgroundColor: color === "success" ? "success.main" : "error.main",
1932
}}
2033
>
2134
{children}
@@ -30,7 +43,18 @@ Label.propTypes = {
3043

3144
// Iconify Component
3245
const Iconify = ({ icon, width = 20, sx, ...other }) => (
33-
<Box component="span" sx={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width, height: width, ...sx }} {...other}>
46+
<Box
47+
component="span"
48+
sx={{
49+
display: "inline-flex",
50+
alignItems: "center",
51+
justifyContent: "center",
52+
width,
53+
height: width,
54+
...sx,
55+
}}
56+
{...other}
57+
>
3458
<i className={icon} />
3559
</Box>
3660
);
@@ -44,7 +68,7 @@ Iconify.propTypes = {
4468
// Scrollbar Component
4569
const Scrollbar = ({ children, sx, ...other }) => {
4670
return (
47-
<Box sx={{ overflowX: 'auto', ...sx }} {...other}>
71+
<Box sx={{ overflowX: "auto", ...sx }} {...other}>
4872
{children}
4973
</Box>
5074
);
@@ -103,28 +127,32 @@ const UserListHead = ({
103127
);
104128
};
105129

106-
107130
UserListHead.propTypes = {
108-
order: PropTypes.oneOf(['asc', 'desc']),
131+
order: PropTypes.oneOf(["asc", "desc"]),
109132
orderBy: PropTypes.string,
110133
rowCount: PropTypes.number,
111134
headLabel: PropTypes.array,
112135
numSelected: PropTypes.number,
113136
onRequestSort: PropTypes.func,
114137
onSelectAllClick: PropTypes.func,
115138
};
116-
const UserListToolbar = ({ numSelected, filterName, onFilterName, backgroundColor }) => {
139+
const UserListToolbar = ({
140+
numSelected,
141+
filterName,
142+
onFilterName,
143+
backgroundColor,
144+
}) => {
117145
return (
118146
<Toolbar
119147
sx={{
120148
height: 96,
121-
display: 'flex',
122-
justifyContent: 'space-between',
149+
display: "flex",
150+
justifyContent: "space-between",
123151
padding: 1,
124-
backgroundColor: 'background.paper', // Add this line to set the background color to white
152+
backgroundColor: "background.paper", // Add this line to set the background color to white
125153
...(numSelected > 0 && {
126-
color: 'primary.main',
127-
bgcolor: 'primary.lighter',
154+
color: "primary.main",
155+
bgcolor: "primary.lighter",
128156
}),
129157
}}
130158
>
@@ -139,19 +167,22 @@ const UserListToolbar = ({ numSelected, filterName, onFilterName, backgroundColo
139167
placeholder="Search applicant..."
140168
startAdornment={
141169
<InputAdornment position="start">
142-
<Iconify icon="eva:search-fill" sx={{ color: 'text.disabled', width: 20, height: 20 }} />
170+
<Iconify
171+
icon="eva:search-fill"
172+
sx={{ color: "text.disabled", width: 20, height: 20 }}
173+
/>
143174
</InputAdornment>
144175
}
145176
sx={{
146177
width: 240,
147-
transition: 'all 0.3s',
148-
'&.Mui-focused': {
178+
transition: "all 0.3s",
179+
"&.Mui-focused": {
149180
width: 320,
150181
boxShadow: 8,
151182
},
152-
'& fieldset': {
183+
"& fieldset": {
153184
borderWidth: `1px !important`,
154-
borderColor: 'rgba(0, 0, 0, 0.23) !important',
185+
borderColor: "rgba(0, 0, 0, 0.23) !important",
155186
},
156187
}}
157188
/>
@@ -166,5 +197,4 @@ UserListToolbar.propTypes = {
166197
onFilterName: PropTypes.func,
167198
};
168199

169-
170-
export { Label, Iconify, Scrollbar, UserListHead, UserListToolbar };
200+
export { Label, Iconify, Scrollbar, UserListHead, UserListToolbar };

frontend/src/pages/RecruiterApplicants.jsx

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@ const RecruiterApplicantsPage = () => {
4949

5050
const fetchJobs = async () => {
5151
try {
52-
const response = await fetch("https://chapi.techstartucalgary.com/jobs/me", {
53-
method: "GET",
54-
mode: "cors",
55-
headers: {
56-
"Content-Type": "application/json",
57-
Authorization: `Bearer ${localStorage.getItem("access_token")}`,
52+
const response = await fetch(
53+
"https://chapi.techstartucalgary.com/jobs/me",
54+
{
55+
method: "GET",
56+
mode: "cors",
57+
headers: {
58+
"Content-Type": "application/json",
59+
Authorization: `Bearer ${localStorage.getItem("access_token")}`,
60+
},
5861
},
59-
});
62+
);
6063

6164
if (response.ok) {
6265
const data = await response.json();
@@ -69,12 +72,12 @@ const RecruiterApplicantsPage = () => {
6972
console.error(error);
7073
}
7174
};
72-
75+
7376
const fetchApplicants = async (jobId) => {
7477
try {
7578
const idsToFetch = jobId ? [jobId] : jobIds;
7679
let allApplicants = [];
77-
80+
7881
for (const id of idsToFetch) {
7982
const response = await fetch(
8083
`https://chapi.techstartucalgary.com/applications/${id}`,
@@ -85,10 +88,9 @@ const RecruiterApplicantsPage = () => {
8588
"Content-Type": "application/json",
8689
Authorization: `Bearer ${localStorage.getItem("access_token")}`,
8790
},
88-
}
91+
},
8992
);
9093

91-
9294
if (response.status === 404) {
9395
setApplicants([]);
9496
} else {
@@ -102,17 +104,17 @@ const RecruiterApplicantsPage = () => {
102104
}
103105
}
104106
}
105-
107+
106108
setApplicants(allApplicants);
107109
} catch (error) {
108110
console.error(error);
109111
}
110112
};
111-
113+
112114
const downloadResume = (resume, filename) => {
113115
const element = document.createElement("a");
114116
element.href = URL.createObjectURL(
115-
new Blob([resume], { type: "application/pdf" })
117+
new Blob([resume], { type: "application/pdf" }),
116118
);
117119
element.download = filename;
118120
document.body.appendChild(element);
@@ -127,7 +129,7 @@ const RecruiterApplicantsPage = () => {
127129
const filteredApplicants = applicants.filter((applicant) =>
128130
`${applicant.applicant.first_name} ${applicant.applicant.last_name}`
129131
.toLowerCase()
130-
.includes(filterName.toLowerCase())
132+
.includes(filterName.toLowerCase()),
131133
);
132134

133135
const handleDialogOpen = (row) => {
@@ -154,11 +156,11 @@ const RecruiterApplicantsPage = () => {
154156
new_status: dialogData.application_status.status,
155157
rejection_feedback: dialogData.application_status.feedback,
156158
}),
157-
}
159+
},
158160
);
159-
161+
160162
if (response.ok) {
161-
fetchApplicants();
163+
fetchApplicants();
162164
handleDialogClose();
163165
} else {
164166
console.error("Failed to update the status");
@@ -167,23 +169,20 @@ const RecruiterApplicantsPage = () => {
167169
console.error(error);
168170
}
169171
};
170-
171172

172173
return (
173174
<Container maxWidth="lg">
174-
175-
<Box
176-
sx={{
177-
pb: 5,
178-
minHeight: "100px",
179-
borderRadius: "10px", // Testing - For now added inline styling
180-
boxShadow: 1,
181-
bgcolor: "background.page",
182-
marginTop: "30px",
183-
184-
}}
185-
>
186-
<UserListToolbar
175+
<Box
176+
sx={{
177+
pb: 5,
178+
minHeight: "100px",
179+
borderRadius: "10px", // Testing - For now added inline styling
180+
boxShadow: 1,
181+
bgcolor: "background.page",
182+
marginTop: "30px",
183+
}}
184+
>
185+
<UserListToolbar
187186
filterName={filterName}
188187
onFilterName={handleFilterByName}
189188
/>
@@ -195,7 +194,6 @@ const RecruiterApplicantsPage = () => {
195194
order="asc"
196195
orderBy="name"
197196
headLabel={[
198-
199197
{ id: "name", label: "Name", alignRight: false },
200198
{ id: "role", label: "Role", alignRight: false },
201199
{ id: "status", label: "Status", alignRight: false },
@@ -207,8 +205,8 @@ const RecruiterApplicantsPage = () => {
207205
/>
208206
<TableBody>
209207
{filteredApplicants.map((row) => (
210-
<TableRow key={row.user_profile_id} tabIndex={-1} >
211-
<TableCell component="th" scope="row" padding="none" >
208+
<TableRow key={row.user_profile_id} tabIndex={-1}>
209+
<TableCell component="th" scope="row" padding="none">
212210
<img
213211
src={
214212
row.applicant.profile_picture
@@ -226,23 +224,23 @@ const RecruiterApplicantsPage = () => {
226224
/>
227225
</TableCell>
228226

229-
<TableCell component="th" scope="row" padding="none">
230-
<Typography
231-
variant="body1"
232-
sx={{
233-
margin: 0,
234-
fontWeight: 600,
235-
lineHeight: 1.57142,
236-
fontSize: "0.875rem",
237-
fontFamily: "Public Sans, sans-serif",
238-
overflow: "hidden",
239-
textOverflow: "ellipsis",
240-
whiteSpace: "nowrap",
241-
}}
242-
>
243-
{`${row.applicant.first_name} ${row.applicant.last_name}`}
244-
</Typography>
245-
</TableCell>
227+
<TableCell component="th" scope="row" padding="none">
228+
<Typography
229+
variant="body1"
230+
sx={{
231+
margin: 0,
232+
fontWeight: 600,
233+
lineHeight: 1.57142,
234+
fontSize: "0.875rem",
235+
fontFamily: "Public Sans, sans-serif",
236+
overflow: "hidden",
237+
textOverflow: "ellipsis",
238+
whiteSpace: "nowrap",
239+
}}
240+
>
241+
{`${row.applicant.first_name} ${row.applicant.last_name}`}
242+
</Typography>
243+
</TableCell>
246244

247245
<TableCell>{row.job.title}</TableCell>
248246
<TableCell>
@@ -263,7 +261,7 @@ const RecruiterApplicantsPage = () => {
263261
e.preventDefault();
264262
downloadResume(
265263
row.applicant.resume,
266-
`${row.applicant.first_name}_${row.applicant.last_name}_Resume.pdf`
264+
`${row.applicant.first_name}_${row.applicant.last_name}_Resume.pdf`,
267265
);
268266
}}
269267
>
@@ -272,12 +270,16 @@ const RecruiterApplicantsPage = () => {
272270
</TableCell>
273271
<TableCell>
274272
<Button
275-
variant="outlined"
276-
onClick={() => handleDialogOpen(row)}
277-
sx={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}
278-
>
279-
Update Status
280-
</Button>
273+
variant="outlined"
274+
onClick={() => handleDialogOpen(row)}
275+
sx={{
276+
whiteSpace: "nowrap",
277+
overflow: "hidden",
278+
textOverflow: "ellipsis",
279+
}}
280+
>
281+
Update Status
282+
</Button>
281283
</TableCell>
282284
</TableRow>
283285
))}

0 commit comments

Comments
 (0)