Skip to content

Commit b1423a2

Browse files
authored
make download resume button functional and also fix some prettier issues (#167)
Signed-off-by: Kashish Mittal <[email protected]>
1 parent 7265ae9 commit b1423a2

File tree

3 files changed

+23
-6
lines changed
  • client/src/components
    • job-application-component/box-row-component
    • job-applications-view-component

3 files changed

+23
-6
lines changed

client/src/components/job-application-component/box-row-component/index.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { IMaskInput } from "react-imask";
1313
import PropTypes from "prop-types";
1414
import { BoxDivider } from "./index.styles";
1515
import ApplicationStatusChipComponent from "../../shared/application-status-chips";
16+
import { getResumeUrl } from "../../../utils/job_applications_api";
1617

1718
const TextMaskCustom = React.forwardRef(function TextMaskCustom(
1819
{ onChange, name, ...other },
@@ -51,6 +52,15 @@ function BoxRowComponent({
5152
isLast,
5253
}) {
5354
const [selectedValue, setSelectedValue] = useState(rightSide[0]);
55+
const handleDownload = async (resume) => {
56+
const presignedUrlObject = await getResumeUrl(resume);
57+
const presignedUrl = presignedUrlObject.resume_url;
58+
if (!presignedUrl) {
59+
console.error("Failed to retrieve the presigned URL.");
60+
return;
61+
}
62+
window.open(presignedUrl, "_blank");
63+
};
5464

5565
return (
5666
<>
@@ -109,7 +119,9 @@ function BoxRowComponent({
109119
<DownloadIcon
110120
sx={{ color: "#1565c0", cursor: "pointer" }}
111121
align="right"
112-
onClick={() => {}}
122+
onClick={() => {
123+
handleDownload(rightSide);
124+
}}
113125
/>
114126
)}
115127
</div>

client/src/components/job-applications-view-component/job-application-dashboard/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ JobApplicationDashboard.propTypes = {
173173
jobApplicationQuery: PropTypes.shape({
174174
rows: PropTypes.number.isRequired,
175175
page: PropTypes.number.isRequired,
176-
job_posting_id: PropTypes.oneOfType([PropTypes.string, PropTypes.number, null]),
176+
job_posting_id: PropTypes.oneOfType([
177+
PropTypes.string,
178+
PropTypes.number,
179+
null,
180+
]),
177181
name: PropTypes.oneOfType([PropTypes.string, null]),
178182
job_title: PropTypes.oneOfType([PropTypes.string, null]),
179183
sort: PropTypes.string.isRequired,

client/src/components/job-applications-view-component/job-application-table-component/index.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ function JobApplicationsTable({
9696
</Link>
9797
</ContentTableCell>
9898

99-
<ContentTableCell>
100-
{row.name}
101-
</ContentTableCell>
99+
<ContentTableCell>{row.name}</ContentTableCell>
102100

103101
<ContentTableCell>{row.email}</ContentTableCell>
104102

@@ -147,7 +145,10 @@ function JobApplicationsTable({
147145
handlePageRowChange({ page: parseInt(newPage, 10) })
148146
}
149147
onRowsPerPageChange={(e) => {
150-
handlePageRowChange({ rows: parseInt(e.target.value, 10), page: 0 });
148+
handlePageRowChange({
149+
rows: parseInt(e.target.value, 10),
150+
page: 0,
151+
});
151152
}}
152153
/>
153154
</TableCell>

0 commit comments

Comments
 (0)