From 216b32456e59d1298d2937ff0b74185373c6dffd Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Thu, 27 Aug 2026 17:17:51 -0700 Subject: [PATCH 1/4] Display teacher's unit list on account information page --- .../controllers/admin/UserInfoController.java | 5 ++++ src/main/resources/i18n/i18n.properties | 6 +++++ .../webapp/portal/teacher/account/info.jsp | 23 +++++++++++++++++++ .../admin/UserInfoControllerTest.java | 8 +++++++ 4 files changed, 42 insertions(+) diff --git a/src/main/java/org/wise/portal/presentation/web/controllers/admin/UserInfoController.java b/src/main/java/org/wise/portal/presentation/web/controllers/admin/UserInfoController.java index 06b4b7fe09..d6fde51523 100644 --- a/src/main/java/org/wise/portal/presentation/web/controllers/admin/UserInfoController.java +++ b/src/main/java/org/wise/portal/presentation/web/controllers/admin/UserInfoController.java @@ -34,6 +34,7 @@ import org.wise.portal.domain.authentication.MutableUserDetails; import org.wise.portal.domain.user.User; import org.wise.portal.service.authentication.UserDetailsService; +import org.wise.portal.service.project.ProjectService; import org.wise.portal.service.run.RunService; import org.wise.portal.service.student.StudentService; import org.wise.portal.service.user.UserService; @@ -55,6 +56,9 @@ public class UserInfoController { @Autowired private RunService runService; + @Autowired + private ProjectService projectService; + @GetMapping(value = {"/student/account/info", "/teacher/account/info"}) protected String getUserAccountInfo(Authentication auth, @RequestParam String username, ModelMap modelMap) throws Exception { @@ -73,6 +77,7 @@ protected String getUserAccountInfo(Authentication auth, @RequestParam String us } else { modelMap.put("isStudent", false); modelMap.put("runList", runService.getRunListByOwner(user)); + modelMap.put("projectList", projectService.getProjectList(user)); return "teacher/account/info"; } } else { diff --git a/src/main/resources/i18n/i18n.properties b/src/main/resources/i18n/i18n.properties index 61e55883c0..f56dce2e22 100644 --- a/src/main/resources/i18n/i18n.properties +++ b/src/main/resources/i18n/i18n.properties @@ -3198,6 +3198,12 @@ teacher.teacherinfo.lastLogin=Last Login teacher.teacherinfo.lastLogin.description=The label for the Last Login field teacher.teacherinfo.accountEnabled=Account Enabled teacher.teacherinfo.accountEnabled.description=The label for the Account Enabled field +teacher.teacherinfo.unitList=Unit List +teacher.teacherinfo.unitList.description=The header for the unit list +teacher.teacherinfo.unitId=Unit ID +teacher.teacherinfo.unitId.description=The label for the Unit ID field +teacher.teacherinfo.unitName=Unit Name +teacher.teacherinfo.unitName.description=The label for the Unit Name field teacher.teacherinfo.closeThisWindow=Close this window teacher.teacherinfo.closeThisWindow.description=The text for the Close this window link diff --git a/src/main/webapp/portal/teacher/account/info.jsp b/src/main/webapp/portal/teacher/account/info.jsp index 499fb3d87a..1a04d51e4d 100644 --- a/src/main/webapp/portal/teacher/account/info.jsp +++ b/src/main/webapp/portal/teacher/account/info.jsp @@ -170,6 +170,29 @@ function toggleUserAccountStatus(username, isCurrentlyEnabled) { +
+ + + + + + + + + + + + + + + + + + + + +

diff --git a/src/test/java/org/wise/portal/presentation/web/controllers/admin/UserInfoControllerTest.java b/src/test/java/org/wise/portal/presentation/web/controllers/admin/UserInfoControllerTest.java index 4369f98892..5cb9c11d28 100644 --- a/src/test/java/org/wise/portal/presentation/web/controllers/admin/UserInfoControllerTest.java +++ b/src/test/java/org/wise/portal/presentation/web/controllers/admin/UserInfoControllerTest.java @@ -37,6 +37,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.ui.ModelMap; +import org.wise.portal.domain.project.Project; import org.wise.portal.domain.run.Run; import org.wise.portal.domain.run.impl.RunImpl; import org.wise.portal.presentation.web.controllers.APIControllerTest; @@ -89,6 +90,10 @@ public void getUserAccountInfo_AdminLooksUpTeacher_ReturnTeacherAccountInfoPage( studentRuns.add(new RunImpl()); expect(runService.getRunListByOwner(teacher1)).andReturn(studentRuns); replay(runService); + List teacherProjects = new ArrayList<>(); + teacherProjects.add(project1); + expect(projectService.getProjectList(teacher1)).andReturn(teacherProjects); + replay(projectService); String view = controller.getUserAccountInfo(adminAuth, TEACHER_USERNAME, modelMap); assertEquals("teacher/account/info", view); assertEquals(false, modelMap.get("isStudent")); @@ -96,8 +101,11 @@ public void getUserAccountInfo_AdminLooksUpTeacher_ReturnTeacherAccountInfoPage( assertEquals(true, resultUserInfoMap.get("Account Enabled")); List resultRunList = (List) modelMap.get("runList"); assertEquals(1, resultRunList.size()); + List resultProjectList = (List) modelMap.get("projectList"); + assertEquals(1, resultProjectList.size()); verify(userService); verify(runService); + verify(projectService); } @Test From d956d11b347ee0ffed184b0b3fc5692788e8a15b Mon Sep 17 00:00:00 2001 From: Hiroki Terashima Date: Thu, 27 Aug 2026 17:27:51 -0700 Subject: [PATCH 2/4] Use tabs to organize content. --- .../webapp/portal/teacher/account/info.jsp | 281 +++++++++--------- 1 file changed, 143 insertions(+), 138 deletions(-) diff --git a/src/main/webapp/portal/teacher/account/info.jsp b/src/main/webapp/portal/teacher/account/info.jsp index 1a04d51e4d..cab24e470f 100644 --- a/src/main/webapp/portal/teacher/account/info.jsp +++ b/src/main/webapp/portal/teacher/account/info.jsp @@ -5,17 +5,24 @@ <%@ include file="../../favicon.jsp"%> -Teacher Information " media="screen" rel="stylesheet" type="text/css" /> " media="screen" rel="stylesheet" type="text/css" /> +" media="screen" rel="stylesheet" type="text/css" /> " rel="stylesheet" type="text/css" > + + +