Skip to content

Commit

Permalink
Merge branch 'frontend' into test_page_update
Browse files Browse the repository at this point in the history
# Conflicts:
#	frontend/src/components/forms/projectFormTabs/DockerFormTab.tsx
  • Loading branch information
Triver1 committed May 23, 2024
2 parents 8e0f1f7 + ca76d0b commit 51881a3
Show file tree
Hide file tree
Showing 180 changed files with 13,137 additions and 2,278 deletions.
21 changes: 13 additions & 8 deletions .env-template
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
backend/app/src/main/resources/application-secrets.properties,spring.datasource.username=<username>
backend/app/src/main/resources/application-secrets.properties,spring.datasource.password=<password>
backend/app/src/main/resources/application-secrets.properties,azure.activedirectory.client-id=<client-id>
backend/app/src/main/resources/application-secrets.properties,azure.activedirectory.b2c.client-secret=<client-secret>
backend/app/src/main/resources/application-secrets.properties,azure.activedirectory.tenant-id=<tenant-id>
docker.env,PGU=<username>
docker.env,PGP=<password>
docker.env,POSTGRES_USER=${PGU}
client-secret=<your-client-secret>
client-id=<your-client-id>
tenant-id=<your-tenant-id>
PGU=<your-postgres-user>
PGP=<your-postgres-password>
POSTGRES_USER=${PGU}
URI=<your-uri>
EXPRESS_SESSION_SECRET=<your-express-session-secret>
PORT=<your-port>
ENVIRONMENT=<your-environment>
DB_HOST=<your-db-host>
DB_PORT=<your-db-port>
DB_NAME=<your-db-name>
File renamed without changes.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
backend/web-bff/App/.env.dev

