Skip to content

Commit

Permalink
feat: Add Evm connector plugin - MEED-3205 - Meeds-io/MIPs#118 (#1454)
Browse files Browse the repository at this point in the history
This change will Add the evm connector application depending on the activation of the feature flag.
  • Loading branch information
MayTekayaa authored and exo-swf committed Feb 7, 2024
1 parent ec5eb9f commit 5ecb585
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ gamification.event.detail.activityLink.error=Please enter a valid activity link
# Upcoming Connectors

gamification.admin.discord.label.description=Connect your Discord server and challenge your community by making the server active and useful for its members
gamification.admin.evm.label.description=Listen to any smart contract transaction on Ethereum Virtual Machine blockchains
gamification.admin.linkedIn.label.description=Connect your LinkedIn account and boost your employee or your project advocacy in just a few clicks
gamification.admin.notion.label.description=Connect Notion and incentive your community to share knowledge
gamification.admin.slack.label.description=Connect Slack to your platform and boost your community and channels
Expand Down
Binary file removed portlets/src/main/webapp/images/connector/EVM.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ extensionRegistry.registerExtension('engagementCenterConnectors', 'connector-ext
comingSoon: true,
});

extensionRegistry.registerExtension('engagementCenterConnectors', 'connector-extensions', {
id: 'evm',
name: 'evm',
image: '/gamification-portlets/images/connector/EVM.png',
title: 'EVM Blockhain',
description: 'gamification.admin.evm.label.description',
comingSoon: true,
});

extensionRegistry.registerExtension('engagementCenterConnectors', 'connector-extensions', {
id: 'linkedIn',
name: 'linkedIn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.commons.lang3.StringUtils;

import org.exoplatform.commons.ObjectAlreadyExistsException;
import org.exoplatform.commons.api.settings.ExoFeatureService;
import org.exoplatform.services.listener.ListenerService;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
Expand Down Expand Up @@ -66,14 +67,18 @@ public class ConnectorServiceImpl implements ConnectorService {

private final ListenerService listenerService;

private ExoFeatureService featureService;

public ConnectorServiceImpl(ConnectorAccountStorage connectorAccountStorage,
IdentityManager identityManager,
ConnectorSettingService connectorSettingService,
ListenerService listenerService) {
ListenerService listenerService,
ExoFeatureService featureService) {
this.connectorAccountStorage = connectorAccountStorage;
this.connectorSettingService = connectorSettingService;
this.identityManager = identityManager;
this.listenerService = listenerService;
this.featureService = featureService;
}

@Override
Expand Down Expand Up @@ -106,7 +111,11 @@ public Collection<RemoteConnector> getConnectors(String username) {
if (remoteConnectorSettings != null) {
remoteConnector.setApiKey(remoteConnectorSettings.getApiKey());
remoteConnector.setRedirectUrl(remoteConnectorSettings.getRedirectUrl());
remoteConnector.setEnabled(remoteConnectorSettings.isEnabled());
if (featureService.isFeatureActiveForUser(StringUtils.upperCase(connectorName) + "Connector", username)) {
remoteConnector.setEnabled(true);
} else {
remoteConnector.setEnabled(remoteConnectorSettings.isEnabled());
}
}
connectorList.add(remoteConnector);
});
Expand Down

0 comments on commit 5ecb585

Please sign in to comment.