Skip to content

Commit

Permalink
feat: Split Rewards and Gamification navigation items - MEED-7377 - M…
Browse files Browse the repository at this point in the history
…eeds-io/MIPs#154 (#20)

Update reward admin url

Ensure registration of Bouncy Castle provider.
  • Loading branch information
AzmiTouil committed Sep 9, 2024
1 parent 8318a5d commit 71589eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
@Profile("wallet")
@Component
public class RewardSucceededPwaNotificationPlugin implements PwaNotificationPlugin {
private static final String REWAR_ADMINISTRATION_URL = "/portal/administration/home/recognition/reward";

private static final String TITLE_LABEL_KEY = "pwa.notification.RewardSuccessNotificationPlugin.title";
private static final String REWARD_ADMINISTRATION_URL = "/portal/administration/home/rewards/reward";

private static final String BODY_LABEL_KEY = "pwa.notification.RewardSuccessNotificationPlugin.body";
private static final String TITLE_LABEL_KEY = "pwa.notification.RewardSuccessNotificationPlugin.title";

private static final DateTimeFormatter DATE_FORMATTER =
DateTimeFormatter.ofPattern("d MMM uuuu");
private static final String BODY_LABEL_KEY = "pwa.notification.RewardSuccessNotificationPlugin.body";

private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("d MMM uuuu");

@Autowired
private ResourceBundleService resourceBundleService;
Expand All @@ -64,7 +64,7 @@ public PwaNotificationMessage process(NotificationInfo notification, LocaleConfi
notificationMessage.setBody(resourceBundleService.getSharedString(BODY_LABEL_KEY, locale)
.replace("{0}", getDateLabel(notification, "rewardStartPeriodDate", locale))
.replace("{1}", getDateLabel(notification, "rewardEndPeriodDate", locale)));
notificationMessage.setUrl(REWAR_ADMINISTRATION_URL);
notificationMessage.setUrl(REWARD_ADMINISTRATION_URL);
return notificationMessage;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
package io.meeds.pwa.service;

import java.security.KeyPair;
import java.security.Security;

import org.apache.commons.lang3.StringUtils;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -39,6 +41,9 @@ public class PushServiceConfiguration {

@Bean
public PushService getPushService(PwaNotificationStorage pwaNotificationStorage) throws Exception { // NOSONAR
if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
Security.addProvider(new BouncyCastleProvider());
}
PushService pushService = new PushService(new KeyPair(pwaNotificationStorage.getVapidPublicKey(),
pwaNotificationStorage.getVapidPrivateKey()));
pushService.setSubject("mailto:" + getContactEmail());
Expand Down

0 comments on commit 71589eb

Please sign in to comment.