From cbbd98b597cbb4de9bad77c01d83a54a65720dcd Mon Sep 17 00:00:00 2001 From: Andreas Svanberg <andreass@dsv.su.se> Date: Thu, 6 Feb 2025 14:10:30 +0100 Subject: [PATCH 1/2] Upgrade Wicket version (#102) 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 #100 Reviewed-on: https://gitea.dsv.su.se/DMC/scipro/pulls/102 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> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3e5972cbae..42018f99dc 100755 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ <!-- Dependency versions --> <slf4j.version>2.0.7</slf4j.version> <log4j2.version>2.20.0</log4j2.version> - <wicket.version>10.1.0</wicket.version> + <wicket.version>10.4.0</wicket.version> <!-- See https://hibernate.org/orm/releases/ for which version Hibernate implements --> <jakarta.persistence-api.version>3.1.0</jakarta.persistence-api.version> From 219c312441eeeba79df4b7295d9fd63542b65cd1 Mon Sep 17 00:00:00 2001 From: Andreas Svanberg <andreass@dsv.su.se> Date: Fri, 7 Feb 2025 07:50:02 +0100 Subject: [PATCH 2/2] Fix localizer warning on the finishing up tab for each author (#101) Fixes #48 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: https://gitea.dsv.su.se/DMC/scipro/pulls/101 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> --- .../su/dsv/scipro/grading/ReflectionModalBodyPanel.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/view/src/main/java/se/su/dsv/scipro/grading/ReflectionModalBodyPanel.java b/view/src/main/java/se/su/dsv/scipro/grading/ReflectionModalBodyPanel.java index 986d509685..a7e48a1f1c 100644 --- a/view/src/main/java/se/su/dsv/scipro/grading/ReflectionModalBodyPanel.java +++ b/view/src/main/java/se/su/dsv/scipro/grading/ReflectionModalBodyPanel.java @@ -178,7 +178,13 @@ class ReflectionModalBodyPanel extends Panel { public SupervisorEditReflectionForm(String id, IModel<Reflection> reflectionModel) { super(id, reflectionModel); - IModel<String> reflectionTextModel = new Model<>(getReflectionText(reflectionModel.getObject())); + IModel<String> reflectionTextModel = new Model<>(); + Reflection reflection = reflectionModel.getObject(); + if (reflection instanceof Reflection.Submitted submitted) { + reflectionTextModel.setObject(submitted.reflection()); + } else if (reflection instanceof Reflection.ImprovementsNeeded improvementsNeeded) { + reflectionTextModel.setObject(improvementsNeeded.oldReflection()); + } TextArea<String> reflectionTextArea = new TextArea<>("reflection", reflectionTextModel); reflectionTextArea.setRequired(true);