6927 Commits

Author SHA1 Message Date
d5bc04e90c 3492: Remove unused method hasUreadThreads in ProjectForumService 2024-12-19 12:14:06 +01:00
4a9232dab0 3492: Move counter to a Label instead of Panel, which simplifies a lot. 2024-12-19 11:58:21 +01:00
08f40959fd 3470: Reformat code with prettier 2024-12-18 15:31:17 +01:00
2ad0061a09 Merge branch 'develop' into 3470-forum-msg-ui-improvement
# Conflicts:
#	core/src/main/java/se/su/dsv/scipro/forum/BasicForumService.java
#	core/src/main/java/se/su/dsv/scipro/forum/ForumPostRepository.java
#	core/src/main/java/se/su/dsv/scipro/forum/ForumPostRepositoryImpl.java
#	core/src/main/java/se/su/dsv/scipro/forum/ProjectThreadRepository.java
#	core/src/main/java/se/su/dsv/scipro/forum/ProjectThreadRepositoryImpl.java
#	view/src/main/java/se/su/dsv/scipro/forum/panels/AbstractReadStatePanel.java
#	view/src/main/java/se/su/dsv/scipro/supervisor/panels/SupervisorMyProjectsPanel.java
2024-12-18 15:25:54 +01:00
379b5c34fc 3470: Use Wicket behavior (less intrusive) to modify AbstractReadStatePanel 2024-12-18 15:15:22 +01:00
3e71bc1c9e 3470: Use JPA native query to reduce number of calls to database 2024-12-18 08:58:41 +01:00
0525f89560 3470: Add logic to retrieve actual message counts 2024-12-17 09:45:14 +01:00
25117c8187 Switch authentication to OAuth 2 ()
This is one requirement in bringing  to reality.

Currently the way to log in to SciPro is by having a locally modified `web.xml` that emulates being authenticated via single sign-on (SSO). This method can not work on an automatically deployed test server. It is also not possible to have real SSO configured for the test servers due to their dynamic nature and that they are given a new hostname each time. Our current SSO solution requires there to be certificate issued to specific hostnames. Even if it were possible to get SSO set up how would the username received from SSO match to test data? We would have to have real usernames in our test data which is not desirable.

To solve both of the problems described above - requiring a locally modified version of a git tracked file and needing an authentication mechanism that works for dynamic test servers - a change of the authentication mechanism from Tomcat controlled SSO to application controlled OAuth 2 is proposed. There is already an OAuth 2 authorization server running in production which itself is authenticates users via SSO that will be used in production and for the permanent test servers. In development and for the dynamic test servers a local authorization server running in Docker is provided.

For "regular" users there will be no noticeable change, they will be prompted to log in via SSO and then they get access to the system. For users with high developer access they will, on the permanent test servers, be prompted to "issue token". On that page they can use the top form to authenticate as themselves based on their SSO authentication, or use the bottom form to issue a completely custom authentication and log in as whatever username they deem necessary. The temporary test servers and during local development will work similarly with the only difference being that there is no SSO log in first and you will be prompted to issue a token immediately. The default authentication (top form) will be a local sys-admin level user.

## How to test
1. Start the local OAuth 2 authorization server with `docker compose up`
2. Start SciPro
3. Attempt to log in

Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
2024-12-16 16:55:49 +01:00
f67f37ecdd Keep and validate project type selection when creating/editing application periods ()
If you have FormComponents in a ListView you need to call setReuseItems(true) on the ListView. Otherwise the ListItems will be recreated before rendering which results in them losing their "converted input" (what Wicket calls the submitted value).

Instead of simply calling setReuseItems(true) on the ListView, which would've solved the problem, it was instead replaced by a proper FormComponent for dealing with this exact case (a CheckboxMultipleChoice component). This reduces the amount of code required and more clearly communicates intent. The change required some minor test refactoring.

Fixes 

---

Now requires at least one project type to be selected before saving.

Fixes 

---

