From 9af1f4c9f4de0e1ca807720a0eabbc1d820baf29 Mon Sep 17 00:00:00 2001 From: Nidhi Date: Thu, 23 Dec 2021 19:46:30 +0530 Subject: [PATCH] fix: Switched reference from package name to plugin name (#9916) --- .../com/appsmith/server/services/ce/PluginServiceCEImpl.java | 2 +- .../server/solutions/ce/AuthenticationServiceCEImpl.java | 3 ++- .../solutions/ce/ImportExportApplicationServiceCEImpl.java | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/PluginServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/PluginServiceCEImpl.java index 1afd2fed3c..9b46b0faaa 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/PluginServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/PluginServiceCEImpl.java @@ -307,7 +307,7 @@ public class PluginServiceCEImpl extends BaseService this.findById(datasource.getPluginId()) - .map(Plugin::getPackageName)); + .map(plugin -> plugin.getPluginName() == null ? plugin.getPackageName() : plugin.getPluginName())); } @Override diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java index 332054aac9..b9ec7ec751 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/AuthenticationServiceCEImpl.java @@ -423,7 +423,8 @@ public class AuthenticationServiceCEImpl implements AuthenticationServiceCE { integrationDTO.setInstallationKey(installationKey); integrationDTO.setAuthenticationResponse(oAuth2.getAuthenticationResponse()); integrationDTO.setScope(oAuth2.getScope()); - integrationDTO.setPluginName(plugin.getPackageName()); + integrationDTO.setPluginName(plugin.getPluginName()); + integrationDTO.setPluginVersion(plugin.getVersion()); WebClient.Builder builder = WebClient .builder() diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java index 46aa8f64d4..df13abf480 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ImportExportApplicationServiceCEImpl.java @@ -132,7 +132,7 @@ public class ImportExportApplicationServiceCEImpl implements ImportExportApplica return pluginRepository .findAll() .map(plugin -> { - pluginMap.put(plugin.getId(), plugin.getPackageName()); + pluginMap.put(plugin.getId(), plugin.getPluginName() == null ? plugin.getPackageName() : plugin.getPluginName()); return plugin; }) .then(applicationMono) @@ -452,7 +452,8 @@ public class ImportExportApplicationServiceCEImpl implements ImportExportApplica return pluginRepository.findAll() .map(plugin -> { - pluginMap.put(plugin.getPackageName(), plugin.getId()); + final String pluginReference = plugin.getPluginName() == null ? plugin.getPackageName() : plugin.getPluginName(); + pluginMap.put(pluginReference, plugin.getId()); return plugin; }) .then(organizationService.findById(organizationId, AclPermission.ORGANIZATION_MANAGE_APPLICATIONS))