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 7688d8f8dae..a2e18c6bcac 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 @@ -1,9 +1,12 @@ package com.axonivy.portal.components.bean; import java.io.Serializable; +import java.util.Optional; import javax.faces.bean.ManagedBean; +import org.apache.commons.lang3.BooleanUtils; + import com.axonivy.portal.components.dto.RoleDTO; import com.axonivy.portal.components.dto.SecurityMemberDTO; import com.axonivy.portal.components.dto.UserDTO; @@ -27,11 +30,16 @@ public String getNameInitials(String displayName) { return SecurityMemberUtils.getNameInitials(displayName); } - public String getEmailAddress(ISecurityMember securityMember) { + public String getEmailAddress(ISecurityMember securityMember, + boolean useLowercaseEmail) { if (securityMember == null || !securityMember.isUser()) { return ""; } - return ((IUser) securityMember).getEMailAddress(); + + String email = ((IUser) securityMember).getEMailAddress(); + return BooleanUtils.isTrue(useLowercaseEmail) + ? Optional.ofNullable(email).map(String::toLowerCase).orElse(email) + : email; } public String getEmailAddress(SecurityMemberDTO securityMember) { diff --git a/AxonIvyPortal/portal-components/webContent/resources/components/avatar.xhtml b/AxonIvyPortal/portal-components/webContent/resources/components/avatar.xhtml index 90c977f87cc..d3c7619621e 100644 --- a/AxonIvyPortal/portal-components/webContent/resources/components/avatar.xhtml +++ b/AxonIvyPortal/portal-components/webContent/resources/components/avatar.xhtml @@ -6,13 +6,14 @@ + \ No newline at end of file