Skip to content

Commit

Permalink
feat: Delete usage of Juzu and adapt Notification Settings - MEED-2445
Browse files Browse the repository at this point in the history
…- Meeds-io/MIPs#79

This change updates Badges Portlet to not use Juzu anymore which has been deleted from Notifications Admin, the last portlet using Juzu. In addition, this change will adapt some Unit Tests to new behavior of Notification Settings that ensures that users are enabled before sending notification.
  • Loading branch information
boubaker authored and exo-swf committed Sep 7, 2023
1 parent a7d1a3d commit 4635952
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 332 deletions.
7 changes: 0 additions & 7 deletions portlets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
<scope>provided</scope>
</dependency>

<!-- Commons project-->
<dependency>
<groupId>org.exoplatform.commons</groupId>
<artifactId>commons-juzu</artifactId>
<scope>provided</scope>
</dependency>

<!-- Platform-ui for Less Variables use-->
<dependency>
<groupId>org.exoplatform.platform-ui</groupId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions portlets/src/main/webapp/WEB-INF/jsp/badge/index.jsp

This file was deleted.

10 changes: 8 additions & 2 deletions portlets/src/main/webapp/WEB-INF/portlet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<portlet>
<portlet-name>GamificationManageBadges</portlet-name>
<portlet-class>org.exoplatform.addons.gamification.portlets.admin.badge.ManageBadgesPortlet</portlet-class>
<portlet-class>org.exoplatform.commons.api.portlet.GenericDispatchedViewPortlet</portlet-class>
<init-param>
<name>portlet-view-dispatched-file-path</name>
<value>/html/manageBadges.html</value>
</init-param>
<expiration-cache>-1</expiration-cache>
<cache-scope>PUBLIC</cache-scope>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Gamification Manage badges</title>
<title>Manage Badges</title>
</portlet-info>
<security-role-ref>
<role-name>admin</role-name>
Expand Down
24 changes: 0 additions & 24 deletions portlets/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<absolute-ordering/>

<!-- Run mode: prod, dev or live -->
<context-param>
<param-name>juzu.run_mode</param-name>
<param-value>${juzu.run_mode:prod}</param-value>
</context-param>

<!-- Injection container to use: guice, spring, cdi or weld -->
<context-param>
<param-name>juzu.inject</param-name>
<param-value>guice</param-value>
</context-param>
<filter>
<filter-name>ResourceRequestFilter</filter-name>
<filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
Expand All @@ -52,17 +41,4 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<listener-class>org.exoplatform.container.web.PortalContainerConfigOwner</listener-class>
</listener>

<!-- ================================================================== -->
<!-- = Juzu configuration = -->
<!-- ================================================================== -->
<servlet>
<servlet-name>AssetServlet</servlet-name>
<servlet-class>juzu.impl.asset.AssetServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AssetServlet</servlet-name>
<url-pattern>/assets/*</url-pattern>
</servlet-mapping>

</web-app>
3 changes: 3 additions & 0 deletions portlets/src/main/webapp/html/manageBadges.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div id="manage-badges-portlet" class='manage-badges-portlet'>
<div class="container"></div>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@
import io.meeds.gamification.model.RulePublication;
import io.meeds.gamification.test.AbstractPluginTest;

public class ActionAnnouncedNotificationPluginTest extends AbstractPluginTest {

private static final String ADMIN_USER = "root1";

private static final String SIMPLE_USER = "root5";
public class ActionAnnouncedNotificationPluginTest extends AbstractPluginTest { // NOSONAR

@Override
public AbstractTemplateBuilder getTemplateBuilder() {
Expand All @@ -53,7 +49,7 @@ public BaseNotificationPlugin getPlugin() {
return pluginService.getPlugin(PluginKey.key(RULE_ANNOUNCED_NOTIFICATION_ID));
}

public void testSimpleCase() throws Exception {
public void testSimpleCase() throws Exception { // NOSONAR
notificationService.clearAll();

// STEP 1 post activity
Expand All @@ -80,7 +76,7 @@ public void testSimpleCase() throws Exception {
String message = "Test publication Message";
rule.setMessage(message);
RuleDTO createdRule = ruleService.createRule(rule, ADMIN_USER);
assertTrue(createdRule.getActivityId() > 0);
assertTrue(createdRule.getActivityId() > 0); // NOSONAR

Announcement announcement = new Announcement(0,
createdRule.getId(),
Expand Down
Loading

0 comments on commit 4635952

Please sign in to comment.