diff --git a/app/client/src/api/ActionAPI.tsx b/app/client/src/api/ActionAPI.tsx index 69230ed793f4..921dfe9e1d19 100644 --- a/app/client/src/api/ActionAPI.tsx +++ b/app/client/src/api/ActionAPI.tsx @@ -165,7 +165,7 @@ class ActionAPI extends API { static async createAction( apiConfig: Partial, ): Promise> { - return API.post(ActionAPI.url, apiConfig); + return API.post(ActionAPI.url, { ...apiConfig, eventData: undefined }); } static async fetchActions( diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/AnalyticsInfo.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/AnalyticsInfo.java deleted file mode 100644 index f942844d93ed..000000000000 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/AnalyticsInfo.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.appsmith.external.models; - -import com.appsmith.external.views.FromRequest; -import com.appsmith.external.views.Views; -import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -import java.util.Map; - -@Getter -@Setter -@ToString -@NoArgsConstructor -public class AnalyticsInfo { - @JsonView({Views.Public.class, FromRequest.class}) - private Map analyticsData; -} diff --git a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java index dd9b6ca66a51..a99034a694c6 100644 --- a/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java +++ b/app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java @@ -6,7 +6,6 @@ import com.appsmith.external.exceptions.ErrorDTO; import com.appsmith.external.helpers.Identifiable; import com.appsmith.external.models.ActionConfiguration; -import com.appsmith.external.models.AnalyticsInfo; import com.appsmith.external.models.CreatorContextType; import com.appsmith.external.models.Datasource; import com.appsmith.external.models.DefaultResources; @@ -156,11 +155,6 @@ public class ActionCE_DTO implements Identifiable, Executable { @JsonView(Views.Internal.class) DefaultResources defaultResources; - // This field will be used to store analytics data related to this specific domain object. It's been introduced in - // order to track success metrics of modules. Learn more on GitHub issue#24734 - @JsonView({Views.Public.class, FromRequest.class}) - AnalyticsInfo eventData; - @JsonView(Views.Internal.class) protected Instant createdAt; @@ -211,7 +205,6 @@ public EntityReferenceType getEntityReferenceType() { public void sanitiseToExportDBObject() { this.resetTransientFields(); - this.setEventData(null); this.setDefaultResources(null); this.setUpdatedAt(null); this.setCacheResponse(null); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ActionServiceCE_Test.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ActionServiceCE_Test.java index 62a60a0d7f73..8f9fd552e72f 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ActionServiceCE_Test.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ActionServiceCE_Test.java @@ -6,7 +6,6 @@ import com.appsmith.external.helpers.AppsmithEventContextType; import com.appsmith.external.models.ActionConfiguration; import com.appsmith.external.models.ActionDTO; -import com.appsmith.external.models.AnalyticsInfo; import com.appsmith.external.models.Datasource; import com.appsmith.external.models.DatasourceConfiguration; import com.appsmith.external.models.DatasourceStorageDTO; @@ -1567,44 +1566,4 @@ public void validateAndSaveActionToRepository_ActionDTOHasCreatedAtUpdatedAtFiel assertThat(savedAction.getCreatedAt()).isNotNull(); assertThat(savedAction.getUpdatedAt()).isNotNull(); } - - @Test - @WithUserDetails(value = "api_user") - public void createCopyActionWithAnalyticsData_validateAnalyticsDataPersistsInResponse() { - Mockito.when(pluginExecutorHelper.getPluginExecutor(Mockito.any())) - .thenReturn(Mono.just(new MockPluginExecutor())); - - ActionDTO action = new ActionDTO(); - action.setName("CopyOfQuery1"); - action.setPageId(testPage.getId()); - action.setDatasource(datasource); - ActionConfiguration actionConfiguration = new ActionConfiguration(); - actionConfiguration.setPluginSpecifiedTemplates(List.of(new Property(null, true))); - - AnalyticsInfo analyticsInfo = new AnalyticsInfo(); - Map analyticsData = new HashMap<>(); - String keyOriginalActionId = "originalActionId"; - String valueOriginalActionId = "xyz"; - analyticsData.put(keyOriginalActionId, valueOriginalActionId); - analyticsInfo.setAnalyticsData(analyticsData); - action.setEventData(analyticsInfo); - - action.setActionConfiguration(actionConfiguration); - - Mono actionMono = - Mono.just(action).flatMap(action1 -> layoutActionService.createSingleAction(action1, Boolean.FALSE)); - StepVerifier.create(actionMono) - .assertNext(createdAction -> { - assertThat(createdAction.getId()).isNotEmpty(); - assertThat(createdAction.getName()).isEqualTo(action.getName()); - assertThat(createdAction.getIsValid()).isTrue(); - assertThat(createdAction - .getEventData() - .getAnalyticsData() - .get(keyOriginalActionId) - .toString() - .equalsIgnoreCase(valueOriginalActionId)); - }) - .verifyComplete(); - } }