Skip to content

Commit

Permalink
Merge pull request #320 from SELab-2/last_last_bugs
Browse files Browse the repository at this point in the history
regex + filename
  • Loading branch information
Bendemeurichy authored May 23, 2024
2 parents 0273bad + 1a9e80e commit f8f3f17
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,10 @@ export function SubmissionPage() {
newSubmission.status !== SubmissionStatus.PENDING &&
newSubmission.result !== 'No tests: OK'
) {
const regex = /Testing (.*)$/
const matches = newSubmission.result.match(regex)
if (matches !== null) {
newSubmission.result = matches[0]
}
const match = newSubmission.result.match(/Testing.*/)
newSubmission.result = match
? match[0]
: newSubmission.result
}
newSubmission.filename =
submissionResponse.data.bestand.replace(/^.*[\\/]/, '')
Expand Down Expand Up @@ -423,9 +422,10 @@ export function SubmissionPage() {
'bold'
}
>
{
restriction.script
}
{restriction.script.replace(
/^.*[\\/]/,
''
)}
</Typography>
<Typography
variant={
Expand Down

0 comments on commit f8f3f17

Please sign in to comment.