HELP.md
.gradle
build/
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# UGent-6
![badge](https://github.com/SELab-2/UGent-6/actions/workflows/backend_testing.yaml/badge.svg)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)


| Student | E-mailadres |
----------------------------------------------------|-----------------------------|
| [Matthias Vaneyck](https://github.com/Matthias-VE) | [email protected] |
| [Inti Danschutter](https://github.com/Aqua-sc) | [email protected] |
| [Arthur Werbrouck](https://github.com/AWerbrouck) | [email protected] |
| [Arne Dierick](https://github.com/arnedierick) | [email protected] |
| [Wout Verdyck](https://github.com/usserwoutV2) | [email protected] |
| [Floris Kornelis Van Dijken](https://github.com/badduck32) | [email protected] |
| [Tristan Verbeken](https://github.com/TR1VER) | [email protected]|


https://github.com/SELab-2/UGent-6/wiki
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public ResponseEntity<?> createClusterForCourse(@PathVariable("courseid") Long c
}

/**
* Returns all groups for a cluster
* Get cluster by ID
*
* @param clusterid identifier of a cluster
* @param auth authentication object of the requesting user
Expand Down Expand Up @@ -193,9 +193,9 @@ public ResponseEntity<?> doGroupClusterUpdate(GroupClusterEntity clusterEntity,
*
* @param clusterid identifier of a cluster
* @param auth authentication object of the requesting user
* @param clusterFillMap Map object containing a map of all groups and their
* members of that cluster
* @param clusterFillMap Map object containing a map of all groups and their members of that cluster
* @return ResponseEntity<?>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-7431004">apiDog documentation</a>
* @HttpMethod PUT
* @ApiPath /api/clusters/{clusterid}/fill
* @AllowedRoles student, teacher
Expand Down Expand Up @@ -243,7 +243,18 @@ public ResponseEntity<?> fillCluster(@PathVariable("clusterid") Long clusterid,
}
}


/**
* Updates a cluster
*
* @param clusterid identifier of a cluster
* @param auth authentication object of the requesting user
* @param clusterJson ClusterJson object containing the cluster data
* @return ResponseEntity<?>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883519">apiDog documentation</a>
* @HttpMethod PATCH
* @ApiPath /api/clusters/{clusterid}
* @AllowedRoles student, teacher
*/
@PatchMapping(ApiRoutes.CLUSTER_BASE_PATH + "/{clusterid}")
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> patchCluster(@PathVariable("clusterid") Long clusterid, Auth auth, @RequestBody GroupClusterUpdateJson clusterJson) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ public ResponseEntity<?> updateCourse(@RequestBody CourseJson courseJson, @PathV
}
}

/**
* Function to update a course
*
* @param courseJson JSON object containing the course name and description
* @param courseId ID of the course to update
* @param auth authentication object of the requesting user
* @return ResponseEntity with the updated course entity
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-6678309">apiDog documentation</a>
* @HttpMethod PATCH
* @AllowedRoles teacher, student
* @ApiPath /api/courses/{courseId}
*/
@PatchMapping(ApiRoutes.COURSE_BASE_PATH + "/{courseId}")
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> patchCourse(@RequestBody CourseJson courseJson, @PathVariable long courseId, Auth auth) {
Expand Down Expand Up @@ -417,7 +429,7 @@ public ResponseEntity<?> joinCourse(Auth auth, @PathVariable Long courseId) {
* @param auth authentication object of the requesting user
* @param courseId ID of the course to get the join key from
* @return ResponseEntity with a statuscode and a JSON object containing the course information
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-6698822">apiDog documentation</a>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-6768820">apiDog documentation</a>
* @HttpMethod GET
* @AllowedRoles teacher, student
* @ApiPath /api/courses/{courseId}/join
Expand Down Expand Up @@ -496,7 +508,7 @@ private ResponseEntity<?> doRemoveFromCourse(
* @param courseId ID of the course to add the user to
* @param request JSON object containing the user id and relation
* @return ResponseEntity with a statuscode and no body
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883723">apiDog documentation</a>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-6697093">apiDog documentation</a>
* @HttpMethod POST
* @AllowedRoles teacher, admin, student
* @ApiPath /api/courses/{courseId}/members
Expand Down Expand Up @@ -680,6 +692,17 @@ public ResponseEntity<String> deleteCourseKey(Auth auth, @PathVariable Long cour
return ResponseEntity.ok("");
}

/**
* Function to copy a course
*
* @param courseId ID of the course to copy
* @param auth authentication object of the requesting user
* @return ResponseEntity with the copied course entity
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-7254402">apiDog documentation</a>
* @HttpMethod POST
* @AllowedRoles teacher
* @ApiPath /api/courses/{courseId}/copy
*/
@PostMapping(ApiRoutes.COURSE_BASE_PATH + "/{courseId}/copy")
@Roles({UserRole.teacher})
@Transactional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ public class GroupController {

/**
* Function to get a group by its identifier
* @param groupid
* @param auth
* @return
* @param groupid identifier of a group
* @param auth authentication object of the requesting user
* @return ResponseEntity<GroupJson>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5723981">apiDog documentation</a>
* @HttpMethod GET
* @AllowedRoles student, teacher
* @ApiPath /api/groups/{groupid}
*/
@GetMapping(ApiRoutes.GROUP_BASE_PATH + "/{groupid}")
@Roles({UserRole.student, UserRole.teacher})
Expand Down Expand Up @@ -75,7 +79,7 @@ public ResponseEntity<?> getGroupById(@PathVariable("groupid") Long groupid, Aut
* @param auth authentication object of the requesting user
* @return ResponseEntity<GroupJson>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5723995">apiDog documentation</a>
* @HttpMethod Put
* @HttpMethod PUT
* @AllowedRoles teacher
* @ApiPath /api/groups/{groupid}
*/
Expand All @@ -93,7 +97,7 @@ public ResponseEntity<?> updateGroupName(@PathVariable("groupid") Long groupid,
* @param auth authentication object of the requesting user
* @return ResponseEntity<GroupJson>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883691">apiDog documentation</a>
* @HttpMethod Patch
* @HttpMethod PATCH
* @AllowedRoles teacher
* @ApiPath /api/groups/{groupid}
*/
Expand Down Expand Up @@ -136,7 +140,7 @@ private ResponseEntity<?> doGroupNameUpdate(Long groupid, NameRequest nameReques
* @param auth authentication object of the requesting user
* @return ResponseEntity<Void>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5723998">apiDog documentation</a>
* @HttpMethod Delete
* @HttpMethod DELETE
* @AllowedRoles teacher, student
* @ApiPath /api/groups/{groupid}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class GroupFeedbackController {
* @param auth authentication object of the requesting user
* @return ResponseEntity<String>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883691">apiDog documentation</a>
* @HttpMethod Patch
* @HttpMethod PATCH
* @AllowedRoles teacher, student
* @ApiPath /api/projects/{projectid}/groups/{groupid}/score
*/
Expand Down Expand Up @@ -83,6 +83,18 @@ public ResponseEntity<?> updateGroupScore(@PathVariable("groupid") long groupId,
return doGroupFeedbackUpdate(groupFeedbackEntity, request);
}

/**
* Function to delete the score of a group
*
* @param groupId identifier of a group
* @param projectId identifier of a project
* @param auth authentication object of the requesting user
* @return ResponseEntity<String>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-7436586">apiDog documentation</a>
* @HttpMethod Delete
* @AllowedRoles teacher, student
* @ApiPath /api/projects/{projectid}/groups/{groupid}/score
*/
@DeleteMapping(ApiRoutes.GROUP_FEEDBACK_PATH)
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> deleteGroupScore(@PathVariable("groupid") long groupId, @PathVariable("projectid") long projectId, Auth auth) {
Expand All @@ -99,6 +111,19 @@ public ResponseEntity<?> deleteGroupScore(@PathVariable("groupid") long groupId,
}
}

/**
* Function to update the score of a group
*
* @param groupId identifier of a group
* @param projectId identifier of a project
* @param request request object containing the new score
* @param auth authentication object of the requesting user
* @return ResponseEntity<String>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883690">apiDog documentation</a>
* @HttpMethod PUT
* @AllowedRoles teacher, student
* @ApiPath /api/projects/{projectid}/groups/{groupid}/score
*/
@PutMapping(ApiRoutes.GROUP_FEEDBACK_PATH)
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> updateGroupScorePut(@PathVariable("groupid") long groupId, @PathVariable("projectid") long projectId, @RequestBody UpdateGroupScoreRequest request, Auth auth) {
Expand Down Expand Up @@ -136,8 +161,8 @@ public ResponseEntity<?> doGroupFeedbackUpdate(GroupFeedbackEntity groupFeedback
* @param request request object containing the new score
* @param auth authentication object of the requesting user
* @return ResponseEntity<String>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883691">apiDog documentation</a>
* @HttpMethod Post
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-6697044">apiDog documentation</a>
* @HttpMethod POST
* @AllowedRoles teacher, student
* @ApiPath /api/groups/{groupid}/projects/{projectid}/feedback
*/
Expand Down Expand Up @@ -174,7 +199,7 @@ public ResponseEntity<?> addGroupScore(@PathVariable("groupid") long groupId, @P
* @param projectId identifier of a project
* @param auth authentication object of the requesting user
* @return ResponseEntity<Object>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883689">apiDog documentation</a>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-7436611">apiDog documentation</a>
* @HttpMethod Get
* @AllowedRoles teacher, student
* @ApiPath /api/projects/{projectid}/groups/{groupid}/score
Expand Down Expand Up @@ -203,6 +228,17 @@ public ResponseEntity<Object> getGroupScore(@PathVariable("groupid") long groupI
return ResponseEntity.ok(entityToJsonConverter.groupFeedbackEntityToJson(groupFeedbackEntity));
}

/**
* Function to get the grades of a course
*
* @param courseId identifier of a course
* @param auth authentication object of the requesting user
* @return ResponseEntity<Object>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-7436985">apiDog documentation</a>
* @HttpMethod Get
* @AllowedRoles teacher, student
* @ApiPath /api/courses/{courseId}/grades
*/
@GetMapping(ApiRoutes.COURSE_BASE_PATH + "/{courseId}/grades")
@Roles({UserRole.teacher, UserRole.student})
public ResponseEntity<?> getCourseGrades(@PathVariable("courseId") long courseId, Auth auth) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public ResponseEntity<String> removeMemberFromGroup(@PathVariable("groupid") lon
* @param groupId ID of the group to remove the member from
* @param auth authentication object of the requesting user
* @return ResponseEntity with a string message about the operation result
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883809">apiDog documentation</a>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-7437010">apiDog documentation</a>
* @HttpMethod DELETE
* @AllowedRoles teacher, student
* @ApiPath /api/groups/{groupid}/members
Expand Down Expand Up @@ -128,7 +128,7 @@ public ResponseEntity<Object> addMemberToGroup(@PathVariable("groupid") long gro
* @param groupId ID of the group to add the member to
* @param auth authentication object of the requesting user
* @return ResponseEntity with a list of UserJson objects containing the members of the group
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883807">apiDog documentation</a>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-7437022">apiDog documentation</a>
* @HttpMethod POST
* @AllowedRoles teacher, student
* @ApiPath /api/groups/{groupid}/members
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ProjectController {
/**
* Function to get all projects of a user
* @param auth authentication object of the requesting user
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5883808">apiDog documentation</a>
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-6362262">apiDog documentation</a>
* @HttpMethod GET
* @AllowedRoles teacher, student
* @ApiPath /api/projects
Expand Down Expand Up @@ -206,7 +206,7 @@ private ResponseEntity<?> doProjectUpdate(ProjectEntity project, ProjectJson pro
* @param projectJson ProjectUpdateDTO object containing the new project's information
* @param auth authentication object of the requesting user
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5723887">apiDog documentation</a>
* @HttpMethod Put
* @HttpMethod PUT
* @AllowedRoles teacher
* @ApiPath /api/projects/{projectId}
* @return ResponseEntity with the created project
Expand Down Expand Up @@ -243,7 +243,7 @@ public ResponseEntity<?> putProjectById(@PathVariable Long projectId, @RequestBo
* @param projectJson ProjectUpdateDTO object containing the new project's information
* @param auth authentication object of the requesting user
* @ApiDog <a href="https://apidog.com/apidoc/project-467959/api-5723887">apiDog documentation</a>
* @HttpMethod Patch
* @HttpMethod PATCH
* @AllowedRoles teacher
* @ApiPath /api/projects/{projectId}
* @return ResponseEntity with the created project
Expand Down
Loading

0 comments on commit 51881a3

Please sign in to comment.