18311 Commits

Author SHA1 Message Date
6d8af3b191 Merge branch 'develop' into opponent-completion
# Conflicts:
#	test-data/src/main/java/se/su/dsv/scipro/testdata/DataInitializer.java
2025-03-04 12:40:05 +01:00
17192f9eb9 Handle the case with no test data populators ()
Since there is no populator yet Spring fails when trying to inject since it does not support empty collections. Mark the dependency as optional until we have at least one populator at which point we can simply the code again.

Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-03-04 06:12:15 +01:00
a76b317b1c Improve test data creation ()
Currently there is only one class used to add test data; [`DataInitializer`](b9f7dd5a49/core/src/main/java/se/su/dsv/scipro/DataInitializer.java). That class is already very large and causes a lot of merge conflicts when multiple changes are in the pipeline as noted by .

This change makes it possible to have multiple classes adding test data so that each change adds its own class and thus there are no conflicts. It also has the benefit of making each class smaller and more self-contained for testing a specific feature.

Some additional infrastructure was added in the form of the `BaseData` and `Factory` (naming improvements notwithstanding) interfaces to help each class add its own test data and re-use common data.

Finally all test data related classes have been moved to their own module so they can be properly excluded when building for production but are included by default while developing.

Fixes 

## Future work
* Add a mechanism to work with date and time.
    Many processes (and therefore service method implementations) rely on the time between certain events. For example a final seminar must be scheduled a set amount of days in advance. In the ideal world, the test data is populated using these service methods to more accurately represent an achievable real world state. Therefore there must be a way to manipulate time when adding test data.
* Add more methods to the `Factory` interface as we discover more common steps that many populators must take.
* Add more base data available through the `BaseData` interface as we discover more common data that many populators need
    Care must be taken that this data is final and useful in its base state since populators will rely on that state.

Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-03-03 12:38:35 +01:00
7f9e72484a Remove unused javax.inject and jersey-hk2 dependencies ()
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-03-03 07:59:14 +01:00
a71eeb5e2c Fix crash when editing an application period ()
Fixes 

## How to test
1. Log in as admin
2. Go to "Match / Application periods"
3. Click the edit icon (6th column)
4. Click "Save"

Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-03-03 07:48:46 +01:00
ec70ea5596 Make session serializable ()
When re-deploying the application, or restarting Tomcat, it will attempt to serialize the active sessions to prevent users from getting logged out and losing in-progess work. This requires that all attributes that are stored in the session implement `java.io.Serializable`. Spring stores the entire security context in the session which includes a reference to the principal, and that principal may be of type "WicketControlledPrincipal" and it must therefore be serializable.

## How to test
1. Be on the `develop` branch
2. Make sure session preservation is turned on (in IntelliJ check "Preserve sessions across restarts and redeploys", or read https://tomcat.apache.org/tomcat-10.0-doc/config/manager.html#Persistence_Across_Restarts)
3. Log in as the default admin `dev@localhost`
4. Switch to "Sture Student" under "Admin / Users / Switch user"
5. Restart Tomcat
6. Refresh page and you'll be prompted to log in again
7. Switch to this branch and repeat step 1-6

Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-03-03 07:32:25 +01:00
d0fb2e721c Merge branch 'develop' into opponent-completion
# Conflicts:
#	core/src/main/java/se/su/dsv/scipro/DataInitializer.java
2025-02-21 14:14:21 +01:00
e71aa8120c Grading boundaries are wrong in supervisor view ()
They display old hard-coded text that does not reflect the current template.

Fixes 

Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Reviewed-on: 
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
2025-02-21 14:06:29 +01:00
03570fc6db Improve supervisor change integration ()
Previously when we wanted to change supervisor we had to make two calls against the daisy api.
A DELETE and a POST, this was brittle because if one of the calls failed we didn't have a good way of handling that.
This could leave the application in a state where a project could end up with 2 different supervisors.
This caused side effects and forced us to manually go into the databases and clean up the errors.

Now the daisy api is updated and we only need to do a POST to change the supervisor. See further documentation here
[POST /thesis/{id}/contributor](https://apitest.dsv.su.se/resource_Theses.html#resource_Theses_postContributor_id_projectParticipant_POST)

### IMPORTANT: Release needs to be synced with Daisy API

Reviewed-on: 
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
2025-02-21 00:27:22 +01:00
b7cf87d6d3 Fix CVE-2024-57699 by override transitive dependency version ()
The overriding should be removed once Spring Security updates its dependencies.

Fixes 

## How to test
1. Run `mvnw install org.owasp:dependency-check-maven:12.1.0:check --fail-at-end -DnvdApiDelay=60000 -DskipTests -DfailBuildOnCVSS=7`
2. Wait a very long time (can be sped up be [requesting an NVD API key](https://nvd.nist.gov/developers/request-an-api-key) and adding `-DnvdApiKey=<key>`
3. Check the build succeeds

Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-02-20 14:31:59 +01:00
a0fd84343c Show error message when trying to add duplicate exemptions ()
Fixes 

## How to test
1. Log in as admin
2. Go to "Admin / Match / Application periods"
3. Click "Edit exemptions" on the period
4. Add the same exemption twice to "Sture Student"

Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-02-20 13:56:13 +01:00
9b26843570 Bug resubmissions of final thesis shows old date ()
Previously if an author resubmitted their final thesis to the supervisor fora re-submission to the examiner the date of submission was the first submitted final thesis. And the status text only showed "Waiting for grading". This caused a lot of confusion for the authors when the dates and status of the final thesis was divergent from their perceived view of dates and changes.

Fixes 

Reviewed-on: 
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
2025-02-19 09:37:33 +01:00
d292ecc34d Remove useless PhD project type
It interfered with grading report templates due to having the grading module activated but no template defined. Could have removed the module but it serves no purpose since all PhD-related functionality was removed a long time ago.
2025-02-18 15:13:51 +01:00
1b36ad7987 Disable ability to grade opponents after requesting improvements 2025-02-18 15:12:21 +01:00
ad91a9b961 Remove unused dependencies 2025-02-18 14:54:47 +01:00
cbd426be07 Show the time that opponents submitted their report 2025-02-18 14:53:28 +01:00
093dd11c29 Send notifications to opponents when they're approved 2025-02-18 14:37:10 +01:00
cfef02b98c Enable *all* notifications during development and on test servers 2025-02-18 14:17:45 +01:00
970f6ee61b Merge branch 'develop' into opponent-completion
# Conflicts:
#	core/src/main/java/se/su/dsv/scipro/DataInitializer.java
2025-02-18 10:04:28 +01:00
399d8f5275 Assign supervisor to student ideas no matter if target (goal) is reached ()
Fixes 

Reviewed-on: 
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
2025-02-18 09:59:23 +01:00
b9f7dd5a49 Update supervisor's idea table immediately upon scheduling a first meeting ()
Before, after scheduling a first meeting, they had to refresh the entire page to show the information in the table.

Fixes 

Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
2025-02-13 09:59:33 +01:00
8892bf4780 Merge branch 'develop' into opponent-completion 2025-02-12 13:45:51 +01:00
08e1b785ca Fix Docker build due to missing json-smart version ()
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-02-12 13:28:14 +01:00
6410710679 Merge branch 'develop' into opponent-completion
# Conflicts:
#	core/src/main/java/se/su/dsv/scipro/DataInitializer.java
2025-02-12 11:18:06 +01:00
304d0431c1 Deadline visible in "Rough draft approval" page ()
Previously deadline was only visible at the Reviewer start page, tab 'Rough draft approvals'.

Now the deadline is also shown when you go to the detail page of a rough draft.

Fixes issue 

Reviewed-on: 
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
2025-02-12 11:07:53 +01:00
87e60578c0 Styling improvements 2025-02-11 15:47:19 +01:00
3be41635b1 Alert the opponent that they need to an improved report on the final seminar page 2025-02-11 15:37:46 +01:00
236f6a0ad3 Better UX for notification about opposition report needing improvements
Now takes the opponent directly to the form where they can fill in the report and view the feedback from the seminar supervisor.
2025-02-11 15:37:46 +01:00
a20455df97 Merge branch 'develop' into opponent-completion 2025-02-10 14:35:40 +01:00
06c1e81978 Send out notification when an opponent submits a report 2025-02-10 10:48:20 +01:00
1299af5b00 Remove the AttachmentReport abstraction on the panel to fill out opposition report
The reviewer report has long since been removed and the supervisors report differs too much and had been decoupled already.
2025-02-10 10:27:29 +01:00
791ec65633 Show information to the supervisor that they've requested improvements 2025-02-07 14:48:03 +01:00
305142a862 Do not remind supervisors to grade opponents if they've requested improvements 2025-02-07 12:40:23 +01:00
5e0d285272 Extract common functionality for both branches 2025-02-07 12:34:54 +01:00
9823dc193c Move worker @Beans to the correct @Configuration class 2025-02-07 12:14:38 +01:00
219c312441 Fix localizer warning on the finishing up tab for each author ()
Fixes 

The `getReflectionText` method was calling `getString` when no reflection has been submitted. This is not a relevant case for the editing form since it can not be accessed when there is no reflection. Inlined the method call and removed the non-submitted case, the default will be an empty string.

## How to test
1. Log in as a supervisor
2. Open a project that has a Daisy connection (`identifier`is non-null on the `Project`)
3. Go to the "Finishing up" tab
4. Go to the tab for the author with no reflection submitted
5. See that no warning is logged

Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-02-07 07:50:02 +01:00
34e986a6c9 Switch back to the grading form after requesting improvements 2025-02-06 16:38:13 +01:00
08302f9719 Fail authors who do not improve their opposition report in time. 2025-02-06 16:38:13 +01:00
cbbd98b597 Upgrade Wicket version ()
Is a drop in replacement according to https://wicket.apache.org/news/2025/01/24/wicket-10.4.0-released.html#upgrading-from-earlier-versions

Fixes 

Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2025-02-06 14:10:30 +01:00
88ced02a2d Notify opponent when improvements are requested 2025-01-24 15:47:10 +01:00
9db30b3d28 Translated some swedish text into english.
The entire system is in english so have two paragraphs in swedish made no sense.
2025-01-24 15:16:02 +01:00
54d5ef8752 Show requests for improvement when filling in the opposition report 2025-01-23 21:17:36 +01:00
13efe4bada Updated Spring Boot and Springdoc versions ()
The updated versions should fix CVE-2024-45801.
Was forced to update spring-boot 3.4.1 to be able to use the latest version of springdoc as per the
springdoc compability matrix.

The compability matrix can be found [here](https://springdoc.org/#what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot)

fixes issue 

Reviewed-on: 
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Co-committed-by: Nico Athanassiadis <nico@dsv.su.se>
2025-01-23 20:50:18 +01:00
fec631f2d0 Replace @Entity with DTO 2025-01-23 16:06:30 +01:00
da91d4074d Replace direct repository access with a service 2025-01-21 11:18:00 +01:00
ecdd68efbe Fix test 2025-01-20 14:24:24 +01:00
7bb37407d6 Calculate correct deadline for improvement submission 2025-01-20 14:21:51 +01:00
45c21e3fe4 Store the request for improvements 2025-01-20 13:30:20 +01:00
d01dee1ec7 Add a thesis document to the final seminar to help testing 2025-01-20 13:19:03 +01:00
6b24e84694 Request improvements 2025-01-20 11:49:11 +01:00