Skip to content

Commit

Permalink
feat: Add Perks Notification Type - MEED-2450 - Meeds-io/MIPs#80 (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker committed Sep 15, 2023
1 parent ec58fc1 commit cc46cb6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.commons.codec.binary.StringUtils;

import org.exoplatform.commons.api.notification.NotificationContext;
import org.exoplatform.commons.api.notification.NotificationMessageUtils;
import org.exoplatform.commons.api.notification.channel.template.AbstractTemplateBuilder;
import org.exoplatform.commons.api.notification.model.*;
import org.exoplatform.commons.api.notification.service.template.TemplateContext;
Expand Down Expand Up @@ -86,9 +85,6 @@ protected MessageInfo makeMessage(NotificationContext ctx) {
String rewardEndPeriodDate = (String) templateContext.get(REWARD_END_PERIOD_DATE);
templateContext.put(REWARD_END_PERIOD_DATE_FORMATTED, formatTime(Long.parseLong(rewardEndPeriodDate) - 1, zoneId, language));

String notificationRead = notification.getValueOwnerParameter(NotificationMessageUtils.READ_PORPERTY.getKey());
templateContext.put("READ", Boolean.parseBoolean(notificationRead) ? "read" : "unread");

setLastModifiedDate(notification, language, templateContext);
SocialNotificationUtils.addFooterAndFirstName(notification.getTo(), templateContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Locale;

import org.exoplatform.commons.api.notification.NotificationContext;
import org.exoplatform.commons.api.notification.NotificationMessageUtils;
import org.exoplatform.commons.api.notification.channel.template.AbstractTemplateBuilder;
import org.exoplatform.commons.api.notification.channel.template.TemplateProvider;
import org.exoplatform.commons.api.notification.model.MessageInfo;
Expand Down Expand Up @@ -82,7 +81,6 @@ protected MessageInfo makeMessage(NotificationContext ctx) {
String userUrl = notification.getValueOwnerParameter(USER_URL);
String symbol = notification.getValueOwnerParameter(SYMBOL);
String message = notification.getValueOwnerParameter(MESSAGE);
String notificationRead = notification.getValueOwnerParameter(NotificationMessageUtils.READ_PORPERTY.getKey());
String fundRequestSent = notification.getValueOwnerParameter(FUNDS_REQUEST_SENT);

RequestLifeCycle.begin(container);
Expand All @@ -100,7 +98,6 @@ protected MessageInfo makeMessage(NotificationContext ctx) {
templateContext.put("MESSAGE", message);
templateContext.put("AVATAR", avatar != null ? avatar : LinkProvider.PROFILE_DEFAULT_AVATAR_URL);
templateContext.put("NOTIFICATION_ID", notification.getId());
templateContext.put("READ", Boolean.parseBoolean(notificationRead) ? "read" : "unread");
templateContext.put("FUNDS_REQUEST_SENT", Boolean.valueOf(fundRequestSent));
setLastModifiedDate(notification, language, templateContext);
SocialNotificationUtils.addFooterAndFirstName(notification.getTo(), templateContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.commons.lang3.StringUtils;

import org.exoplatform.commons.api.notification.NotificationContext;
import org.exoplatform.commons.api.notification.NotificationMessageUtils;
import org.exoplatform.commons.api.notification.channel.template.AbstractTemplateBuilder;
import org.exoplatform.commons.api.notification.channel.template.TemplateProvider;
import org.exoplatform.commons.api.notification.model.MessageInfo;
Expand Down Expand Up @@ -83,7 +82,6 @@ protected MessageInfo makeMessage(NotificationContext ctx) {
String symbol = notification.getValueOwnerParameter(SYMBOL);
String message = notification.getValueOwnerParameter(MESSAGE);
String hash = notification.getValueOwnerParameter(HASH);
String notificationRead = notification.getValueOwnerParameter(NotificationMessageUtils.READ_PORPERTY.getKey());

RequestLifeCycle.begin(container);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#
UINotification.label.group.Wallet=Wallet

Notification.label.types.wallet=Wallet

UINotification.title.EtherSenderNotificationPlugin=Funds sent
UINotification.label.EtherSenderNotificationPlugin=Sending funds notification
Notification.subject.EtherSenderNotificationPlugin=You have sent funds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

extensionRegistry.registerExtension('WebNotification', 'notification-group-extension', {
rank: 60,
name: 'wallet',
plugins: [
'FundsRequestNotificationPlugin',
'EtherReceiverNotificationPlugin',
'EtherSenderNotificationPlugin',
'RewardSuccessNotificationPlugin'
],
icon: 'fa-wallet',
});
extensionRegistry.registerExtension('WebNotification', 'notification-content-extension', {
type: 'FundsRequestNotificationPlugin',
rank: 10,
Expand Down

0 comments on commit cc46cb6

Please sign in to comment.