From c33c1a4e082aee2839accd37d8b7aff7d2188283 Mon Sep 17 00:00:00 2001 From: mnhnam-axonivy Date: Wed, 15 Jan 2025 14:49:31 +0700 Subject: [PATCH] IVYPORTAL-18316: Update the Avatar component to auto convert email to lower cases - Fixed error after add new attribute --- .../components/bean/PortalComponentAvatarBean.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/bean/PortalComponentAvatarBean.java b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/bean/PortalComponentAvatarBean.java index a2e18c6bca..a346aeddfd 100644 --- a/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/bean/PortalComponentAvatarBean.java +++ b/AxonIvyPortal/portal-components/src/com/axonivy/portal/components/bean/PortalComponentAvatarBean.java @@ -49,14 +49,17 @@ public String getEmailAddress(SecurityMemberDTO securityMember) { return securityMember.getEMailAddress(); } - public String getEmailAddress(UserDTO user) { + public String getEmailAddress(UserDTO user, boolean useLowercaseEmail) { if (user == null) { return ""; } - return user.getEmail(); + String email = user.getEmail(); + return BooleanUtils.isTrue(useLowercaseEmail) + ? Optional.ofNullable(email).map(String::toLowerCase).orElse(email) + : email; } - public String getEmailAddress(RoleDTO role) { + public String getEmailAddress(RoleDTO role, boolean useLowercaseEmail) { return ""; }