-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add layout on load actions to import block API response (#31993)
## Description * After importing the block into a page, the browser does not have the updated values on the on page load actions. * The newly created actions, actionCollections which needs to run after adding the block to canvas are missing. * This is because unlike normal flow, here the server fetch the Block data from DSL and then has to import it and send the widget DSL from the block to client so that the widgets are visible on the canvas. Hence adding this to response to make the experience same as other widgets Fixes #31992 ## Automation /ok-to-test tags="tag.ImportExport" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8379501235> > Commit: `a6599b14c4027179f79a31b3d6a8e1dad1cc96f0` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8379501235&attempt=1" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new data structure to enhance building block imports, including widget layouts and onPageLoad actions. - **Refactor** - Updated the import functionality to utilize the new data structure for building blocks, improving the handling of layout data and onPageLoad actions. - **Tests** - Modified unit tests to align with the new data structure for building block imports, ensuring compatibility and correctness. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
7643b6e
commit 6b3c9f4
Showing
5 changed files
with
85 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...rver/appsmith-server/src/main/java/com/appsmith/server/dtos/BuildingBlockResponseDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.appsmith.server.dtos; | ||
|
||
import com.appsmith.external.dtos.DslExecutableDTO; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
public class BuildingBlockResponseDTO { | ||
String widgetDsl; | ||
|
||
List<DslExecutableDTO> onPageLoadActions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters