diff --git a/kudos-services/src/main/java/io/meeds/kudos/listener/KudosSentNotificationListener.java b/kudos-services/src/main/java/io/meeds/kudos/listener/KudosSentNotificationListener.java index 2c566b3e0..706a60196 100644 --- a/kudos-services/src/main/java/io/meeds/kudos/listener/KudosSentNotificationListener.java +++ b/kudos-services/src/main/java/io/meeds/kudos/listener/KudosSentNotificationListener.java @@ -36,6 +36,7 @@ import io.meeds.kudos.model.Kudos; import io.meeds.kudos.service.KudosService; +import io.meeds.kudos.service.utils.Utils; import jakarta.annotation.PostConstruct; @@ -52,7 +53,7 @@ public class KudosSentNotificationListener extends Listener @PostConstruct public void init() { - listenerService.addListener("exo.kudos.sent", this); + listenerService.addListener(Utils.KUDOS_ACTIVITY_EVENT, this); } @Override diff --git a/kudos-services/src/main/java/io/meeds/kudos/notification/plugin/KudosReceiverNotificationPlugin.java b/kudos-services/src/main/java/io/meeds/kudos/notification/plugin/KudosReceiverNotificationPlugin.java index 66568a6d6..acb12492e 100644 --- a/kudos-services/src/main/java/io/meeds/kudos/notification/plugin/KudosReceiverNotificationPlugin.java +++ b/kudos-services/src/main/java/io/meeds/kudos/notification/plugin/KudosReceiverNotificationPlugin.java @@ -23,6 +23,8 @@ import java.util.List; +import org.apache.commons.lang3.StringUtils; + import org.exoplatform.commons.api.notification.NotificationContext; import org.exoplatform.commons.api.notification.model.NotificationInfo; import org.exoplatform.commons.api.notification.plugin.BaseNotificationPlugin; @@ -66,13 +68,13 @@ public NotificationInfo makeNotification(NotificationContext ctx) { } ActivityManager activityManager = ExoContainerContext.getService(ActivityManager.class); ExoSocialActivity activity = activityManager.getActivity(String.valueOf(kudos.getActivityId())); - if (activity.isComment()) { + if (activity != null && activity.isComment()) { activity = activityManager.getActivity(activity.getParentId()); } return NotificationInfo.instance() .to(toList) - .setSpaceId(activity == null ? 0l : Long.parseLong(activity.getSpaceId())) + .setSpaceId(activity == null || StringUtils.isBlank(activity.getSpaceId()) ? 0l : Long.parseLong(activity.getSpaceId())) .with(SocialNotificationUtils.ACTIVITY_ID.getKey(), String.valueOf(kudos.getActivityId())) .with("ENTITY_ID", kudos.getEntityId()) .with("ENTITY_TYPE", kudos.getEntityType()) diff --git a/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml b/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml index 60322e110..e00546bfe 100644 --- a/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/kudos-webapps/src/main/webapp/WEB-INF/gatein-resources.xml @@ -1,12 +1,34 @@ - + Enterprise kudos /skin/css/main.css 120 + true + + kudos + Kudos + Enterprise + kudos + + + + kudos + KudosOverview + Enterprise + kudos + + + + kudos + KudosAdmin + Enterprise + kudos + + Kudos diff --git a/kudos-webapps/src/main/webapp/WEB-INF/web.xml b/kudos-webapps/src/main/webapp/WEB-INF/web.xml index 16ab811ec..9ea97cb66 100644 --- a/kudos-webapps/src/main/webapp/WEB-INF/web.xml +++ b/kudos-webapps/src/main/webapp/WEB-INF/web.xml @@ -24,6 +24,7 @@ *.css *.js *.html + /i18n/* /images/* diff --git a/kudos-webapps/src/main/webapp/vue-app/kudos-admin/main.js b/kudos-webapps/src/main/webapp/vue-app/kudos-admin/main.js index e4f56e29a..3c26fe977 100644 --- a/kudos-webapps/src/main/webapp/vue-app/kudos-admin/main.js +++ b/kudos-webapps/src/main/webapp/vue-app/kudos-admin/main.js @@ -31,7 +31,7 @@ if (extensionRegistry) { } const lang = eXo && eXo.env.portal.language || 'en'; -const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.addon.Kudos-${lang}.json`; +const url = `/kudos/i18n/locale.addon.Kudos?lang=${lang}`; const appId = 'KudosAdminApp'; export function init() { diff --git a/kudos-webapps/src/main/webapp/vue-app/kudos-overview/main.js b/kudos-webapps/src/main/webapp/vue-app/kudos-overview/main.js index 35890678c..245bd93e9 100644 --- a/kudos-webapps/src/main/webapp/vue-app/kudos-overview/main.js +++ b/kudos-webapps/src/main/webapp/vue-app/kudos-overview/main.js @@ -15,7 +15,7 @@ const cacheId = `${appId}_${eXo.env.portal.profileOwnerIdentityId}`; //should expose the locale ressources as REST API const lang = (eXo && eXo.env && eXo.env.portal && eXo.env.portal.language) || 'en'; -const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.addon.Kudos-${lang}.json`; +const url = `/kudos/i18n/locale.addon.Kudos?lang=${lang}`; export function init() { exoi18n.loadLanguageAsync(lang, url).then(i18n => { diff --git a/kudos-webapps/src/main/webapp/vue-app/kudos/main.js b/kudos-webapps/src/main/webapp/vue-app/kudos/main.js index a0f8b6e0c..8892f48d6 100644 --- a/kudos-webapps/src/main/webapp/vue-app/kudos/main.js +++ b/kudos-webapps/src/main/webapp/vue-app/kudos/main.js @@ -27,7 +27,7 @@ const appId = 'KudosApp'; //should expose the locale ressources as REST API const lang = (eXo && eXo.env && eXo.env.portal && eXo.env.portal.language) || 'en'; -const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.addon.Kudos-${lang}.json`; +const url = `/kudos/i18n/locale.addon.Kudos?lang=${lang}`; exoi18n.loadLanguageAsync(lang, url).then(i18n => { // init Vue app when locale ressources are ready diff --git a/kudos-webapps/src/main/webapp/vue-app/notification-extension/main.js b/kudos-webapps/src/main/webapp/vue-app/notification-extension/main.js index 840f14549..ab2c597ed 100644 --- a/kudos-webapps/src/main/webapp/vue-app/notification-extension/main.js +++ b/kudos-webapps/src/main/webapp/vue-app/notification-extension/main.js @@ -21,7 +21,7 @@ import './initComponents.js'; import './extensions.js'; const lang = eXo.env.portal.language; -const url = `${eXo.env.portal.context}/${eXo.env.portal.rest}/i18n/bundle/locale.notification.KudosNotification-${lang}.json`; +const url = `/kudos/i18n/locale.notification.KudosNotification?lang=${lang}`; export function init() { return exoi18n.loadLanguageAsync(lang, url)