## How to test
1. Go to "Admin" / "Match" / "Application periods"
2. Click create new
3. Submit without selecting any types
4. See that there's proper feedback
5. Leave name blank and select some types
6. Submit
7. See that the project type selection sticks around

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>
2024-12-16 13:23:37 +01:00
c6bd17d9ad Fix grade calculator being serialized ()
The new calculator that's based on templates has a reference to the @Entity for the template which should not be serialized.

Fixes 

## How to test/replicate
1. Log in as a supervisor
1. Open a project that's new enough to use a grading report template with grade limits
1. Go to the "Finishing up" tab
1. Go to the sub-tab for an individual author

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>
2024-12-16 11:24:33 +01:00
74b2396376 3470: Add new panel to show unread message count (as POC so far) 2024-12-02 14:49:40 +01:00
0d612d44ee 3470: Move variable 'icon' from class level to method level:
This reduces the visibility of the variable icon, which usually is a good thing. The 'icon' is never accessed anywhere else.
2024-12-02 14:46:03 +01:00
2eb7f1bf14 3470: Write a-element in one line to avoid white spaces:
* since this component is put in a table cell, and when there are more than one component in the cell, the white spaces breaks the visual with additional underscore like character.
2024-12-02 14:43:27 +01:00
499aaaa402 3470: Enhance ProjectForumStateColumn of SupervisorMyProjectPanel
* it contains 2 components, one with flag, one with number of messages.
* since table cell can only contain one component, Wicket Fragment is used.
2024-12-02 14:40:43 +01:00
1554d4bc27 Enforce code formatting via Prettier ()
Fixes  by introducing [Prettier](https://prettier.io/).

Prettier is an extremely opinionated formatter. It will reformat every single line according to its style. There are virtually no configuration options so there can be no discussion about formatting rules.

There are two parameters that are configurable; indent length and line length. Indent length has been set to 4 because that's the Java standard.

Line length defaults to 80 but has been increased to 100. The rational for this is that Prettier was created for JavaScript which is much less verbose than Java. Not only does every Java line start with 8 spaces of indentation vs. JavaScripts 0 or 2, it also has types wile JavaScript does not and uses `const` for variable declarations. Compare the two below examples as well as an actual example from the source code that is too long for the default 80 characters. I have no problem dropping down to the default 80 if that is preferred I just felt that with the average length of a line of Java code being pretty long, excessive wrapping would reduce readability.

```javascript
  const attributes = {
    ...
  };
```
```java
        Map<String, String> attributes = Map.of(
            ...
        );
```

Or the following real code which is 97 characters long.
```java
        Set<ProjectParticipant> contributors = daisyAPI.getContributors(project.getIdentifier());
```

Reviewed-on: 
Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2024-12-02 14:17:59 +01:00
8a657b21dd 3494 UI improvements to the administration page for grading templates ()
Changes made to the grading template UI

Some of the improvements include:
- When editing a template, and the user makes a change the user will be informed/alerted that the template has changed.
- When editing a template the user will now see a project title that shows what project type that template has.
- Default value of points required to pass has been changed from 0 -> 1
- Requirements to points will be added by default when adding a new criteria.
- The create button is now hidden until the user has chosen a grading template project type from the drop down menu.
- Max available points are now updated as point requirements are added to the criterion.

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>
2024-11-26 10:18:55 +01:00
b58a8a2d8b 3470: Show tooltip if there are unread messages
* AbstractReadStatePanel is expanded with option to show tooltip.
2024-11-25 15:20:28 +01:00
ff4c5b58b4 Allow changes to the reflection to be made after it's been submitted ()
Replaces 

Fixes card 3213 and 3412

There are minimum requirements for the reflection document submitted by authors at the end of the thesis process. Before now there was no way to handle the case when the reflection did not meet these minimum requirements.

This change makes it possible in two ways;
 1. The supervisor can request improvements to be made requiring the author to re-submit a new reflection inside SciPro
 2. The supervisor can directly edit the reflection themselves if it has been submitted out-of-band or for any other reason

Co-authored-by: Nico Athanassiadis <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: Nico Athanassiadis <nico@dsv.su.se>
2024-11-21 19:20:47 +01:00
1f0f15fc18 3471: Reduced size of textarea as requested, also made small reformatting of Java code ()
* number of rows in textarea is reduced from 20 to 7.
* made small reformatting of ProjectNoteColumn

Reviewed-on: 
Reviewed-by: ansv7779 <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
2024-11-19 12:17:15 +01:00
cfe61a9ed8 task/3382: Harmonize database names as snake_case ()
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Reviewed-on: 
Reviewed-by: ansv7779 <andreass@dsv.su.se>
Co-authored-by: Tom Zhao <tom.zhao@dsv.su.se>
Co-committed-by: Tom Zhao <tom.zhao@dsv.su.se>
2024-11-12 13:33:43 +01:00
ccac2c1cf8 Enable creating an API using Spring Web ()
SciPro will have to provide information to the upcoming student portal. Wicket does not have the ability to serve JSON in the usual REST way and is only able to serve HTML. The most common way to write JSON over HTTP API:s in Java is using Spring Web, but currently SciPro uses Guice for dependency injection rather than Spring which makes adding Spring Web a bit more tricky.

This pull request attempts to solve this by doing the following;
* Replacing Guice with Spring
* Adding a new API module that uses Spring Web
* Turning the entire system into a standard Spring Boot web application

The hope is that these changes will bring the following benefits;
* Harmonize our web stack (Daisy uses Spring and the new lecture hall system is full Spring Boot)
* Enable easy development of a traditional JSON over HTTP API
* Ease future recruitment by using the most common Java web frameworks

Reviewed-on: 
Reviewed-by: niat8586 <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2024-11-06 11:23:28 +01:00
e18af72336 Allows admins to manage grading report templates ()
# Manage grading report templates
Every once in a while the criteria used to asses theses and individual performance changes. When this happens the criteria in SciPro needs to be updated.

Up until now there has not been a GUI to do this and it has instead been done manually, sometimes using database migrations. It was also time-sensitive since there was only ever one template (per project type) in SciPro such that the change had to happen at the correct time when the new template was to take effect.

There was also the question of how to calculate the grade the author should receive based on the point sum from the supervisors assessment of all the criteria and these limits were hard-coded in the system.

These changes address all of the above;
 * There can be multiple templates per type.
 * Each template has a period during which it is are current.
 * Each template has defined the conversion of point sums to grades.

The periods can not overlap and a template remains current from its start date until another template's start date is reached. There can not be two templates (within a project type) that become valid on the same date.

## How to test
 1. Log in as administrator
 2. Go to "Project management"
 3. Go to "Grading templates"
 4. Create/edit new templates
 5. View current template

Card 3482

Co-authored-by: niat8586 <nico@dsv.su.se>
Reviewed-on: 
Reviewed-by: niat8586 <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2024-10-30 10:05:22 +01:00
d8e4f0dd22 Stop confusing Spring Boot with copied classes
These classes were copied from Spring Data a long time ago. Their existence on the class path confuses Spring Boot into thinking we use Spring Data JPA which we do not.
2024-10-28 14:02:31 +01:00
949de4a260 Allow supervisors to write a note associated with their projects ()
There is a need among supervisors to maintain some work notes for each project. Where they are in the process, what students need to do, and other such things.

This PR gives the supervisors the ability to write a note for each project on their overview page.

Card 3399

Reviewed-on: 
Reviewed-by: niat8586 <nico@dsv.su.se>
2024-07-10 13:43:27 +02:00
4dc0ba32d0 Enable supervisors to get an overview of forum activity ()
Their project overview page now include a column indicating if any thread in that forum has an unread post and it also acts as a quick link directly to the forum.

Fixes 
Card 3399

Reviewed-on: 
Reviewed-by: niat8586 <nico@dsv.su.se>
Co-authored-by: Andreas Svanberg <andreass@dsv.su.se>
Co-committed-by: Andreas Svanberg <andreass@dsv.su.se>
2024-07-10 13:18:20 +02:00
eccf6937a3 3380 Specify information URL about the review process for reviewers
Administrators want to inform the reviewers what dates are important during the thesis writing process.

They can now configure an information URL for each type of project under "Admin / System / Type settings" that is shown to the reviewers as they review projects.
2024-05-27 16:35:30 +02:00
663b92eb3b 3380 Specify information URL about the review process for supervisors
Administrators want to inform the supervisors how the reviewers are assigned and what dates are important during the thesis writing process.

They can now configure an information URL for each type of project under "Admin / System / Type settings" that is shown to the supervisors as they enter the review process.
2024-05-27 16:29:23 +02:00
da842a9fd2 3380 Made it possible to edit minimum/maximum authors
There has always been a minimum and maximum limit on the number of authors per project type, it was just never configurable. Made them configurable while working on the panel.
2024-05-27 16:04:09 +02:00
a48dccc4cd Merge branch 'bugfix/3372-link' into develop 2024-05-23 12:02:44 +02:00
a79ee20cba 3392 Failing test 2024-05-22 12:35:50 +02:00
325b93ce3d 3391 Fix warning 2024-05-22 10:45:29 +02:00
6c0cf8a42f bugfix/3372-link: Complement allowed characters in forum links with exlamation mark. 2024-05-17 15:30:16 +02:00
a6d2502ebb 3381 Fix NPE when supervisors fill in individual criteria before final thesis is uploaded 2024-05-03 15:11:13 +02:00
9c78d9a648 Merge remote-tracking branch 'refs/remotes/origin/wicket-10' into develop 2024-04-26 10:10:24 +02:00
f5950a43ba 3126 Remove possibility to reply to forum posts via e-mail
Unused feature that caused issues with repeated posts.
2024-04-26 10:05:30 +02:00
43516dba16 3275 orangemarkera två flikar i "finishing up" när man hovrar med musen 2024-04-24 16:43:03 +02:00
5c78a698f9 Wicket 10 downgraded the version so the security vulnerability popped up again 2024-04-24 14:53:57 +02:00
db0c36234a Merge branch 'develop' into wicket-10 2024-04-22 09:41:47 +02:00
fea88cfcc6 3207 Disabling the button will break Wickets specific submit button behavior. Disable buttons with CSS instead 2024-04-18 09:57:24 +02:00
9b69fca5be Merge remote-tracking branch 'origin/develop' into develop 2024-04-16 21:31:29 +02:00
fb39fa9c64 3359 Bristande info under Final thesis and reflection 2024-04-16 21:31:12 +02:00
5a20a863d0 3207 TR 2024-04-16 14:17:07 +02:00
42cd644e74 Merge branch 'develop' into wicket-10
# Conflicts:
#	view/src/main/java/se/su/dsv/scipro/supervisor/pages/SupervisorViewGroupThreadPage.java
2024-04-16 14:13:03 +02:00
2d7b032219 Clean up 2024-04-16 13:21:03 +02:00
a8707ab6f9 3367 Remove unused library with security vulnerability 2024-04-16 13:06:44 +02:00
eca412d9b5 2870 Stöd för att ange nationellt ämneskategori i samband med att godkänner final thesis 2024-04-08 17:04:06 +02:00
0474b18911 3207 Dubblett - POST finalseminar 2024-04-08 15:44:51 +02:00
3a530879a7 2870 Stöd för att ange nationellt ämneskategori i samband med att godkänner final thesis 2024-04-08 15:43:55 +02:00
cabdc5bfce 3262 Improve feedback when students submit/updates their own idea 2024-04-03 14:29:39 +02:00
17306630c5 3262 Improve information available to students about their ideas
Show when the course starts
Better status message when it's not yet matched to a supervisor
2024-04-03 14:15:34 +02:00