Skip to content

feat(admin): display account enabled status and allow toggling in user info page - #341

Merged
hirokiterashima merged 2 commits into
developfrom
feat/admin-disable-user-in-info-page
Aug 27, 2026
Merged

feat(admin): display account enabled status and allow toggling in user info page#341
hirokiterashima merged 2 commits into
developfrom
feat/admin-disable-user-in-info-page

Conversation

@hirokiterashima

Copy link
Copy Markdown
Member

Summary

Adds the user's enabled/disabled account status and an enable/disable action button to the teacher account information page (/teacher/account/info), accessible to administrators.

Changes Made

  • User Details Model: Added "Account Enabled" (this.isEnabled()) to the userInfoMap returned by TeacherUserDetails.getInfo().
  • View (info.jsp):
    • Rendered the Account Enabled field in the user information table restricted to users with ROLE_ADMINISTRATOR.
    • Added an action button next to the status ("disable user" if currently enabled, "enable user" if currently disabled).
    • Added toggleUserAccountStatus in <head> to prompt for confirmation before issuing an AJAX POST request to /admin/account/enabledisableuser, alerting the user and refreshing the page upon completion.
    • Included the jquerysource script in info.jsp.
  • Internationalization (i18n):
    • Added message and description keys for teacher.teacherinfo.accountEnabled across bundle files (i18n.properties, i18n_ar.properties, i18n_el.properties, i18n_es.properties, i18n_iw.properties, i18n_ja.properties, i18n_nl.properties, i18n_tr.properties, i18n_zh_CN.properties, and i18n_zh_TW.properties).
  • Unit Tests:
    • Updated TeacherUserDetailsTest to JUnit 5 and asserted the Account Enabled field in testGetInfo().
    • Updated UserInfoControllerTest to verify that Account Enabled is properly included in the model's userInfoMap.

Testing

  • Ran mvn test -Dtest=UserInfoControllerTest to verify the controller returns the updated model map.
  • Tested TeacherUserDetailsTest to verify getInfo() produces the expected Account Enabled attribute.

@hirokiterashima hirokiterashima self-assigned this Aug 27, 2026
@hirokiterashima hirokiterashima added the enhancement New feature or request label Aug 27, 2026
@hirokiterashima
hirokiterashima merged commit 1958196 into develop Aug 27, 2026
2 checks passed
@hirokiterashima
hirokiterashima deleted the feat/admin-disable-user-in-info-page branch August 27, 2026 23:42
@hirokiterashima

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.23.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant