4028 Commits

Author SHA1 Message Date
9cd4a9ebb6 87: Merge from develop 2025-05-09 13:57:51 +02:00
233f5329af Fix supervisor gets phase 2 review request deadline hardcoded to 2020-03-08 before any reviewer is assigned. ()
Fixes .

**How to test:**

1. Switch user to supervisor 'Elsabet Employee <elsabet@example.com>', she has one project to supervise: 'A bachelor thesis'.
2. Click 'Phase 2 review', and fill the form 'Rough draft approval', click button 'Request review'.
3. The next view shows the status of the review request. Since there is no reviewer assigned, the row "Deadline: ..." no longer is visible.
4. Switch user to admin, edit project 'A bachelor thesis', assign a reviewer (like 'Eric Employee') to the project.
5. Switch user back to 'Elsabet Employee', click Phase 2 review again. The deadline now shows with correct date.

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-05-09 13:21:27 +02:00
e34f231e92 Show supervisors the date they submitted the thesis for examination ()
Fixes 

## How to test
1. Go to https://scipro-supervisor-submit-to-examiner-date.branch.dsv.su.se
2. Log in as `einstein@example.com`
3. Open the project
4. See Galileo's date on the overview
5. Go to finishing up tab and see his date there as well
6. Go to Newtons tab and submit (it will stay in the unsubmitted view due to mocked APIs with fixed data)
7. Go to overview
8. See that Newtons submitted date is correctly shown as the moment you submitted

## Mocked APIs
This pull request will in addition to fixing  also set up mocked APIs for the integrations with grading service and Daisy. To use those mocked APIs remove any outside configuration (in Tomcat or otherwise) for `service.grading.url` and `daisy.api.{url,username,password}`.

To add new data to the mocked APIs see the YAML files in the `mock-api` directory. See [APImposter](https://gitea.dsv.su.se/DMC/apimposter) for more technical details how it works.

Reviewed-on: 
Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
2025-05-09 12:49:16 +02:00
76138ef437 Supervisor calendar overview ()
Fixes 

Basic structure to render and show a calendar for the supervisors. Currently shows only first meeting events.

 ## How to test
1) Log in as salieri@example.com
2) Click on the tab 'Schedule Overview'
3) Verify that there are 2 events in the calendar.
     - One event has a clickable text, the other does not.
     - The one that has a clickable text is associated with a project.
     - The one without a clickable text is does not have a project yet.
4) Click on the clickable event to go that events project page.
5) Select 'First Meeting' tab
6) Set a new date and time for the first meeting.
7) Click on 'Schedule Overview' and verify.

