3494-UI-improvements-grading-templates #21

Merged
ansv7779 merged 17 commits from 3494-UI-improvements-grading-templates into develop 2024-11-26 10:18:55 +01:00

17 Commits

Author SHA1 Message Date
6ac4240638 Merge remote-tracking branch 'origin/3494-UI-improvements-grading-templates' into 3494-UI-improvements-grading-templates
All checks were successful
Build and test / build-and-test (push) Successful in 6m49s
2024-11-26 06:33:18 +01:00
f7206f619f Fix for project title commit 90604b8ef1f82343e913319c54802dbd09278027
The project title was added to the wrong panel which caused side effect of showing a title when
creating a new template. Moved the previous code it is only shown when editing a template.

Also changed it to read the title from the database using the LoadableDetachableModel pattern.

Now the project title should only be shown when editing an existing template.
2024-11-26 06:26:45 +01:00
3ec0356b3a Max available points should be updated when adding new points to criterion
Previously max available points where only updated when you added a new criterion.

It is beneficial that the user can see the max available points as they have completed editing the
template without having to click on the create button or add a new criterion.
2024-11-26 06:26:45 +01:00
edd6e9214d Create button should not be visible until user has selected project type
Previously a user could click on the create button before they had chosen a
grading template project type from the Project type dropdown.
This would result in a runtime exception, and possibly in an unhappy user.

To protect the user from "jumping the gun", the Create button will only become visible
after the user has selected a Project type from the dropdown menu.
2024-11-26 06:26:45 +01:00
883ccfc26d Fix adding new criteria should add point requirements
When you added new criteria you only got to set the criterion title, type, flag and point but you had to manually add the requirements for the first criterion.

Now when you add a new criterion the new criterion will by default add the requirement for the points.

reverted a previous change in the for loop the correct condition was to check against 0, I accidently turned that to 1 in a previous commit. Also added a comment to try and explain what that condition checks for.
2024-11-26 06:26:45 +01:00
d0baa11d3b Fixed behavior of valid from date when creating new template
Previously if you created a new grading template chose a date for `Valid from` field and then added a criterion.
The valid from date would reset to null. This would create a validation error on save.
This creates unnecessary confusion for the user.

Now when you have chosen a date and then choose to add a criterion to the template the date does not reset.

The reason for this was that the AutoSave() added to the field was using the wrong event to trigger the setValidFrom().
Since we use bootstraps date picker we have to trigger on "changeDate" event.
2024-11-26 06:26:45 +01:00
b27102596e Changed default value of Points required to pass
When adding a new criteria to a template the default value of `Points required to pass` was `0` (zero).
Now when you add a new criterion to a template the `Points required to pass` default to `1` (one).
2024-11-26 06:26:45 +01:00
4991719048 Added project type title when viewing or editing
When you chose to edit a template you could not see what type the template is.
For example if it was a bachelor or master type template.

Now when you choose to edit a grading template the type will be shown as a heading,
so you can more easily see what type of template you are currently editing.
The heading will read:
`You are editing a <type> grading template.`
The <type> will display the correct type of the grading template you are editing.

Open to change of what exactly the heading will display if anyone has a better idea for it.
2024-11-26 06:26:45 +01:00
942418988a User alert on unsaved changes in grading template
Grading template did not have any way to alert the user that changes had been made when editing a template.

Added a way to detect and alert the user when changes have been made on the grading template they are editing. If the user removes his changes, so the template is in the same state as it was when the user started editing the template the alert will disappear.
2024-11-26 06:26:45 +01:00
774f1e9d7a Fix for project title commit 90604b8ef1f82343e913319c54802dbd09278027
All checks were successful
Build and test / build-and-test (push) Successful in 6m56s
The project title was added to the wrong panel which caused side effect of showing a title when
creating a new template. Moved the previous code it is only shown when editing a template.

Also changed it to read the title from the database using the LoadableDetachableModel pattern.

Now the project title should only be shown when editing an existing template.
2024-11-21 06:48:37 +01:00
3c59348636 Max available points should be updated when adding new points to criterion
Previously max available points where only updated when you added a new criterion.

It is beneficial that the user can see the max available points as they have completed editing the
template without having to click on the create button or add a new criterion.
2024-11-21 06:47:13 +01:00
433ef4ed87 Create button should not be visible until user has selected project type
Previously a user could click on the create button before they had chosen a
grading template project type from the Project type dropdown.
This would result in a runtime exception, and possibly in an unhappy user.

To protect the user from "jumping the gun", the Create button will only become visible
after the user has selected a Project type from the dropdown menu.
2024-11-21 06:47:13 +01:00
f79f66c182 Fix adding new criteria should add point requirements
When you added new criteria you only got to set the criterion title, type, flag and point but you had to manually add the requirements for the first criterion.

Now when you add a new criterion the new criterion will by default add the requirement for the points.

reverted a previous change in the for loop the correct condition was to check against 0, I accidently turned that to 1 in a previous commit. Also added a comment to try and explain what that condition checks for.
2024-11-21 06:47:13 +01:00
00994e6cf7 Fixed behavior of valid from date when creating new template
Previously if you created a new grading template chose a date for `Valid from` field and then added a criterion.
The valid from date would reset to null. This would create a validation error on save.
This creates unnecessary confusion for the user.

Now when you have chosen a date and then choose to add a criterion to the template the date does not reset.

The reason for this was that the AutoSave() added to the field was using the wrong event to trigger the setValidFrom().
Since we use bootstraps date picker we have to trigger on "changeDate" event.
2024-11-21 06:47:13 +01:00
c538f95950 Changed default value of Points required to pass
When adding a new criteria to a template the default value of `Points required to pass` was `0` (zero).
Now when you add a new criterion to a template the `Points required to pass` default to `1` (one).
2024-11-21 06:47:13 +01:00
ea54958e71 Added project type title when viewing or editing
When you chose to edit a template you could not see what type the template is.
For example if it was a bachelor or master type template.

Now when you choose to edit a grading template the type will be shown as a heading,
so you can more easily see what type of template you are currently editing.
The heading will read:
`You are editing a <type> grading template.`
The <type> will display the correct type of the grading template you are editing.

Open to change of what exactly the heading will display if anyone has a better idea for it.
2024-11-21 06:47:13 +01:00
4b113715d6 User alert on unsaved changes in grading template
Grading template did not have any way to alert the user that changes had been made when editing a template.

Added a way to detect and alert the user when changes have been made on the grading template they are editing. If the user removes his changes, so the template is in the same state as it was when the user started editing the template the alert will disappear.
2024-11-21 06:47:13 +01:00