diff --git a/frontend/frontend/src/pages/addChangeAssignmentPage/RestrictionsDialog.tsx b/frontend/frontend/src/pages/addChangeAssignmentPage/RestrictionsDialog.tsx index 67a5d2ff..d127f588 100644 --- a/frontend/frontend/src/pages/addChangeAssignmentPage/RestrictionsDialog.tsx +++ b/frontend/frontend/src/pages/addChangeAssignmentPage/RestrictionsDialog.tsx @@ -306,7 +306,7 @@ export default function RestrictionsDialog({ }} > {template.bestand.replace( diff --git a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx index 9ccc0935..d8195f21 100644 --- a/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx +++ b/frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx @@ -191,6 +191,39 @@ export function SubmissionPage() { console.log('Data:', response.data) } else { console.log('Status is not 0, stopping requests.') + const submission = response.data + if ( + submission.status !== SubmissionStatus.PENDING && + submission.result !== 'No tests: OK' + ) { + const match = submission.result.match(/Testing.*/) + submission.result = match ? match[0] : submission.result + } + submission.filename = submission.bestand.replace( + /^.*[\\/]/, + '' + ) + submission.bestand = await instance + .get( + `/indieningen/${submissionId}/indiening_bestand/`, + { + responseType: 'blob', + } + ) + .then((res) => { + let filename = 'indiening.zip' + if (submission.filename) { + filename = submission.filename + } + const blob = new Blob([res.data], { + type: res.headers['content-type'], + }) + const file: File = new File([blob], filename, { + type: res.headers['content-type'], + }) + return file + }) + setSubmission(submission) clearInterval(intervalId) } } catch (err) { @@ -360,6 +393,7 @@ export function SubmissionPage() { {t('filename')}