From 202e122fa2fff0557bce1d8f122f7166dae39ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Wed, 13 Apr 2022 15:23:07 +0200 Subject: [PATCH] SEBSERV-282: Improved password change form. --- .../gui/content/admin/UserAccountChangePasswordForm.java | 7 +++++++ src/main/resources/messages.properties | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/UserAccountChangePasswordForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/UserAccountChangePasswordForm.java index a7da5611..fb120c63 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/UserAccountChangePasswordForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/admin/UserAccountChangePasswordForm.java @@ -54,6 +54,8 @@ public class UserAccountChangePasswordForm implements TemplateComposer { new LocTextKey("sebserver.useraccount.form.password.new.confirm"); private static final LocTextKey FORM_PASSWORD_TEXT_KEY = new LocTextKey("sebserver.useraccount.form.password"); + private static final String PASSWORD_CHANGE_INFO_KEY = + "sebserver.useraccount.form.password.info"; private final PageService pageService; private final RestService restService; @@ -85,6 +87,11 @@ public class UserAccountChangePasswordForm implements TemplateComposer { pageContext.getParent(), new LocTextKey(FORM_TITLE_KEY, userInfo.username)); + widgetFactory.labelLocalized( + content, + WidgetFactory.CustomVariant.SUBTITLE, + new LocTextKey(PASSWORD_CHANGE_INFO_KEY, userInfo.username)); + final boolean ownAccount = this.currentUser.get().uuid.equals(entityKey.getModelId()); // The Password Change form diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index de96347f..89fd6d3e 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -264,8 +264,8 @@ sebserver.useraccount.form.timezone=Time Zone sebserver.useraccount.form.timezone.tooltip=The time-zone of the user

Note that this also defines the exact time and date that is displayed to the user sebserver.useraccount.form.roles=User Roles sebserver.useraccount.form.roles.tooltip=The roles of the user
A user can have more then one role but must have at least one.

In Edit mode, please use the tooltip on the role name for more information about a specific role. -sebserver.useraccount.form.password=Password -sebserver.useraccount.form.password.tooltip=The password of the user account +sebserver.useraccount.form.password=Your Password +sebserver.useraccount.form.password.tooltip=The password of your user account sebserver.useraccount.form.password.confirm=Confirm Password sebserver.useraccount.form.password.confirm.tooltip=Please confirm the password sebserver.useraccount.form.pwchange.title=Change Password : {0} @@ -273,6 +273,7 @@ sebserver.useraccount.form.password.new=New Password sebserver.useraccount.form.password.new.tooltip=The new password for the user account sebserver.useraccount.form.password.new.confirm=Confirm New Password sebserver.useraccount.form.password.new.confirm.tooltip=Please confirm the password +sebserver.useraccount.form.password.info=To change the password of user with account {0},
please enter your own password first and then the new password for the user account and confirm the new password. sebserver.useraccount.delete.form.title=Delete User Account sebserver.useraccount.delete.form.info=Please Note:
    This deletes the particular User Account with all selected dependencies.
    The User Account and selected dependent exams and exam configurations, will be lost after deletion.
    Please use the "Show Report" action below to see a report of all objects that will be
    deleted and check them carefully.