After testing you can reset the state of the branch by going [here](https://gitea.dsv.su.se/DMC/scipro/actions/runs/672/jobs/0) and rerun all jobs a button top right.

Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
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-05-08 12:34:04 +02:00
d49bbea3ea Merge branch 'develop' into 87-split-project 2025-05-07 09:55:55 +02:00
5deff47108 Do not factor in deleted posts when counting unread threads ()
Fixes 

## How to test
1. Log in as `eric@example.com`
2. Create a thread in the forum
3. Log in as `stina@example.com`
4. Post a reply
5. Log in as `eric@example.com`
6. See that the project is flagged in the overview for having unread threads
7. Log in as `stina@example.com`
8. Delete the reply
9. Log in as `eric@example.com`
10. Project is no longer flagged as having unread threads

Reviewed-on: 
Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
2025-05-07 09:33:35 +02:00
ed61c18a62 Allow deletion of entire forum threads ()
Only threads with no replies can be deleted. When a thread is deleted a notification is sent to the relevant parties.

Fixes 

## How to test
1. Log in as `eric@example.com` (supervisor) or as `sture@example.com` (author)
2. Open the forum in project "Putting the it in supervising"
3. Create a new thread
4. Delete the thread
5. Create a second thread
6. Post some replies as the different users
7. See that the thread (initial post) can't be deleted
8. Delete the replies
9. Delete the thread

Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
2025-05-06 11:59:55 +02:00
8d7a0f6eb1 87: Improve test by using fixed year (2025) 2025-05-05 14:44:23 +02:00
2b5da3fee1 87: Update migration db-script to higher version 2025-04-28 13:19:13 +02:00
822b3bc814 Merge branch 'develop' into 87-split-project 2025-04-28 13:17:12 +02:00
7ea749e4f3 87: Improve test precision with MutableFixedClock 2025-04-28 13:15:34 +02:00
ec5c7f8b1d 87: Use injected Clock in SplitOrRestartProjectServiceImpl instead of hardwired clock 2025-04-28 12:05:44 +02:00
3477c8f0c5 Add foreign key constraint from table 'idea_student' to table 'program' ()
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-04-25 10:59:23 +02:00
60d73e18e4 87: Improve code readability in DataInitializer & Reformat code 2025-04-23 14:37:06 +02:00
25ba68f929 87: Replace assertTrue with assertEquals 2025-04-23 14:03:13 +02:00
5c36cd345d 87: Use Instant instead of Date & Remove deprecated @Temporal 2025-04-23 10:39:51 +02:00
6ccf72d4ab 87: Improve integration test 2025-04-14 12:56:01 +02:00
7bb47f6e09 Merge branch 'develop' into 87-split-project 2025-04-14 12:07:40 +02:00
f956ba1af8 87: Improve test 2025-04-10 14:30:05 +02:00
96eb62178d 87: Reformat code 2025-04-10 14:20:53 +02:00
80694e2c14 87: Improve test 2025-04-10 14:18:59 +02:00
4be16af51c 87: Improve test 2025-04-10 09:59:48 +02:00
d875d9ce7c 87: Update test 2025-04-09 15:17:21 +02:00
195e7f3bfb 87: Integration test in progress 2025-04-09 13:56:35 +02:00
185785582a 87: First version of integration test 2025-04-07 15:48:37 +02:00
3f604ad926 87: Refactor out status message to view layer 2025-04-07 12:50:34 +02:00
13fa678ac5 87: Don't count cloned reviews. 2025-04-07 09:58:39 +02:00
d906886489 87: reformat code 2025-04-03 15:04:05 +02:00
671d05e0e1 87: Adjust sql script 2025-04-03 15:02:04 +02:00
e963bee932 87: Use other event so no notification will go 2025-04-03 12:56:20 +02:00
8465d4c687 87: Loose up some SQL-constraints 2025-04-02 15:18:46 +02:00
b04c5d439e 87: reformat code 2025-04-02 13:19:56 +02:00
57774b1c32 87: Save cloned RoughDraftApproval 2025-04-02 13:18:06 +02:00
8a050491f9 87: Add clone functionality 2025-04-02 12:44:24 +02:00
1ebf21f14b 87: Refactor SplittableStatusRecord using Java record 2025-04-02 09:41:27 +02:00
8266b1f1fe 87: Improve result page (AdminViewParentProjectPage) after split 2025-03-27 11:48:34 +01:00
7d92dc4ddb 87: Rename sql with with capital V 2025-03-26 13:24:32 +01:00
38830f3856 87: Remove SQL-file with wrong naming convention 2025-03-26 13:23:45 +01:00
0e261fc85e 87: Reformat code 2025-03-26 13:00:11 +01:00
6526dc1fd9 87: Add initial support of parent-child project 2025-03-26 12:57:18 +01:00
f2e19b686d 87: Use service method in AdminSplitProjectPanel 2025-03-26 10:04:40 +01:00
e59178a540 87: Add initial version of SplitOrRestartProjectService 2025-03-26 09:10:31 +01:00
7504c267c5 Delete forum replies ()
Allows deleting (your own) forum replies.

Fixes 

## How to test

1. Log in as `eric@example.com` (supervisor) or as `sture@example.com` (author)
2. Open the forum in project "Putting the it in supervising"
3. Create a new thread
4. Post some replies as the different users
5. Delete the replies

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-18 08:34:21 +01:00
6b77142a06 New Daisy API XSD ()
Allows a way to solve 

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-18 07:33:38 +01:00
9ede262e7b Fix crash due to JSON parsing on "Finishing up" tab ()
The seemingly unused library `jersey-hk2` that got removed in  is used, if present, internally by the Jersey client to find and register Jackson modules (such as those that provide `java.time` support).

## How to test
1. Turn on the `DAISY-INTEGRATION` Maven profile (alongside `DEV`)
2. Configure some projects and their authors to have a Daisy connection
3. Log in as the supervisor
4. Go to the "Finishing up" tab in the project
5. See that it works compared to `develop` branch

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-11 08:49:16 +01:00
de18f200a7 Make exemptions for project type apply to partner as well ()
Read  for context first

When authors select supervisor ideas during an open application period they are only allowed to select ideas corresponding to their degree type classification. This limitation can be lifted by giving the author an exemption for "Project type limitation" on the corresponding application period. However, this limitation is still enforced for any potential partner *even if* the have been given the same exemption. This change makes it so the exemption applies to any selected partner as well and not just the author selecting the supervisor idea.

## How to test
1. Log in as `oskar@example.com`
2. Go to "Ideas / My ideas" page
3. Click "Select from available ideas" on the application period "Supervisor ideas"
4. Open the one available idea
5. Try to select it with "Johan Student" as a partner
6. Log in as admin
7. Go to "Match / Application periods"
8. Click "Edit exemptions" on the "Supervisor ideas" period
9. Give "Johan Student" an exemption to "Project type limitation"
10. Repeat steps 1-5

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-10 07:17:28 +01:00
5c5f03bd78 Let Spring Boot manage dependency versions ()
Since SciPro is now a Spring Boot-based application it is counter-productive to manage our own dependency versions.
* They could conflict with what Spring Boot assumes
* All libraries that are managed by Spring Boot are tested to work together

QueryDSL and JPA version properties are left in because they're needed for annotation processors (they can't be dependency managed).

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-05 11:53:10 +01:00
d008bec815 Allow supervisors to request improvements from final seminar opponents ()
Fixes 

## How to test
1. (Optional) Log in as `sid@example.com` and submit an opposition report
   1. Go to the tab "Opposition & Active participation"
   2. Open the opposition "Putting the it in supervising" on the right
   3. Submit the report
2. Log in as `eric@example.com`
3. Go to the final seminar in the "Putting the it in supervising" project (or follow the notification if you did step 1)
4. Request improvements
5. Log in as `sid@example.com`
6. Follow the notification to submit the new opposition report

Click the "Re-run all jobs" button (top right) on https://gitea.dsv.su.se/DMC/scipro/actions/runs/457 to reset the database. It takes a few minutes.

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-05 10:05:37 +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