From 599bb4a1f790df7cc15ffc8371dddf11b3089d8d Mon Sep 17 00:00:00 2001 From: Nilesh Sarupriya Date: Thu, 13 Mar 2025 17:08:41 +0530 Subject: [PATCH] chore: add getters to query and js object (#39718) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Sanity" ### :mag: Cypress test results > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: > Commit: 3dc2afc38d31810de3edbd8bdb4e67c68aa8b9a6 > Workflow: `PR Automation test suite` > Tags: `@tag.Sanity` > Spec: `` >
Thu, 13 Mar 2025 11:35:36 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **New Features** - Introduced alternative access methods for key action identifiers, allowing for more consistent and clearer retrieval of application and page data. --------- Co-authored-by: Nilesh Sarupriya <20905988+nsarupr@users.noreply.github.com> --- .../com/appsmith/external/models/ce/ActionCE_DTO.java | 11 +++++++++++ .../server/dtos/ce/ActionCollectionCE_DTO.java | 11 +++++++++++ 2 files changed, 22 insertions(+) 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 fa6f2c4905..850ecd44be 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 @@ -19,6 +19,7 @@ import com.appsmith.external.views.FromRequest; import com.appsmith.external.views.Git; import com.appsmith.external.views.Views; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; import lombok.Getter; import lombok.NoArgsConstructor; @@ -348,4 +349,14 @@ public class ActionCE_DTO implements Identifiable, Executable { } public static class Fields {} + + @JsonIgnore + public String getArtifactId() { + return this.getApplicationId(); + } + + @JsonIgnore + public String getContextId() { + return this.getPageId(); + } } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/ActionCollectionCE_DTO.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/ActionCollectionCE_DTO.java index 3ae34fcc15..11cc2d68a1 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/ActionCollectionCE_DTO.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/dtos/ce/ActionCollectionCE_DTO.java @@ -11,6 +11,7 @@ import com.appsmith.server.constants.FieldName; import com.appsmith.server.domains.ActionCollection; import com.appsmith.server.exceptions.AppsmithError; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; import lombok.Getter; @@ -144,4 +145,14 @@ public class ActionCollectionCE_DTO { } public static class Fields {} + + @JsonIgnore + public String getArtifactId() { + return this.getApplicationId(); + } + + @JsonIgnore + public String getContextId() { + return this.getPageId(); + } }