Skip to content

Commit

Permalink
Merge pull request #328 from SELab-2/last_last_bugs
Browse files Browse the repository at this point in the history
grootte dialog restricties
  • Loading branch information
Bendemeurichy authored May 23, 2024
2 parents d77d4d6 + f7041f2 commit a21ab44
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export default function RestrictionsDialog({
}}
>
<Typography
width={150}
width={200}
textOverflow={'ellipsis'}
>
{template.bestand.replace(
Expand Down
42 changes: 40 additions & 2 deletions frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -360,6 +393,7 @@ export function SubmissionPage() {
{t('filename')}
</Typography>
<Button
disabled={loading || submission?.status === 0}
id="downloadButton"
startIcon={<DownloadIcon />}
onClick={downloadSubmission}
Expand Down Expand Up @@ -442,8 +476,12 @@ export function SubmissionPage() {
}
>
{restriction.moet_slagen
? t('must_pass')
: t('may_fail')}
? t(
'must_pass'
)
: t(
'may_fail'
)}
</Typography>
{restriction.artifact && (
<Button
Expand Down

0 comments on commit a21ab44

Please sign in to comment.