Skip to content

Commit

Permalink
Merge pull request #271 from SELab-2/frontend
Browse files Browse the repository at this point in the history
Merge frontend into dev.
  • Loading branch information
AWerbrouck authored May 19, 2024
2 parents b5036c9 + c88d48b commit 613ed0e
Show file tree
Hide file tree
Showing 79 changed files with 3,822 additions and 2,178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedMethods("*")
.allowedOrigins("*")
.exposedHeaders("Content-Disposition")
.allowedHeaders("*");

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

Expand Down Expand Up @@ -172,6 +173,7 @@ public ResponseEntity<?> getSubmissions(@PathVariable("projectid") long projecti
*/
@PostMapping(ApiRoutes.PROJECT_BASE_PATH + "/{projectid}/submit")
//Route to submit a file, it accepts a multiform with the file and submissionTime
@Transactional
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> submitFile(@RequestParam("file") MultipartFile file, @PathVariable("projectid") long projectid, Auth auth) {
long userId = auth.getUserEntity().getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public CheckResult<Pair<TestEntity, ProjectEntity>> checkForTestUpdate(
return new CheckResult<>(HttpStatus.BAD_REQUEST, "A docker image is required if u add a script", null);
}

// This returns false if the image isn't pullt yet! FIX PLS
if(dockerImage != null && !DockerSubmissionTestModel.imageExists(dockerImage)) {
return new CheckResult<>(HttpStatus.BAD_REQUEST, "A valid docker image is required in a docker test.", null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public void testSubmitFile() throws Exception {
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(content().json(objectMapper.writeValueAsString(submissionJson)));

Thread.sleep(1000);
Thread.sleep(2000);

assertTrue(submission.getDockerAccepted());
assertEquals("dockerFeedback-test", submission.getDockerFeedback());
Expand Down
1 change: 1 addition & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.pnp
.pnp.js
package-lock.json
/package-lock.json

# testing
/coverage
Expand Down
Loading

0 comments on commit 613ed0e

Please sign in to comment.