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

Frontend #295

Merged
merged 106 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
5c90d5e
React readme removal
Triver1 May 20, 2024
877bf12
Bug fixes
usserwoutV2 May 20, 2024
31e3de2
Added breadcrumbs
usserwoutV2 May 20, 2024
b4b2607
Fixed alignment of breadcrumbs in project edit page
usserwoutV2 May 20, 2024
378bcb4
Sort projects for coursecard + small backend fix
Aqua-sc May 21, 2024
8326a04
Small backend fix for template docker feedback
Aqua-sc May 21, 2024
2da12e9
More bug fixes
usserwoutV2 May 21, 2024
d176929
Small fix to backend
Aqua-sc May 21, 2024
2e9dbca
Even more bug fixes
usserwoutV2 May 21, 2024
4a8dd03
Updated submission page
usserwoutV2 May 21, 2024
6bf44c5
Improved submission page
usserwoutV2 May 21, 2024
0a1ed77
Update user object when role changes
usserwoutV2 May 21, 2024
b34da36
added more info to project page
arnedierick May 21, 2024
19058de
small changes to project info and added homepage title logic based on…
arnedierick May 21, 2024
bf2be71
done
badduck32 May 21, 2024
3d43dd1
Updated tooltips and made changes to docker tests page so it is as cl…
Triver1 May 21, 2024
d6cbe8e
Merge branch 'frontend' into test_page_update
Triver1 May 21, 2024
063ff74
done
badduck32 May 22, 2024
cea07e9
debug dingen veranderd
badduck32 May 22, 2024
7bd211c
Fix for tests
Aqua-sc May 22, 2024
1ae569a
Fix for sturcturefeedback + admin submit after deadline
Aqua-sc May 22, 2024
f4adc8d
Fix test
Aqua-sc May 22, 2024
9f12dde
fixed multiline feedback input and rendering
arnedierick May 22, 2024
16bdc2b
Merge branch 'frontend' of https://github.com/SELab-2/UGent-6 into fr…
arnedierick May 22, 2024
8954d71
added hovering, removed ellipsis
badduck32 May 22, 2024
f3021c3
fix graphical bug with "en" appearing under the globe icon
badduck32 May 22, 2024
54fbab3
download changes
badduck32 May 22, 2024
8af988f
Merge pull request #285 from SELab-2/batch-download-change
usserwoutV2 May 22, 2024
8aa0954
Merge pull request #284 from SELab-2/language-dropdown-fix
usserwoutV2 May 22, 2024
91702c1
Fixed hover background for light mode
usserwoutV2 May 22, 2024
1c0011b
Made dark theme hover background less light
usserwoutV2 May 22, 2024
bf8a8e8
Cleanup messages
Aqua-sc May 22, 2024
5c46196
typos fixed
badduck32 May 22, 2024
43af6cb
Full width coursecard highlight's on hover
Aqua-sc May 22, 2024
5aac1fb
Merge pull request #283 from SELab-2/course-card-update
Aqua-sc May 22, 2024
f1fd99b
Merge pull request #282 from SELab-2/test_page_update
Aqua-sc May 22, 2024
f41ea5c
fixed margin for save feedback button
Aqua-sc May 22, 2024
afbe2a3
Merge branch 'frontend' of https://github.com/SELab-2/UGent-6 into fr…
Aqua-sc May 22, 2024
1784bc1
Make template switch smaller
Aqua-sc May 22, 2024
1509256
ProjectForm upgrades
Aqua-sc May 22, 2024
f74d29f
Add number to submission title + crumb
Aqua-sc May 22, 2024
8dd4b6e
Merge pull request #281 from SELab-2/sorting-fix
Aqua-sc May 22, 2024
c748cd3
Bug fixes / improvements
usserwoutV2 May 22, 2024
bd9bc66
Fixed bug in dockerTabForm
usserwoutV2 May 22, 2024
cbaf4a5
Add option to escape outputs to dockerfeedback
Aqua-sc May 22, 2024
af28d6e
Change courses title on homepage
Aqua-sc May 22, 2024
3b83a51
temp changes @matthias help me :sob:
Triver1 May 22, 2024
c7d19de
Fixed what's visible on home screen
Aqua-sc May 22, 2024
5c24c05
Fixed textfield input
Matthias-VE May 22, 2024
1e7ede3
remove wahoo
Matthias-VE May 22, 2024
5f3843f
Revert "remove wahoo"
Matthias-VE May 22, 2024
90f47f9
Revert "Fixed textfield input"
Matthias-VE May 22, 2024
9643c2b
working but now with form states instead of react states
Matthias-VE May 22, 2024
684d4d7
made weekdays more pronounced
badduck32 May 22, 2024
6cb0de8
Merge pull request #287 from SELab-2/calendar-fix
Aqua-sc May 22, 2024
6ae2142
Change height of homepage scrollbar
Aqua-sc May 22, 2024
b6b58e2
changes with invite link
badduck32 May 23, 2024
73e6610
onnodigheden verwijderd
badduck32 May 23, 2024
86b4f31
fixed padding for projectcard
Aqua-sc May 23, 2024
536b15c
Added create group btn
usserwoutV2 May 23, 2024
2b9ef03
You can delete group clusters
usserwoutV2 May 23, 2024
afca1c8
Fixed issue with score
usserwoutV2 May 23, 2024
35d3f62
added docker icons
Triver1 May 23, 2024
cc5538a
Cancel button + noscore not in edit
Aqua-sc May 23, 2024
a1f5cdc
small fixes
Aqua-sc May 23, 2024
22b1167
Added extra line to template info
Aqua-sc May 23, 2024
e20eac3
edited the share button in the modal popup
badduck32 May 23, 2024
81ebeea
Merge pull request #292 from SELab-2/edit-feedback-update
badduck32 May 23, 2024
74f8423
Fixed copy button in model
Aqua-sc May 23, 2024
a51ccd7
small fixes
Aqua-sc May 23, 2024
71454ae
fixed submission index
Aqua-sc May 23, 2024
5762ec0
Negative score will show frontend error message
usserwoutV2 May 23, 2024
088e14b
Added border to modals (dark mode)
usserwoutV2 May 23, 2024
873cbfd
Improved delete confirmPopup for removing clusters
usserwoutV2 May 23, 2024
a66e1da
fix select correct role on dropdown
Aqua-sc May 23, 2024
2889d62
Merge branch 'frontend' of https://github.com/SELab-2/UGent-6 into fr…
Aqua-sc May 23, 2024
9bb9c2f
Removed useless console logs
usserwoutV2 May 23, 2024
902dd97
fix merge conflicts dev/frontend
Matthias-VE May 23, 2024
03823d4
Merge branch 'frontend' of https://github.com/SELab-2/UGent-6 into fr…
Matthias-VE May 23, 2024
ee76fb2
FIxed Collapse switching when deleting cluster
usserwoutV2 May 23, 2024
fa4c176
sort groups
Aqua-sc May 23, 2024
76b9dac
Merge branch 'frontend' of https://github.com/SELab-2/UGent-6 into fr…
Aqua-sc May 23, 2024
e7956a3
Stop propagation on cancel deletecluster
Aqua-sc May 23, 2024
b3da71d
Merge pull request #288 from SELab-2/share-fix
Aqua-sc May 23, 2024
76f9efc
update dockertestdirtooltip
Aqua-sc May 23, 2024
ca76d0b
Merge branch 'frontend' of https://github.com/SELab-2/UGent-6 into fr…
Aqua-sc May 23, 2024
8e0f1f7
added container menu dropdown
Triver1 May 23, 2024
1ae37c3
made the search bar cleaner and fixed some minor bugs
badduck32 May 23, 2024
51881a3
Merge branch 'frontend' into test_page_update
Triver1 May 23, 2024
6a544db
start docker toggle fix
Aqua-sc May 22, 2024
90bf392
Fixed requested issue (I think)
usserwoutV2 May 22, 2024
6c90413
Attempt 2 to fix docker mode switch
usserwoutV2 May 22, 2024
3470f1b
Fixed docker form not always saving
usserwoutV2 May 23, 2024
9bd9b31
Fixed typescript err
usserwoutV2 May 23, 2024
368c6f7
start docker toggle fix
Aqua-sc May 22, 2024
75667d7
Fixed requested issue (I think)
usserwoutV2 May 22, 2024
c7ec782
Attempt 2 to fix docker mode switch
usserwoutV2 May 22, 2024
1f786b1
Fixed docker form not always saving
usserwoutV2 May 23, 2024
eace8d9
Fixed so can't change own file
Aqua-sc May 23, 2024
b145026
Fixed 100 000 merge conflicts
usserwoutV2 May 23, 2024
b2e85a3
Fix test failure
Aqua-sc May 23, 2024
87c9415
Fix error message edit role
Aqua-sc May 23, 2024
caea261
Merge pull request #294 from SELab-2/search-bar-fix
Aqua-sc May 23, 2024
90642fc
Merge pull request #293 from SELab-2/test_page_update
Aqua-sc May 23, 2024
3410bd8
Merge branch 'development' into frontend
Aqua-sc May 23, 2024
ce6dd2c
Merge branch 'frontend' of https://github.com/SELab-2/UGent-6 into fr…
Aqua-sc May 23, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ private Map<Long, Optional<SubmissionEntity>> getLatestSubmissionsForProject(lon
@GetMapping(ApiRoutes.PROJECT_BASE_PATH + "/{projectid}/submissions") //Route to get all submissions for a project
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> getSubmissions(@PathVariable("projectid") long projectid, Auth auth) {
try {
CheckResult<Void> checkResult = projectUtil.isProjectAdmin(projectid, auth.getUserEntity());
if (!checkResult.getStatus().equals(HttpStatus.OK)) {
return ResponseEntity.status(checkResult.getStatus()).body(checkResult.getMessage());
Expand Down Expand Up @@ -170,9 +169,6 @@ public ResponseEntity<?> getSubmissions(@PathVariable("projectid") long projecti
}

return ResponseEntity.ok(res);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(e.getMessage());
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class GroupFeedbackJson {

private float score;
private Float score;
private String feedback;

private long groupId;
Expand All @@ -11,15 +11,15 @@ public class GroupFeedbackJson {
public GroupFeedbackJson() {
}

public GroupFeedbackJson(float score, String feedback, long groupId, long projectId) {
public GroupFeedbackJson(Float score, String feedback, long groupId, long projectId) {
this.score = score;
this.feedback = feedback;
this.groupId = groupId;
this.projectId = projectId;
}


public float getScore() {
public Float getScore() {
return score;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ public class GroupFeedbackJsonWithProject {
private String projectUrl;
private GroupFeedbackJson groupFeedback;

private float maxScore;
private Integer maxScore;
private Long projectId;


public GroupFeedbackJsonWithProject(String projectName, String projectUrl, Long projectId,
GroupFeedbackJson groupFeedback, float maxScore) {
GroupFeedbackJson groupFeedback, Integer maxScore) {
this.projectName = projectName;
this.projectUrl = projectUrl;
this.groupFeedback = groupFeedback;
Expand Down Expand Up @@ -43,11 +43,11 @@ public void setGroupFeedback(GroupFeedbackJson groupFeedback) {
this.groupFeedback = groupFeedback;
}

public float getMaxScore() {
public Integer getMaxScore() {
return maxScore;
}

public void setMaxScore(float maxScore) {
public void setMaxScore(Integer maxScore) {
this.maxScore = maxScore;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.ugent.pidgeon.model.submissionTesting;

import java.util.List;
import java.util.logging.Logger;
import org.hibernate.usertype.LoggableUserType;

public class DockerTemplateTestOutput implements DockerOutput{
private final List<DockerSubtestResult> subtestResults;
Expand All @@ -24,9 +26,12 @@ public String getFeedbackAsString(){
//json representation of the tests
StringBuilder feedback = new StringBuilder("{\"subtests\": [");
for (DockerSubtestResult subtestResult : subtestResults) {
feedback.append(subtestResult.getFeedbackAsString()).append(",");
feedback.append(subtestResult.getFeedbackAsString())
.append(",");
}
feedback.append("]");
feedback.deleteCharAt(feedback.length() - 1); // remove last comma ,
feedback.append("]}");
Logger.getGlobal().info(feedback.toString());
return feedback.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@ public SubmissionResult checkSubmission(ZipFile file) throws IOException {
boolean passed = (filesMissing.size() + filesUnrequested.size() + filesDenied.size()) == 0;
String feedback = passed ? "File structure is correct" : "File structure failed to pass the template, because: \n ";
if (!filesMissing.isEmpty()) {
feedback += " -The following files are required from the template and are not found in the project: \n -";
feedback += String.join("\n -", filesMissing);
feedback += "- The following files are required from the template and are not found in the project: \n - ";
feedback += String.join("\n - ", filesMissing);
}
if (!filesUnrequested.isEmpty()) {
feedback += "\n -The following files are not requested in the template: \n -";
feedback += String.join("\n -", filesUnrequested);
feedback += "\n - The following files are not requested in the template: \n - ";
feedback += String.join("\n - ", filesUnrequested);
}
if (!filesDenied.isEmpty()) {
feedback += "\n -The following files are not allowed in the project: \n -";
feedback += String.join("\n -", filesDenied);
feedback += "\n - The following files are not allowed in the project: \n - ";
feedback += String.join("\n - ", filesDenied);
}

return new SubmissionResult(passed, feedback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public String getFeedback() {
}


public float getScore() {
public Float getScore() {
return grade;
}

public void setScore(float score) {
public void setScore(Float score) {
this.grade = score;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public CheckResult<Long> checkOnSubmit(long projectId, UserEntity user) {

OffsetDateTime time = OffsetDateTime.now();
Logger.getGlobal().info("Time: " + time + " Deadline: " + project.getDeadline());
if (time.isAfter(project.getDeadline())) {
if (time.isAfter(project.getDeadline()) && groupId != null) {
return new CheckResult<>(HttpStatus.FORBIDDEN, "Project deadline has passed", null);
}
return new CheckResult<>(HttpStatus.OK, "", groupId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.ugent.pidgeon.postgre.models.TestEntity;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.zip.ZipFile;
Expand Down Expand Up @@ -40,8 +41,12 @@ public DockerOutput runDockerTest(ZipFile file, TestEntity testEntity, Path outp
// Init container and add input files
try {


model.addZipInputFiles(file);
model.addUtilFiles(Filehandler.getTestExtraFilesPath(projectId).resolve(Filehandler.EXTRA_TESTFILES_FILENAME));
Path path = Filehandler.getTestExtraFilesPath(projectId).resolve(Filehandler.EXTRA_TESTFILES_FILENAME);
if (Files.exists(path)) {
model.addUtilFiles(path);
}
DockerOutput output;

if (testTemplate == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public void testAddGroupScore() throws Exception {
when(groupFeedbackUtil.checkGroupFeedbackUpdate(groupFeedbackEntity.getGroupId(), groupFeedbackEntity.getProjectId(), getMockUser(), HttpMethod.POST))
.thenReturn(new CheckResult<>(HttpStatus.OK, "", null));
when(groupFeedbackUtil.checkGroupFeedbackUpdateJson(argThat(
json -> json.getScore() == groupFeedbackEntity.getScore() && json.getFeedback().equals(groupFeedbackEntity.getFeedback())), eq(groupFeedbackEntity.getProjectId())))
json -> Objects.equals(json.getScore(), groupFeedbackEntity.getScore()) && json.getFeedback().equals(groupFeedbackEntity.getFeedback())), eq(groupFeedbackEntity.getProjectId())))
.thenReturn(new CheckResult<>(HttpStatus.OK, "", null));
when(groupFeedbackRepository.save(any())).thenReturn(groupFeedbackEntity);
when(entityToJsonConverter.groupFeedbackEntityToJson(groupFeedbackEntity)).thenReturn(groupFeedbackJson);
Expand All @@ -288,7 +288,7 @@ public void testAddGroupScore() throws Exception {
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(content().json(objectMapper.writeValueAsString(groupFeedbackJson)));
verify(groupFeedbackRepository, times(1)).save(argThat(
groupFeedback -> groupFeedback.getScore() == groupFeedbackEntity.getScore() &&
groupFeedback -> Objects.equals(groupFeedback.getScore(), groupFeedbackEntity.getScore()) &&
groupFeedback.getFeedback().equals(groupFeedbackEntity.getFeedback()) &&
groupFeedback.getGroupId() == groupFeedbackEntity.getGroupId() &&
groupFeedback.getProjectId() == groupFeedbackEntity.getProjectId()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public void testCheckOnSubmit() {
result = submissionUtil.checkOnSubmit(projectEntity.getId(), userEntity);
assertEquals(HttpStatus.OK, result.getStatus());
assertNull(result.getData());

/* Deadline passed when user is admin, should still be allowed */
projectEntity.setDeadline(OffsetDateTime.now().minusDays(1));
result = submissionUtil.checkOnSubmit(projectEntity.getId(), userEntity);
assertEquals(HttpStatus.OK, result.getStatus());

/* User not part of group and not admin */
when(projectUtil.isProjectAdmin(projectEntity.getId(), userEntity))
Expand All @@ -168,6 +173,7 @@ public void testCheckOnSubmit() {
result = submissionUtil.checkOnSubmit(projectEntity.getId(), userEntity);
assertEquals(HttpStatus.FORBIDDEN, result.getStatus());


/* GroupCluster in archived course */
when(groupClusterRepository.inArchivedCourse(groupEntity.getClusterId())).thenReturn(true);
result = submissionUtil.checkOnSubmit(projectEntity.getId(), userEntity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public void testRunDockerTest() throws IOException {

verify(dockerModel, times(1)).addZipInputFiles(file);
verify(dockerModel, times(1)).cleanUp();
verify(dockerModel, times(1)).addUtilFiles(extraFilesPathResolved);
assertEquals(1, filehandlerCalled.get());

/* artifacts are empty */
Expand All @@ -128,7 +127,6 @@ public void testRunDockerTest() throws IOException {
assertEquals(dockerTemplateTestOutput, result);
verify(dockerModel, times(2)).addZipInputFiles(file);
verify(dockerModel, times(2)).cleanUp();
verify(dockerModel, times(2)).addUtilFiles(extraFilesPathResolved);
assertEquals(1, filehandlerCalled.get());

/* aritifacts are null */
Expand All @@ -137,7 +135,6 @@ public void testRunDockerTest() throws IOException {
assertEquals(dockerTemplateTestOutput, result);
verify(dockerModel, times(3)).addZipInputFiles(file);
verify(dockerModel, times(3)).cleanUp();
verify(dockerModel, times(3)).addUtilFiles(extraFilesPathResolved);
assertEquals(1, filehandlerCalled.get());

/* No template */
Expand All @@ -147,7 +144,6 @@ public void testRunDockerTest() throws IOException {
assertEquals(dockerTestOutput, result);
verify(dockerModel, times(4)).addZipInputFiles(file);
verify(dockerModel, times(4)).cleanUp();
verify(dockerModel, times(4)).addUtilFiles(extraFilesPathResolved);

/* Error gets thrown */
when(dockerModel.runSubmission(testEntity.getDockerTestScript())).thenThrow(new RuntimeException("Error"));
Expand Down
Binary file not shown.
44 changes: 0 additions & 44 deletions frontend/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="Official UGent submission platform. Effortlessly manage courses and projects, automatically test and assess code."
/>
<link rel="apple-touch-icon" href="/logo192.png" />

Expand Down
1 change: 1 addition & 0 deletions frontend/public/docker_langauges/bash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/public/docker_langauges/custom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/public/docker_langauges/haskell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/public/docker_langauges/node-js.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/public/docker_langauges/python.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading