From 82b675c92b4305b0ec5d5d21e6b7ff7b30c8edf3 Mon Sep 17 00:00:00 2001 From: Sara Boutej <40363501+SaraBoutej@users.noreply.github.com> Date: Mon, 22 Jan 2024 12:48:20 +0100 Subject: [PATCH 1/2] Feat: Add default user avatar when hover on reciever user name - MEED-3111 - Meeds-io/MIPs#83 (#458) This change adds the user enabled property in identity-popover directive for kudos message, this property allows to display the new default user avatar instead of the old one. --- .../src/main/java/org/exoplatform/kudos/model/Kudos.java | 2 ++ .../main/java/org/exoplatform/kudos/service/utils/Utils.java | 1 + kudos-webapps/src/main/webapp/vue-app/js/Kudos.js | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/kudos-services/src/main/java/org/exoplatform/kudos/model/Kudos.java b/kudos-services/src/main/java/org/exoplatform/kudos/model/Kudos.java index f005cabb9..7f82aab79 100644 --- a/kudos-services/src/main/java/org/exoplatform/kudos/model/Kudos.java +++ b/kudos-services/src/main/java/org/exoplatform/kudos/model/Kudos.java @@ -43,6 +43,8 @@ public class Kudos implements Serializable { private boolean externalReceiver; + private boolean enabledReceiver; + private String message; private long timeInSeconds; diff --git a/kudos-services/src/main/java/org/exoplatform/kudos/service/utils/Utils.java b/kudos-services/src/main/java/org/exoplatform/kudos/service/utils/Utils.java index d98fcd57e..53f26a8de 100644 --- a/kudos-services/src/main/java/org/exoplatform/kudos/service/utils/Utils.java +++ b/kudos-services/src/main/java/org/exoplatform/kudos/service/utils/Utils.java @@ -174,6 +174,7 @@ public static Kudos fromEntity(KudosEntity kudosEntity) { kudos.setExternalReceiver(receiverIdentity.getProfile() != null && receiverIdentity.getProfile().getProperty("external") != null && receiverIdentity.getProfile().getProperty("external").equals("true")); + kudos.setEnabledReceiver(receiverIdentity.isEnable() && !receiverIdentity.isDeleted()); kudos.setReceiverFullName(receiverIdentity.getProfile().getFullName()); kudos.setReceiverURL(LinkProvider.getUserProfileUri(receiverIdentity.getRemoteId())); kudos.setReceiverAvatar(getAvatar(receiverIdentity, null)); diff --git a/kudos-webapps/src/main/webapp/vue-app/js/Kudos.js b/kudos-webapps/src/main/webapp/vue-app/js/Kudos.js index 62407c1ac..844584db4 100644 --- a/kudos-webapps/src/main/webapp/vue-app/js/Kudos.js +++ b/kudos-webapps/src/main/webapp/vue-app/js/Kudos.js @@ -310,6 +310,7 @@ export function registerActivityActionExtension() { 'avatar': kudos.receiverAvatar, 'position': kudos.receiverPosition, 'external': String(kudos.externalReceiver), + 'enabled': String(kudos.enabledReceiver), }; return { key: 'NewKudosSentActivityComment.activity_kudos_title', @@ -425,4 +426,4 @@ export function registerActivityActionExtension() { } } }); -} \ No newline at end of file +} From c00c55d5e1b8da5c9f761b1f6e9cf119ace73d74 Mon Sep 17 00:00:00 2001 From: Sara Boutej <40363501+SaraBoutej@users.noreply.github.com> Date: Mon, 29 Jan 2024 09:36:29 +0100 Subject: [PATCH 2/2] feat: fix default avatar when sending kudos - MEED-3266 - Meeds-io/MIPs#83 (#461) Prior to this change, the generated default avatar is not displayed in the send kudos drawer for the receiver avatar. This change allows to add the user enabled property information to then receiver details to display the default avatar is the user is enabled. --- kudos-webapps/src/main/webapp/vue-app/js/KudosIdentity.js | 1 + 1 file changed, 1 insertion(+) diff --git a/kudos-webapps/src/main/webapp/vue-app/js/KudosIdentity.js b/kudos-webapps/src/main/webapp/vue-app/js/KudosIdentity.js index 78a0f591c..db0b22d08 100644 --- a/kudos-webapps/src/main/webapp/vue-app/js/KudosIdentity.js +++ b/kudos-webapps/src/main/webapp/vue-app/js/KudosIdentity.js @@ -67,6 +67,7 @@ export function getIdentityDetails(urlId, type, remoteId) { ownerDetails.username = identityDetails.username; ownerDetails.position = identityDetails.position; ownerDetails.external = identityDetails.external; + ownerDetails.enabled = identityDetails.enabled; } else { ownerDetails.notAuthorized = true; }