File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed
job-application-component/box-row-component
job-applications-view-component
job-application-dashboard
job-application-table-component Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { IMaskInput } from "react-imask";
1313import PropTypes from "prop-types" ;
1414import { BoxDivider } from "./index.styles" ;
1515import ApplicationStatusChipComponent from "../../shared/application-status-chips" ;
16+ import { getResumeUrl } from "../../../utils/job_applications_api" ;
1617
1718const 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 >
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments