From 9113046e08ef5bcd3b1b253332937e463a472026 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Sun, 20 Oct 2024 16:10:16 +0100 Subject: [PATCH 1/4] feat: Update Space URL computing - Meeds-io/MIPs#150 This change will change Space URL format to reference /portal/s/SPACE_ID/ rather than using Space GROUP_ID and PRETTY_NAME which make it complex to build and not permanent as url. --- .../wallet/permlink/plugin/WalletPermanentLinkPlugin.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/wallet-services/src/main/java/io/meeds/wallet/permlink/plugin/WalletPermanentLinkPlugin.java b/wallet-services/src/main/java/io/meeds/wallet/permlink/plugin/WalletPermanentLinkPlugin.java index 5e314fbca..d88c5407a 100644 --- a/wallet-services/src/main/java/io/meeds/wallet/permlink/plugin/WalletPermanentLinkPlugin.java +++ b/wallet-services/src/main/java/io/meeds/wallet/permlink/plugin/WalletPermanentLinkPlugin.java @@ -76,12 +76,7 @@ public String getDirectAccessUrl(PermanentLinkObject object) throws ObjectNotFou } public String getSpaceUrl(Space space) { - StringBuilder spaceUrl = new StringBuilder("/portal/g/"); - spaceUrl.append(space.getGroupId().replace("/", ":")) - .append("/") - .append(space.getPrettyName()) - .append("/SpaceWallet"); - return spaceUrl.toString(); + return String.format("/portal/s/%s/SpaceWallet", space.getId()); } public String getProfileUrl() { From aa518560dc3dffeeda02ac52f76cc918a92c7631 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Mon, 21 Oct 2024 10:03:37 +0100 Subject: [PATCH 2/4] feat: Delete SpaceService.getSpaceByUrl API - Meeds-io/MIPs#150 This change will delete the usage of SpaceService.getSpaceByUrl which is deleted from Social API. --- .../src/main/java/io/meeds/wallet/utils/WalletUtils.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java b/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java index d3d4a5eb1..233074e42 100644 --- a/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java +++ b/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java @@ -491,10 +491,7 @@ public static Space getSpace(String id) { if (space == null) { space = spaceService.getSpaceByDisplayName(id); if (space == null) { - space = spaceService.getSpaceByUrl(id); - if (space == null) { - space = spaceService.getSpaceById(id); - } + space = spaceService.getSpaceById(id); } } } From fffbd0692ab20a2c1be51a2682edce74ef82274d Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Mon, 21 Oct 2024 10:36:28 +0100 Subject: [PATCH 3/4] feat: Delete Space.getSpaceByDisplayName API - Meeds-io/MIPs#150 This change will delete the usage of getSpaceByDisplayName API since it's not unique anymore --- .../src/main/java/io/meeds/wallet/utils/WalletUtils.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java b/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java index 233074e42..983665cdd 100644 --- a/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java +++ b/wallet-api/src/main/java/io/meeds/wallet/utils/WalletUtils.java @@ -489,10 +489,7 @@ public static Space getSpace(String id) { if (space == null) { space = spaceService.getSpaceByGroupId("/spaces/" + id); if (space == null) { - space = spaceService.getSpaceByDisplayName(id); - if (space == null) { - space = spaceService.getSpaceById(id); - } + space = spaceService.getSpaceById(id); } } return space; From e1ab8e2267800a707e31c647c2ea9a7f387d9f8f Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Mon, 21 Oct 2024 15:20:42 +0100 Subject: [PATCH 4/4] feat: Replace StringUtils package name - Meeds-io/MIPs#150 --- .../reward/notification/RewardSuccessTemplateBuilder.java | 2 +- .../reward/notification/RewardSuccessTemplateProvider.java | 2 +- .../java/io/meeds/wallet/test/mock/IdentityManagerMock.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateBuilder.java b/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateBuilder.java index 215b36dbd..528d8bec6 100644 --- a/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateBuilder.java +++ b/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateBuilder.java @@ -28,7 +28,7 @@ import io.meeds.common.ContainerTransactional; import io.meeds.wallet.model.RewardSettings; import io.meeds.wallet.reward.service.RewardSettingsService; -import org.apache.commons.codec.binary.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.api.notification.NotificationContext; import org.exoplatform.commons.api.notification.channel.template.AbstractTemplateBuilder; diff --git a/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateProvider.java b/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateProvider.java index c7cdcecf6..805244a22 100644 --- a/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateProvider.java +++ b/wallet-reward-services/src/main/java/io/meeds/wallet/reward/notification/RewardSuccessTemplateProvider.java @@ -24,7 +24,7 @@ import io.meeds.wallet.reward.service.RewardSettingsService; import lombok.Getter; import lombok.Setter; -import org.apache.commons.codec.binary.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.api.notification.channel.template.TemplateProvider; import org.exoplatform.commons.api.notification.model.ChannelKey; diff --git a/wallet-services/src/test/java/io/meeds/wallet/test/mock/IdentityManagerMock.java b/wallet-services/src/test/java/io/meeds/wallet/test/mock/IdentityManagerMock.java index e5af5b9a2..6e5490456 100644 --- a/wallet-services/src/test/java/io/meeds/wallet/test/mock/IdentityManagerMock.java +++ b/wallet-services/src/test/java/io/meeds/wallet/test/mock/IdentityManagerMock.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; -import org.apache.commons.codec.binary.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.utils.ListAccess; import org.exoplatform.social.core.identity.IdentityProvider;