Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regex op de output van een automatische test om enkel de geteste best… #284

Merged
merged 1 commit into from
May 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,28 @@ export function SubmissionPage() {
)
setRestrictions(restrictions.data)

const submissionResponse = await instance.get(`indieningen/${submissionId}/`)
const submissionResponse = await instance.get(
`indieningen/${submissionId}/`
)
//Get the submission file
const newSubmission: Submission = submissionResponse.data
newSubmission.filename = submissionResponse.data.bestand.replace(
/^.*[\\/]/,
''
)
if (newSubmission.result !== 'No tests: OK') {
const regex = /Testing (.*):/g
const matches = newSubmission.result.match(regex)
if (matches !== null) {
matches.map((match) => {
match.replace(':', '\n')
return match
})
}
}
newSubmission.filename =
submissionResponse.data.bestand.replace(/^.*[\\/]/, '')
newSubmission.bestand = await instance
.get(`/indieningen/${submissionId}/indiening_bestand`, {
responseType: 'blob',
}).then((res) => {
})
.then((res) => {
let filename = 'indiening.zip'
if (newSubmission.filename) {
filename = newSubmission.filename
Expand Down