-
Notifications
You must be signed in to change notification settings - Fork 4.2k
ci: Fixing remaining 4 failing cypress test cases #40515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Fixing remaining 4 failing cypress test cases #40515
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis change migrates the action execution trigger property from a boolean Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI (Dropdown)
participant Redux Saga
participant API Layer
participant Backend Controller
participant Backend Service
participant Database
User->>UI (Dropdown): Selects run behavior ("On page load"/"Manual")
UI (Dropdown)->>Redux Saga: Dispatches SET_ACTION_RUN_BEHAVIOR with runBehavior
Redux Saga->>API Layer: Calls updateActionRunBehavior(actionId, runBehavior)
API Layer->>Backend Controller: PUT /runBehavior/{actionId} { behavior: runBehavior }
Backend Controller->>Backend Service: setRunBehavior(actionId, runBehavior)
Backend Service->>Database: Update action.runBehavior & sync executeOnLoad
Database-->>Backend Service: Persisted action
Backend Service-->>Backend Controller: Updated action DTO
Backend Controller-->>API Layer: Response with updated action
API Layer-->>Redux Saga: Returns updated action
Redux Saga-->>UI (Dropdown): Update state/UI with new run behavior
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (4)
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts (1)
152-152
:⚠️ Potential issueRemove use of agHelper.Sleep() per coding guidelines.
The coding guidelines specifically prohibit the use of
agHelper.Sleep()
in Cypress tests. Use Cypress's built-in waiting mechanisms or explicit assertions instead.- agHelper.Sleep(); + // Properly wait for any UI changes or use explicit assertions + agHelper.WaitUntilAllToastsDisappear();app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts (1)
92-92
: 🛠️ Refactor suggestionReplace agHelper.Sleep() with proper waiting mechanisms.
Multiple instances of
agHelper.Sleep()
throughout the file violate the Cypress best practices outlined in the coding guidelines. Replace with element visibility or network request assertions.-agHelper.Sleep(500); +cy.waitUntil(() => EditorNavigation.GetEntityState("ParamsTest", EntityType.Query) === "ACTIVE", { + errorMsg: "Query did not become active in time", + timeout: 10000, + interval: 500 +});Also applies to: 108-108, 124-124, 140-140, 156-156, 172-172, 188-188, 204-204, 220-220, 240-240
app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts (1)
94-94
: 🛠️ Refactor suggestionRemove explicit sleep call.
Using
agHelper.Sleep(2000)
violates the Cypress best practices outlined in the coding guidelines. Replace with a proper waiting mechanism based on UI state.-_.agHelper.Sleep(2000); +_.agHelper.WaitUntilToastDisappear();app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts (1)
372-372
:⚠️ Potential issueRemove agHelper.Sleep() call.
The codebase guidelines specify to avoid using
agHelper.Sleep()
. Consider replacing this with a more deterministic wait mechanism.- agHelper.Sleep(); //settimeout timer, hence sleep needed here! + agHelper.WaitForCondition( + agHelper + .GetElement( + locators._widgetInDeployed(draggableWidgets.INPUT_V2) + + " " + + locators._input, + ) + .then(($ele) => { + return cy.wrap($ele).should("include.value", "local label"); + }), + );
🧹 Nitpick comments (12)
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts (1)
71-83
: Consider using better test cleanup practices.The
after
block usage conflicts with the coding guidelines. Consider moving cleanup logic to a reusable helper function that could be called conditionally within each test usingcy.then()
.-after(() => { - PageLeftPane.switchSegment(PagePaneSegment.Queries); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "PageLoadApi", - action: "Delete", - entityType: entityItems.Api, - }); - entityExplorer.ActionContextMenuByEntityName({ - entityNameinLeftSidebar: "PageLoadApi2", - action: "Delete", - entityType: entityItems.Api, - }); -});Create a helper function instead:
function cleanupTestApis() { PageLeftPane.switchSegment(PagePaneSegment.Queries); entityExplorer.ActionContextMenuByEntityName({ entityNameinLeftSidebar: "PageLoadApi", action: "Delete", entityType: entityItems.Api, }); entityExplorer.ActionContextMenuByEntityName({ entityNameinLeftSidebar: "PageLoadApi2", action: "Delete", entityType: entityItems.Api, }); } // Then call at the end of the last test it("2. Shows when API failed to load on page load.", function () { // test logic... cy.then(() => { cleanupTestApis(); }); });app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCE.java (1)
21-21
: Good addition of setRunBehavior method.The new method properly complements the existing setExecuteOnLoad method, supporting the transition to the more flexible run behavior model.
Consider adding Javadoc to document the method's purpose and parameters.
+ /** + * Sets the run behavior for an action + * @param id The action ID + * @param behavior The run behavior to set + * @return Updated ActionDTO + */ Mono<ActionDTO> setRunBehavior(String id, RunBehaviorEnum behavior);app/client/test/factories/Actions/JSObject.ts (2)
33-33
: Consider using enum value instead of string literalUsing string literals for runBehavior might lead to inconsistencies. Consider importing and using the ActionRunBehaviour enum for better type safety and consistency with other files.
+import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes"; - runBehavior: "MANUAL", + runBehavior: ActionRunBehaviour.MANUAL,
73-73
: Same string literal usage hereSame issue as with the first action object - using string literals instead of the enum value.
- runBehavior: "MANUAL", + runBehavior: ActionRunBehaviour.MANUAL,app/client/src/ce/sagas/PageSagas.tsx (2)
543-543
: Replace direct hasOwnProperty call with Object.hasOwn().Using hasOwnProperty method directly on objects can be problematic if the object has a property with the same name or if it's null/undefined.
- if (d.hasOwnProperty("collectionId")) + if (Object.hasOwn(d, "collectionId"))🧰 Tools
🪛 Biome (1.9.4)
[error] 543-543: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.(lint/suspicious/noPrototypeBuiltins)
546-547
: Consider using optional chaining and update dispatch to use runBehavior.The action dispatch properly uses the new runBehavior pattern, but we could improve the null safety with optional chaining.
- if (jsActions && jsActions.length) { + if (jsActions?.length) { yield put(setJSActionsRunBehavior(jsActions)); }🧰 Tools
🪛 Biome (1.9.4)
[error] 546-546: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
5-8
: DefineActionRunBehaviour
enum.The enum with
"ON_PAGE_LOAD"
and"MANUAL"
values encapsulates possible behaviors. Consider aligning spelling with American English (e.g.,ActionRunBehavior
) to matchrunBehavior
property naming.
10-23
: Map enum to UI metadata.The
RUN_BEHAVIOR
object cleanly pairs labels and subtexts with enum values. Thechildren
fields duplicatelabel
—you may remove them if not consumed by your dropdown component.app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java (1)
1404-1441
: Comprehensive test for backward compatibility.This test ensures that the legacy executeOnLoad property properly updates the new runBehavior property, validating the backward compatibility mechanism.
One minor stylistic note: Consider using the conventional JUnit assertion order of
assertEquals(expected, actual)
rather thanassertEquals(actual, expected)
for consistency with standard practices, though this doesn't affect test functionality.app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts (3)
10092-10109
: Duplicated dropdown configurationThis dropdown configuration is identical to the previous one. Consider refactoring to use a shared configuration object to avoid duplication.
+ // Define a shared configuration object for run behavior dropdown + const runBehaviorConfig = { + label: "Run behavior", + configProperty: "runBehavior", + controlType: "DROP_DOWN", + initialValue: "MANUAL", + options: [ + { + label: "On page load", + subText: "Query runs when the page loads or when manually triggered", + value: "ON_PAGE_LOAD", + }, + { + label: "Manual", + subText: "Query only runs when called in an event or JS with .run()", + value: "MANUAL", + }, + ], + }; // Then use it in each configuration section { children: [ - { - label: "Run behavior", - configProperty: "runBehavior", - controlType: "DROP_DOWN", - initialValue: "MANUAL", - options: [ - { - label: "On page load", - subText: "Query runs when the page loads or when manually triggered", - value: "ON_PAGE_LOAD", - }, - { - label: "Manual", - subText: "Query only runs when called in an event or JS with .run()", - value: "MANUAL", - }, - ], - }, + {...runBehaviorConfig}, // Other controls ] }
10143-10160
: Repeated dropdown configuration for API componentsThis is the third instance of the same dropdown configuration. Consider using a shared configuration object as suggested earlier.
10223-10240
: Final instance of duplicated dropdown configurationThis is the fourth instance of the same dropdown configuration. Using a shared configuration object would reduce maintenance burden and ensure consistency.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (93)
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObject_Tests_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts
(4 hunks)app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts
(2 hunks)app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts
(6 hunks)app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts
(1 hunks)app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts
(1 hunks)app/client/cypress/fixtures/PartialImportExport/PartialImportExportSampleApp.json
(6 hunks)app/client/cypress/fixtures/PartialImportExport/QueriesExportedOnly.json
(1 hunks)app/client/cypress/support/Pages/ApiPage.ts
(3 hunks)app/client/cypress/support/Pages/JSEditor.ts
(3 hunks)app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx
(1 hunks)app/client/src/PluginActionEditor/constants/PluginActionConstants.ts
(0 hunks)app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts
(1 hunks)app/client/src/PluginActionEditor/types/PluginActionTypes.ts
(1 hunks)app/client/src/actions/pluginActionActions.ts
(2 hunks)app/client/src/api/ActionAPI.tsx
(2 hunks)app/client/src/api/PageApi.tsx
(2 hunks)app/client/src/ce/components/editorComponents/GPT/index.tsx
(1 hunks)app/client/src/ce/constants/ReduxActionConstants.tsx
(4 hunks)app/client/src/ce/constants/messages.ts
(1 hunks)app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts
(4 hunks)app/client/src/ce/reducers/entityReducers/actionsReducer.tsx
(3 hunks)app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx
(4 hunks)app/client/src/ce/sagas/PageSagas.tsx
(2 hunks)app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts
(2 hunks)app/client/src/ce/utils/moduleInstanceNavigationData.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/EditorConfig.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/MarkHelpers/entityMarker.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts
(1 hunks)app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx
(1 hunks)app/client/src/components/editorComponents/CodeEditor/index.tsx
(1 hunks)app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts
(10 hunks)app/client/src/components/editorComponents/utils.test.ts
(2 hunks)app/client/src/components/formControls/DropDownControl.tsx
(4 hunks)app/client/src/components/formControls/utils.ts
(1 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts
(1 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts
(1 hunks)app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts
(1 hunks)app/client/src/entities/Action/actionProperties.test.ts
(1 hunks)app/client/src/entities/Action/index.ts
(2 hunks)app/client/src/entities/DataTree/dataTreeTypes.ts
(2 hunks)app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts
(1 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx
(5 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx
(3 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts
(1 hunks)app/client/src/pages/Editor/JSEditor/utils.test.ts
(2 hunks)app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json
(8 hunks)app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json
(8 hunks)app/client/src/sagas/ActionExecution/PluginActionSaga.ts
(2 hunks)app/client/src/sagas/ActionSagas.ts
(4 hunks)app/client/src/sagas/BuildingBlockSagas/tests/fixtures.ts
(1 hunks)app/client/src/sagas/JSPaneSagas.ts
(4 hunks)app/client/src/selectors/navigationSelectors.ts
(1 hunks)app/client/src/utils/DynamicBindingUtils.test.ts
(1 hunks)app/client/src/utils/FilterInternalProperties/JsAction.ts
(2 hunks)app/client/src/utils/JSPaneUtils.test.ts
(11 hunks)app/client/src/utils/JSPaneUtils.tsx
(5 hunks)app/client/src/utils/NavigationSelector/JsChildren.ts
(1 hunks)app/client/src/utils/NavigationSelector/WidgetChildren.ts
(1 hunks)app/client/src/utils/NavigationSelector/common.ts
(1 hunks)app/client/test/factories/Actions/API.ts
(1 hunks)app/client/test/factories/Actions/GoogleSheetFactory.ts
(1 hunks)app/client/test/factories/Actions/JSObject.ts
(2 hunks)app/client/test/factories/Actions/Postgres.ts
(1 hunks)app/client/test/factories/MockPluginsState.ts
(4 hunks)app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/RunBehaviorEnum.java
(1 hunks)app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java
(2 hunks)app/server/appsmith-plugins/amazons3Plugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/anthropicPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/appsmithAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/firestorePlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/googleAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mongoPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mssqlPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/mysqlPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-plugins/postgresPlugin/src/main/resources/setting.json
(1 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ActionControllerCE.java
(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCE.java
(2 hunks)app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java
(3 hunks)app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java
(2 hunks)
💤 Files with no reviewable changes (1)
- app/client/src/PluginActionEditor/constants/PluginActionConstants.ts
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObject_Tests_spec.ts
app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts
app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts
app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts
app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts
app/client/cypress/fixtures/PartialImportExport/PartialImportExportSampleApp.json
app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts
app/client/cypress/fixtures/PartialImportExport/QueriesExportedOnly.json
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts
app/client/cypress/support/Pages/ApiPage.ts
app/client/cypress/support/Pages/JSEditor.ts
🧬 Code Graph Analysis (15)
app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
RUN_BEHAVIOR
(10-23)RUN_BEHAVIOR_VALUES
(25-25)
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js (1)
jsEditor
(7-12)
app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
RUN_BEHAVIOR
(10-23)RUN_BEHAVIOR_VALUES
(25-25)
app/client/src/api/PageApi.tsx (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/api/ActionAPI.tsx (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/entities/Action/index.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
app/client/src/components/formControls/DropDownControl.tsx (2)
app/client/src/ce/pages/workspace/InviteUsersForm.tsx (1)
OptionLabel
(127-134)app/client/packages/design-system/widgets/src/components/Text/src/Text.tsx (1)
Text
(66-66)
app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
RUN_BEHAVIOR
(10-23)RUN_BEHAVIOR_VALUES
(25-25)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx (3)
app/client/src/ce/pages/workspace/InviteUsersForm.tsx (1)
OptionLabel
(127-134)app/client/packages/design-system/widgets/src/components/Text/src/Text.tsx (1)
Text
(66-66)app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
RUN_BEHAVIOR_VALUES
(25-25)ActionRunBehaviourType
(27-27)
app/client/src/entities/DataTree/dataTreeTypes.ts (1)
app/client/src/ce/entities/DataTree/types.ts (1)
EntityTypeValue
(37-37)
app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js (1)
jsEditor
(7-12)
app/client/src/actions/pluginActionActions.ts (2)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)app/client/src/ce/constants/ReduxActionConstants.tsx (1)
ReduxActionTypes
(1281-1324)
app/client/src/ce/sagas/PageSagas.tsx (2)
app/client/src/actions/pluginActionActions.ts (2)
setActionsRunBehavior
(355-366)setJSActionsRunBehavior
(368-380)app/client/src/entities/DataTree/dataTreeFactory.ts (2)
actions
(129-156)jsActions
(110-127)
app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx (2)
app/client/src/ce/constants/ReduxActionConstants.tsx (1)
ReduxActionTypes
(1281-1324)app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
ActionRunBehaviourType
(27-27)
🪛 Biome (1.9.4)
app/client/src/ce/sagas/PageSagas.tsx
[error] 543-543: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.
(lint/suspicious/noPrototypeBuiltins)
[error] 546-546: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: perform-test / client-build / client-build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: server-unit-tests / server-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: client-unit-tests / client-unit-tests
🔇 Additional comments (179)
app/client/src/entities/DataTree/dataTreeTypes.ts (2)
28-44
: Clean addition of NavigationData interfaceThe new NavigationData interface provides a well-structured representation for navigation entities with appropriate typing. The interface includes all necessary properties for navigation with proper optional flags where needed. This centralizes the navigation data structure in one location rather than having duplicate definitions.
46-46
: Good type definition for EntityNavigationDataThe type alias provides a clear definition for storing collections of NavigationData objects, making it easier to reference this type throughout the codebase.
app/client/src/ce/utils/moduleInstanceNavigationData.ts (1)
2-2
: Correctly updated import sourceImport has been properly updated to reference the newly centralized type definition.
app/client/src/components/editorComponents/CodeEditor/generateQuickCommands.tsx (1)
17-17
: Properly updated import pathImport path has been correctly updated to use the centralized type definition.
app/client/src/utils/NavigationSelector/common.ts (1)
5-5
: Correctly updated import sourceImport has been properly updated to reference the centralized type definitions, maintaining consistency across the codebase.
app/client/src/ce/components/editorComponents/GPT/index.tsx (1)
6-6
: Import path refactored for better type centralization.The import path for
EntityNavigationData
type has been updated to use the centralized type definition fromentities/DataTree/dataTreeTypes
. This is part of a broader refactoring to centralize navigation-related types.app/client/src/utils/NavigationSelector/JsChildren.ts (1)
7-10
: Import path refactored for better type centralization.The import path for navigation-related types (
EntityNavigationData
andNavigationData
) has been updated to use the centralized type definitions fromentities/DataTree/dataTreeTypes
. This maintains consistency with similar changes across the codebase.app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx (1)
16-16
: Updated import path for THEME constant.The import for
THEME
has been moved from"../../constants/PluginActionConstants"
to"../../types/PluginActionTypes"
as part of the broader refactoring effort that replaces the booleanexecuteOnLoad
flag with a string-basedrunBehavior
property.app/client/src/utils/NavigationSelector/WidgetChildren.ts (1)
5-5
: Import path refactored for better type centralization.The import path for
EntityNavigationData
type has been updated to use the centralized type definition fromentities/DataTree/dataTreeTypes
. This aligns with the similar changes made in other navigation-related files.app/client/cypress/e2e/Regression/ClientSide/JSObject/JSObject_Tests_spec.ts (1)
36-36
: LGTM: Parameter change aligns with the runBehavior refactoring.The update correctly changes the second parameter to use the explicit string literal "On page load" instead of a boolean value, aligning with the codebase-wide migration from boolean
executeOnLoad
to string-basedrunBehavior
.app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts (1)
168-168
: LGTM: Parameter change aligns with the runBehavior refactoring.The change correctly updates the call to
ToggleOnPageLoadRun
to use the string literal "On page load" instead of a boolean value, which is consistent with the system-wide migration to the new run behavior model.app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts (1)
18-21
: LGTM: Import path updated for centralized type definitions.The import path for navigation-related types has been correctly updated to use the centralized location in "entities/DataTree/dataTreeTypes", supporting better type consistency across the codebase.
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_MultiPart_Spec.ts (1)
145-145
: LGTM: Parameter change aligns with the runBehavior refactoring.The change correctly updates the call to
ToggleOnPageLoadRun
to use the string literal "Manual" instead of a boolean value, consistent with the system-wide migration to the new run behavior model.app/client/cypress/e2e/Regression/ServerSide/Params/PassingParams_Spec.ts (1)
79-79
: Update to string-based run behavior parameter looks good.The parameter change from boolean to string-based "Manual" aligns with the codebase-wide migration from
executeOnLoad
torunBehavior
.app/client/cypress/e2e/Regression/ClientSide/PublishedApps/PublishedModeToastToggle_Spec.ts (1)
25-25
: String-based run behavior parameters look good.The changes from boolean to string-based "On page load" match the refactoring of run behavior across the codebase.
Also applies to: 32-32
app/client/src/components/editorComponents/CodeEditor/MarkHelpers/entityMarker.ts (1)
1-4
: Import path update looks good.The change to import types from the centralized location
entities/DataTree/dataTreeTypes
improves code organization and reduces duplication.app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts (1)
53-53
: String-based run behavior parameter looks good.The parameter change from boolean to string-based "On page load" is consistent with the codebase-wide refactoring of run behavior.
app/client/src/utils/DynamicBindingUtils.test.ts (1)
123-123
: Looks good - migration from executeOnLoad to runBehaviorThe change from boolean
executeOnLoad: false
to string-basedrunBehavior: "MANUAL"
aligns with the codebase's migration to the new run behavior paradigm.app/client/cypress/e2e/Regression/ClientSide/ActionExecution/FrameworkFunctions_ShowCloseModalFunctions_spec.ts (1)
49-49
: Correct update of parameter for the migrationThe parameter passed to
apiPage.clickSettingIcon
has been properly updated from a boolean to the string literal"On page load"
, reflecting the UI changes from toggle switches to dropdown selectors for run behavior.app/client/src/components/editorComponents/CodeEditor/index.tsx (1)
125-125
: Import path update for centralized type definitionsThe import path for
EntityNavigationData
has been correctly updated to use the centralized type definition inentities/DataTree/dataTreeTypes
instead of the previous location.app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug14987_spec.js (1)
35-35
: UI label updated correctly for run behavior testThe test now correctly looks for the new label "Run behavior" instead of the previous "Run the query on page load", reflecting the UI changes due to the executeOnLoad to runBehavior migration.
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad2_Spec.ts (1)
97-97
: Function parameter updated to use descriptive string value.The code has been updated to use the string literal "On page load" instead of a boolean value (true) when enabling async function settings. This change makes the code more readable and follows the migration from boolean flags to explicit string-based run behavior specifications.
app/client/cypress/e2e/Regression/ServerSide/Datasources/Oracle_Spec.ts (1)
470-470
: Updated toggle parameter to use string literal.The toggle parameter has been changed from a boolean value (false) to the string literal "Manual", representing the same functionality but with a more descriptive value. This aligns with the codebase-wide migration from boolean executeOnLoad flags to string-based runBehavior specifications.
app/client/src/ce/constants/messages.ts (1)
2592-2592
: Updated message to reflect new execution model.The UI message has been updated from "Choose the functions to run on page load" to "Choose functions run behavior" to accurately reflect the new conceptual model where functions can have different execution triggers beyond the binary on/off page load setting.
app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts (1)
47-47
: Updated test fixture to use new runBehavior property.Test data has been migrated from using the boolean
executeOnLoad: false
property to the string-basedrunBehavior: "MANUAL"
property. This change maintains the same test behavior while ensuring the test fixtures match the updated data model used throughout the application.Also applies to: 89-89
app/client/src/sagas/BuildingBlockSagas/tests/fixtures.ts (1)
132-132
: LGTM - Change aligns with codebase migration pattern.The update from
executeOnLoad: true
torunBehavior: "ON_PAGE_LOAD"
follows the new pattern for action execution control.app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/JSOnLoad4_Spec.ts (1)
37-42
: String-based behavior verification looks good.The test now correctly verifies string-based run behavior settings ("Manual") instead of using boolean values, maintaining alignment with the updated UI and backend implementation.
app/client/test/factories/Actions/Postgres.ts (1)
34-34
: Factory update aligned with new property structure.The transition from
executeOnLoad: true
torunBehavior: "MANUAL"
in the factory ensures test data consistently uses the new execution behavior model.app/client/src/entities/Action/index.ts (2)
13-13
: New type import looks good.The import of
ActionRunBehaviourType
is correctly added to support the updated property structure.
143-143
: BaseAction interface property updated correctly.The property change from boolean
executeOnLoad
to string-basedrunBehavior: ActionRunBehaviourType
establishes the foundation for the execution model transition throughout the codebase.app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts (1)
84-84
: Property path check updated correctlyThe updated code correctly checks for
runBehavior
instead of the deprecatedexecuteOnLoad
property, aligning with the codebase migration to string-based run behavior values.app/client/cypress/e2e/Regression/ClientSide/BugTests/Bug20275_Spec.js (1)
33-33
: Run behavior parameter updated correctlyThe EnableDisableAsyncFuncSettings method now correctly uses the string value "On page load" instead of the boolean true, matching the new run behavior implementation.
app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts (4)
47-47
: Test data updated correctlyThe test definition now uses
runBehavior: "MANUAL"
instead of the deprecatedexecuteOnLoad: false
, correctly reflecting the new run behavior model.
94-94
: Test data updated correctlyThe test definition correctly uses
runBehavior: "MANUAL"
in place of the deprecatedexecuteOnLoad: false
.
242-242
: Test data updated correctlyThe second test case's data structure has been updated to use
runBehavior: "MANUAL"
consistent with the application's migration to string-based run behavior values.
289-289
: Test data updated correctlyThe function definition correctly uses
runBehavior: "MANUAL"
in place of the deprecatedexecuteOnLoad: false
.app/client/test/factories/Actions/GoogleSheetFactory.ts (1)
66-66
: Factory definition updated correctlyThe GoogleSheetFactory definition has been updated to use
runBehavior: "MANUAL"
instead of the deprecatedexecuteOnLoad: false
, aligning with the string-based run behavior model.app/client/src/entities/Action/actionProperties.test.ts (1)
13-13
: Looks good: BooleanexecuteOnLoad
properly replaced with stringrunBehavior
.This change correctly implements the migration from boolean flags to a string-based run behavior model.
app/client/test/factories/Actions/API.ts (1)
66-66
: Consistent behavior migration in test factory.The change to
runBehavior: "MANUAL"
aligns with the codebase-wide migration from boolean flags to the new string-based enum pattern.app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts (1)
18-18
: Updated test fixture with new run behavior model.Correctly migrated from the deprecated boolean property to the string-based run behavior property.
app/client/src/api/PageApi.tsx (2)
12-12
: Added proper import for run behavior type.Correctly importing the type definition for the new behavior model.
73-73
: API interface updated to support new run behavior model.The SavePageResponseData interface now properly returns the string-based run behavior instead of the deprecated boolean flag, maintaining consistency with the rest of the codebase.
app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (2)
1-4
: Good addition of new run behavior types.Clean import of the new run behavior types from the plugin action types module. This enables the transition from boolean to enum-based run behavior settings.
12-16
: Appropriate UI control migration from switch to dropdown.The migration from "executeOnLoad" boolean toggle to a "runBehavior" dropdown matches the architectural changes described in the PR. The dropdown properly uses the RUN_BEHAVIOR values and sets a sensible default to MANUAL mode.
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts (2)
3-3
: Good type import for run behavior.Adding the ActionRunBehaviourType import supports proper type checking for the updated interface.
6-6
: Proper type refinement for value property.Changing from a generic union type to the specific ActionRunBehaviourType provides better type safety and integrates with the new run behavior model.
app/client/src/components/editorComponents/CodeEditor/EditorConfig.ts (1)
3-6
: Consolidated imports for better organization.Good refactoring to group related type imports from the same module. This improves code maintainability and ensures consistent type usage.
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCE.java (1)
4-4
: Appropriate import for the new enum type.The import of RunBehaviorEnum supports the new run behavior functionality.
app/client/src/components/editorComponents/utils.test.ts (2)
1-2
: Appropriate import addition for ActionRunBehaviour enumThe import statement for ActionRunBehaviour is correctly added to support the migration from boolean executeOnLoad to enum-based runBehavior.
34-34
: Property migration looks goodThe TEST_JS_FUNCTION object correctly uses ActionRunBehaviour.MANUAL instead of the deprecated executeOnLoad boolean property, aligning with the codebase migration to a more descriptive run behavior model.
app/client/src/pages/Editor/JSEditor/utils.test.ts (2)
9-9
: Correct import for ActionRunBehaviourThe import statement is appropriately added to support the runBehavior property.
48-48
: Proper use of enum for runBehaviorThe BASE_JS_ACTION function correctly uses the enum value, demonstrating the proper way to set the runBehavior property.
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/RunBehaviorEnum.java (1)
1-9
: Well-structured enum implementationThe RunBehaviorEnum is properly defined with clear documentation and appropriate values that match the client-side implementation. This creates a consistent approach to action execution behavior across the stack.
app/client/src/sagas/ActionExecution/PluginActionSaga.ts (2)
172-172
: Added important import for the new action run behavior enum.This import is required to support the refactoring of action execution behavior from boolean flags to a more descriptive enum-based approach.
1557-1566
: Updated condition to use new runBehavior enum instead of boolean flag.This change correctly implements the migration from the boolean
executeOnLoad
flag to the new string-basedrunBehavior
property. The logic remains consistent - only clear responses for actions that shouldn't run on page load.app/client/cypress/e2e/Regression/ClientSide/SetProperty/WidgetPropertySetters2_spec.ts (2)
180-180
: Updated to use new string-based run behavior instead of boolean.The test now correctly uses "On page load" instead of a boolean value, aligning with the UI changes from switches to dropdowns for run behavior settings.
239-239
: Updated to use "Manual" string parameter instead of boolean.This change correctly updates the test to use the new string-based run behavior option, maintaining test functionality while adapting to the updated API.
app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (2)
1-4
: Added imports for the new run behavior constants.These imports bring in the necessary constants for setting up the dropdown options for run behavior.
12-16
: Replaced boolean switch with dropdown for run behavior selection.This configuration change properly transforms the UI control from a simple on/off switch to a more expressive dropdown menu with multiple run behavior options. The property name has been updated from
executeOnLoad
torunBehavior
to match the new data model.app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/SetTimeout_spec.ts (1)
230-230
: Updated parameter to use string-based run behavior value.Test now correctly uses "On page load" string instead of a boolean value, aligning with the updated API interface for managing async function execution settings.
app/server/appsmith-plugins/postgresPlugin/src/main/resources/setting.json (1)
8-23
: Well-structured migration from boolean to enum-based execution control.The new dropdown-based "Run behavior" setting with clear options for "On page load" and "Manual" provides better usability compared to the previous boolean flag. The subtext descriptions effectively explain the behavior of each option.
app/client/src/components/formControls/utils.ts (1)
425-425
: Special handling for runBehavior property added correctly.The modified condition prevents the new runBehavior property from being processed through the standard initialValue extraction, which is necessary for the executeOnLoad to runBehavior migration.
app/client/src/utils/JSPaneUtils.tsx (2)
6-6
: Appropriate import added for ActionRunBehaviour enum.Import statement correctly brings in the ActionRunBehaviour enum to support the migration from boolean executeOnLoad to string-based run behavior.
134-134
: Consistent replacement of executeOnLoad with runBehavior across JS action creation.All JS action creation functions have been updated to use the new runBehavior pattern with MANUAL as the default. This maintains consistent behavior with the previous implementation.
Also applies to: 233-233, 245-245, 285-285
app/client/src/utils/FilterInternalProperties/JsAction.ts (2)
4-4
: Correctly imported ActionRunBehaviour enum.The ActionRunBehaviour enum import is properly added to support the migration from executeOnLoad to runBehavior.
19-22
: Updated conditional logic to use runBehavior enum.The condition has been properly modified to check for ActionRunBehaviour.ON_PAGE_LOAD instead of the boolean executeOnLoad flag, maintaining the same logical behavior while using the new typed enum approach.
app/server/appsmith-plugins/anthropicPlugin/src/main/resources/setting.json (1)
8-23
: Improved control for action execution behaviorThe change from a boolean switch to a dropdown with clear options enhances both clarity and flexibility. The descriptive subtext for each option helps users understand exactly when their queries will run.
app/server/appsmith-plugins/mysqlPlugin/src/main/resources/setting.json (1)
8-23
: Consistent implementation of run behavior dropdown across pluginsGood consistency with the implementation seen in other plugins. The dropdown pattern with descriptive subtexts maintains a coherent user experience across the application.
app/client/src/selectors/navigationSelectors.ts (1)
36-36
: Centralized type definition importGood practice to import the type from a central location rather than defining it locally, ensuring consistent type usage across the codebase.
app/client/src/api/ActionAPI.tsx (2)
13-13
: Import of typed enum for run behaviorProper addition of the strongly-typed ActionRunBehaviourType import to support the refactored API method.
305-311
: API method updated to use run behavior enumGood implementation of the API method refactor from boolean toggle to typed string enum. The method name, parameter type, and endpoint are all consistently updated to reflect the new approach.
app/client/cypress/e2e/Regression/ClientSide/SetProperty/SetOptions_Spec.ts (4)
212-212
: Method argument updated for runBehavior.The change correctly updates the
EnableDisableAsyncFuncSettings
method call to use the new string-based parameter "On page load" instead of a boolean value.
271-271
: Method argument updated for runBehavior.The change correctly updates the
EnableDisableAsyncFuncSettings
method call to use the new string-based parameter "On page load" instead of a boolean value.
316-316
: Method argument updated for runBehavior.The change correctly updates the
EnableDisableAsyncFuncSettings
method call to use the new string-based parameter "On page load" instead of a boolean value.
358-358
: Method argument updated for runBehavior.The change correctly updates the
EnableDisableAsyncFuncSettings
method call to use the new string-based parameter "Manual" instead of a boolean value.app/server/appsmith-plugins/mssqlPlugin/src/main/resources/setting.json (1)
8-23
: Updated executeOnLoad to runBehavior with dropdown options.The configuration has been correctly migrated from a boolean switch to a dropdown with explicit options, improving the UX and making the behavior more descriptive.
app/server/appsmith-plugins/appsmithAiPlugin/src/main/resources/setting.json (1)
8-23
: Updated executeOnLoad to runBehavior with dropdown options.The configuration has been correctly migrated from a boolean switch to a dropdown with explicit options, improving the UX and making the behavior more descriptive.
app/server/appsmith-plugins/mongoPlugin/src/main/resources/setting.json (1)
8-23
: Updated executeOnLoad to runBehavior with dropdown options.The configuration has been correctly migrated from a boolean switch to a dropdown with explicit options, improving the UX and making the behavior more descriptive.
app/client/src/utils/JSPaneUtils.test.ts (1)
44-44
: All test objects consistently updated to use runBehaviorThe test file has been consistently updated to replace the deprecated
executeOnLoad: false
withrunBehavior: "MANUAL"
across all test objects. This aligns with the broader migration from boolean flags to string-based enum values for execution control.Also applies to: 86-86, 154-154, 196-196, 280-280, 361-361, 472-472, 552-552, 627-627, 702-702, 757-757
app/server/appsmith-plugins/googleAiPlugin/src/main/resources/setting.json (1)
8-23
: Plugin setting updated to use dropdown for run behaviorThe setting has been refactored from a boolean switch to a dropdown with more descriptive options. The dropdown provides better UX by clearly explaining the behavior of each option through subtext.
app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (2)
9-12
: Added imports for standardized run behavior constantsAppropriate imports have been added for the run behavior constants, ensuring consistency across the application.
20-24
: API Settings config updated to use standardized run behavior dropdownThe API settings configuration has been updated to use the standardized run behavior dropdown, replacing the previous boolean switch. This ensures consistency with other parts of the application and provides a more descriptive UI for users.
app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/setting.json (1)
8-23
: Google Sheets plugin settings updated for consistent run behavior controlThe Google Sheets plugin settings have been updated to use the same run behavior dropdown pattern as other plugins, ensuring a consistent UI experience across different plugin types.
app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json (1)
8-23
: Good implementation of the run behavior dropdown controlThe change from a boolean switch to a dropdown with explicit options improves usability and provides clearer context to users about each run behavior option.
app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json (1)
8-23
: Good implementation of the run behavior dropdown controlThe change from a boolean switch to a dropdown with explicit options improves usability and provides clearer context to users about each run behavior option.
app/server/appsmith-plugins/firestorePlugin/src/main/resources/setting.json (1)
8-23
: Good implementation of the run behavior dropdown controlThe change from a boolean switch to a dropdown with explicit options improves usability and provides clearer context to users about each run behavior option.
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java (3)
18-18
: LGTM: Added import for RunBehaviorEnumCorrectly imported the new enum to support the run behavior model.
104-110
: Properly deprecated the executeOnLoad fieldGood practice to mark the field as deprecated with appropriate Javadoc explaining the alternative.
112-113
: Well-implemented new runBehavior fieldThe new field correctly uses the RunBehaviorEnum type with a default value of MANUAL, which matches the initial values in the plugin settings.
app/client/test/factories/MockPluginsState.ts (1)
6955-7177
: Confirmed migration from boolean to enum-based run behaviorThe changes successfully replace the boolean
executeOnLoad
property with a string-basedrunBehavior
dropdown across all plugin types (REST API, GraphQL, Appsmith AI, PostgreSQL). The implementation uses consistent values ("ON_PAGE_LOAD"
and"MANUAL"
) with appropriate labels and descriptions.app/client/cypress/fixtures/PartialImportExport/PartialImportExportSampleApp.json (6)
2211-2211
: Correct mapping for JS actionmyFun2
.
The previous booleanexecuteOnLoad
flag has been properly replaced with"runBehavior": "MANUAL"
, reflecting that this action will now execute only when explicitly invoked.
2267-2267
: Correct mapping for JS actionaddNumbers
.
The migration fromexecuteOnLoad: false
to"runBehavior": "MANUAL"
is consistent here as well.
2321-2321
: Correct mapping for DB actionUpdateQuery
.
TheexecuteOnLoad: false
case is accurately converted into"runBehavior": "MANUAL"
.
2386-2386
: Correct mapping for DB actionInsertQuery
.
The fixture now reads"runBehavior": "MANUAL"
in place ofexecuteOnLoad: false
, which is the intended behavior for manual inserts.
2450-2450
: Correct mapping for DB actionDeleteQuery
.
ReplacingexecuteOnLoad: false
with"runBehavior": "MANUAL"
correctly prevents automatic deletion on import.
2502-2502
: Correct mapping for DB actionSelectQuery
.
The originalexecuteOnLoad: true
flag has been properly transitioned to"runBehavior": "ON_PAGE_LOAD"
, ensuring this query still runs automatically when the page loads.app/client/src/ce/sagas/PageSagas.tsx (2)
91-92
: Import names updated correctly for new run behavior model.The imports have been properly updated to align with the new run behavior paradigm, replacing the previous executeOnLoad boolean approach with the more flexible runBehavior string-based approach.
539-539
: Action dispatch updated to use new runBehavior action creator.The action creator has been correctly updated to match the new runBehavior paradigm.
app/server/appsmith-plugins/amazons3Plugin/src/main/resources/setting.json (1)
8-23
: Clean migration from boolean switch to semantic dropdown.The UI control has been successfully updated from a simple boolean switch to a more expressive dropdown with clear labels and helpful subtext. This change aligns with the platform-wide move from executeOnLoad to runBehavior, providing better UX by explaining the behavior of each option.
app/client/src/ce/reducers/entityReducers/actionsReducer.tsx (2)
16-16
: Added appropriate type import for ActionRunBehaviourType.The proper type has been imported to support the new run behavior model.
314-332
: Reducer handler properly updated for runBehavior.The reducer has been correctly updated to handle the new action type and payload structure, maintaining the same update pattern but applying it to the runBehavior property instead of executeOnLoad.
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx (4)
6-6
: Added ActionRunBehaviour enum import.Proper import of the enum ensures consistent usage of the run behavior values in tests.
19-29
: Test updated to check disabled state of run behavior dropdown.The test has been correctly updated to validate the disabled state of the component with the new run behavior UI.
31-41
: Test updated to check for combobox role instead of switch.The test has been properly modified to verify the presence of dropdown controls instead of switches, reflecting the UI changes.
43-72
: Updated test to verify dropdown selection state.The test now correctly validates both possible states of the run behavior dropdown ("On page load" and "Manual") using specific CSS selectors to target the dropdown items.
app/client/src/components/formControls/DropDownControl.tsx (4)
23-23
: Added Flex and Text components to enhance dropdown options.The import has been extended to include Flex and Text from @appsmith/ads, which will be used for the new styled components.
32-43
: Added styled components for better dropdown option presentation.Two new styled components were created:
OptionLabel
- For styling the main option text with appropriate color, font size, and weightOptionSubText
- For styling the secondary text with muted color and smaller font sizeThis enhances the visual hierarchy and readability of dropdown options.
477-477
: Fixed dropdown list height for better user experience.Setting a consistent list height (240px) ensures the dropdown has adequate space to display options while maintaining a reasonable size in the UI.
511-529
: Enhanced dropdown options rendering with support for subtexts.The
renderOptionWithIcon
function now supports options with a subtext property, displaying them in a vertical layout with the main label and subtext stacked. This provides a more informative and visually appealing dropdown experience.app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ActionControllerCE.java (3)
5-5
: Added import for RunBehaviorEnum used in the new endpoint.Part of the migration from boolean executeOnLoad to a more descriptive enum-based approach.
119-127
: Added new endpoint for setting action run behavior.A new REST endpoint has been implemented to support the migration from boolean
executeOnLoad
to the more expressiveRunBehaviorEnum
. The implementation follows the controller's existing patterns and properly delegates to the service layer.
129-133
: Properly deprecated the legacy executeOnLoad endpoint.Good practice to:
- Add proper Javadoc documentation explaining the deprecation
- Include a reference to the replacement endpoint
- Apply the @deprecated annotation
This approach ensures backward compatibility while guiding developers to use the new API.
app/client/cypress/e2e/Regression/ServerSide/JsFunctionExecution/JSFunctionExecution_spec.ts (6)
18-24
: Updated interface to use string-based run behavior instead of boolean.Changed
onPageLoad: boolean
torunBehavior: "On page load" | "Manual"
to align with the codebase migration from boolean flags to a more descriptive string-based approach.
35-66
: Updated test data to use the new runBehavior property.Test data has been updated to use string values ("On page load" or "Manual") instead of boolean flags, consistent with the interface changes.
360-363
: Fixed function filtering logic for the new runBehavior property.Updated the filter condition to use the new property name while maintaining the same logical test.
406-408
: Updated EnableDisableAsyncFuncSettings call to use string values.Modified to pass the string-based runBehavior value instead of a boolean flag.
503-504
: Updated EnableDisableAsyncFuncSettings call to use "On page load" string value.Changed to use the explicit string value instead of boolean.
508-508
: Updated VerifyAsyncFuncSettings to check for string-based run behavior.Changed verification to match the new property type.
app/client/cypress/fixtures/PartialImportExport/QueriesExportedOnly.json (1)
1-1
: Updated fixture to use runBehavior instead of executeOnLoad.The JSON fixture has been correctly updated to use the new string-based
runBehavior
property with appropriate values:
- "MANUAL" for InsertQuery, DeleteQuery, and UpdateQuery
- "ON_PAGE_LOAD" for SelectQuery
This change aligns with the codebase migration from boolean flags to more descriptive string values.
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx (6)
2-8
: Good refactoring of imports to support the new dropdown UI component.The changes properly import the necessary components from the design system for the new dropdown selector, including
Select
,Option
, and related types.
17-20
: Appropriate type imports for runtime behavior configuration.The import of
RUN_BEHAVIOR_VALUES
andActionRunBehaviourType
properly sets up the type system for the new run behavior model, ensuring type safety throughout the component.
23-36
: Well-structured styled components for the dropdown options.The styled components follow the design system patterns with proper typography and color variables. The
StyledSelect
component correctly controls the width to fit the content.
49-52
: Successful migration from boolean to enum-based state.The component now correctly initializes with the
runBehavior
value from the action instead of a boolean flag, and properly finds the matching option for display.
53-68
: Callback properly handles the new run behavior state updates.The
onSelectOptions
callback correctly:
- Updates local state
- Calls the parent update handler with the new value
- Logs analytics with the appropriate event name and value
Type safety is maintained with the
ActionRunBehaviourType
parameter.
71-110
: UI layout updates correctly implemented for the dropdown control.The Flex container has been updated with proper alignment and spacing properties. The
StyledSelect
component replaces the previous Switch control with appropriate test IDs and proper option rendering that includes both labels and descriptive subtexts.app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json (5)
85-85
: Default run behavior correctly set.The initial state now includes the
runBehavior
property set to "MANUAL" for new actions, which aligns with the default behavior in the application.
2545-2560
: Well-structured dropdown options for MongoDB plugin settings.The MongoDB plugin settings configuration has been properly updated with:
- Clear label "Run behavior"
- Appropriate dropdown control type
- "MANUAL" default value
- Descriptive options with helpful subtext explaining each behavior mode
2591-2607
: Consistent configuration for SQL plugin settings.The SQL plugin settings maintain consistency with other plugins, using identical dropdown configuration and option values.
2637-2652
: Consistent configuration for API plugin settings.The API plugin settings maintain the same pattern as the other plugins, ensuring a uniform user experience across different action types.
2689-2704
: Uniform configuration across remaining plugins.All plugin configurations (Firebase, Google Sheets, S3, and Redis) maintain consistent structure, labels, and behavior options, providing a unified user experience throughout the platform.
Also applies to: 2728-2743, 2774-2789, 2820-2835
app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java (3)
304-310
: Good synchronization from boolean to enum in setExecuteOnLoad.The implementation correctly syncs the legacy
executeOnLoad
boolean with the newrunBehavior
enum, maintaining backward compatibility while supporting the new model.
322-339
: Well-implemented bidirectional compatibility in setRunBehavior.The new
setRunBehavior
method properly:
- Updates the new
runBehavior
enum property- Sets the legacy
executeOnLoad
boolean for backward compatibility- Maintains the
userSetOnLoad
flag for tracking user preferencesThis ensures a smooth transition to the new model while maintaining API compatibility.
426-435
: Proper initialization logic for new actions.The creation logic correctly initializes both properties:
- New actions default to
false
andMANUAL
unless cloned- Cloned actions maintain their execution settings via both properties
- The action domain model is consistently updated with both properties
This ensures consistent behavior between old and new code paths.
app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json (8)
86-86
: Correct placement ofrunBehavior
on action entities.The new
runBehavior
property is added at the same level asactionConfiguration
, matching the server‐side model whererunBehavior
is a root‐level field on an action entity. The value"MANUAL"
aligns with the default behaviour.
2546-2561
: AddrunBehavior
dropdown to Mongo form settings.The setting for plugin ID
5e687c18fb01e64e6a3f873f
correctly replaces the old switch with a dropdown, providing"On page load"
and"Manual"
options. Default"MANUAL"
is appropriate for backward compatibility.
2592-2608
: AddrunBehavior
dropdown to SQL form settings.For plugin ID
5c9f512f96c1a50004819786
, the new dropdown control is consistent with other form configs. Options and default align with the fresh API.
2638-2654
: AddrunBehavior
dropdown to REST API form settings.Plugin ID
5ca385dc81b37f0004b4db85
uses a"CHECKBOX"
control for confirmation but correctly adds a"DROP_DOWN"
forrunBehavior
.
2690-2706
: AddrunBehavior
dropdown to Firestore form settings.The dropdown is properly introduced for plugin ID
5fbbc39ad1f71d6666c32e4b
with identical option labels and values.
2729-2745
: AddrunBehavior
dropdown to Google Sheets form settings.Plugin ID
6080f9266b8cfd602957ba72
now has a consistent dropdown. Label, subText, and values match the new enum.
2775-2791
: AddrunBehavior
dropdown to S3 form settings.Plugin ID
6023b4a070eb652de19476d3
receives the same treatment, ensuring uniform UX across plugins.
2821-2837
: AddrunBehavior
dropdown to Redis form settings.Plugin ID
5f9169920c6d936f469f4c8a
is correctly updated with the new control type and option set.app/client/src/PluginActionEditor/types/PluginActionTypes.ts (3)
1-4
: Introduce theme constant.Setting
THEME
toEditorTheme.LIGHT
centralizes the editor theme configuration—good for consistency.
25-25
: Generate list of run behavior values.
RUN_BEHAVIOR_VALUES
simplifies populating dropdown options. This is a neat DRY approach.
27-27
: Alias the enum type.
ActionRunBehaviourType
ensures strict typing for all run behavior values. Excellent for catching typos at compile time.app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java (2)
11-11
: Appropriate import for the new RunBehaviorEnum.The import ensures the test file has access to the RunBehaviorEnum used in the new tests.
1357-1402
: Good test coverage for the new runBehavior property.This test thoroughly validates the default values and state transitions when setting the runBehavior property. It verifies both the direct property changes and their effect on related properties (executeOnLoad and userSetOnLoad).
The persistence check at the end is particularly valuable to ensure changes are stored correctly.
app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts (4)
2310-2310
: Consistent application of the new runBehavior propertyThe property has been correctly set to "ON_PAGE_LOAD" which is the appropriate value for a component that should execute automatically when loaded.
2394-2394
: Correct implementation of manual run behaviorThe property is appropriately set to "MANUAL" for this action that should only run when explicitly triggered.
10041-10058
: Well-structured dropdown configuration for run behaviorThe dropdown implementation includes clear labels and helpful subtext that explains the behavior differences to users. The configuration properly uses the new string enum values.
10415-10415
: Consistent default configuration for JS actionsAll JS actions have been correctly configured with "MANUAL" as the default run behavior, maintaining consistent behavior across the application.
Also applies to: 10465-10465, 10549-10549, 10599-10599
app/client/src/actions/pluginActionActions.ts (3)
23-23
: New import for action execution behavior type added.The
ActionRunBehaviourType
import properly supports the migration from boolean to string-based execution behavior.
355-366
: Function renamed to reflect the new run behavior concept.The action creator has been properly renamed from
setActionsToExecuteOnPageLoad
tosetActionsRunBehavior
with updated payload structure to match the new behavior model. This is consistent with the codebase-wide migration from boolean flags to a more flexible string-based approach.
368-380
: Function renamed to reflect the new run behavior concept for JS actions.Similar to the previous change, this action creator has been renamed from
setJSActionsToExecuteOnPageLoad
tosetJSActionsRunBehavior
with updated payload structure. The type name in the return object is properly updated toSET_JS_ACTION_RUN_BEHAVIOR
.app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx (3)
11-11
: Import for ActionRunBehaviourType added.The necessary type import supports the migration from boolean to string-based execution behavior in the reducer.
364-392
: Updated reducer handler for function run behavior.The reducer now correctly handles the
UPDATE_FUNCTION_RUN_BEHAVIOR_SUCCESS
action by setting therunBehavior
property instead of togglingexecuteOnLoad
. The action payload structure has been updated to include the new typed property.
393-420
: Updated reducer handler for setting JS action run behavior.The reducer now correctly handles the
SET_JS_ACTION_RUN_BEHAVIOR
action by setting therunBehavior
property on the affected actions. The code maintains the same structure and logic as before but with the updated property name.app/client/cypress/support/Pages/JSEditor.ts (5)
53-57
: Updated selectors for run behavior UI.The selectors have been updated to target the new combobox input instead of the previous toggle switch, reflecting the UI changes from a boolean toggle to a dropdown selection.
59-59
: Changed visibility of _jsObjName from private to public.Making this property public allows other components to access the JavaScript object name selector directly, which improves reusability.
98-99
: Added selector for dropdown options.This selector supports the UI changes by providing a way to target specific dropdown options based on the run behavior value.
301-311
: Updated verification method for async function settings.The method now accepts and verifies string-based run behavior values instead of boolean states, aligning with the new dropdown-based UI component.
313-327
:⚠️ Potential issueUpdated method to enable/disable async function settings.
Modified to work with the dropdown selection UI instead of toggles. The method now clicks the combobox and selects the appropriate option based on the provided run behavior value.
Avoid using agHelper.Sleep() in line 326 as it introduces unnecessary wait time.
Apply this change to eliminate the hardcoded wait:
// Return to code tab this.toolbar.toggleSettings(); - this.agHelper.Sleep();
Likely an incorrect or invalid review comment.
app/client/src/sagas/ActionSagas.ts (4)
150-150
: Imported ActionRunBehaviourType for strong typing.This import properly supports the migration from boolean to string-based execution behavior in the saga.
1042-1052
: Updated property check in setActionPropertySaga.The saga now checks for the "runBehavior" property instead of "executeOnLoad" and dispatches the appropriate action with the new property name. This properly handles the string-based run behavior values.
1064-1089
: Function renamed to reflect new run behavior concept.The saga has been renamed from
toggleActionExecuteOnLoadSaga
toupdateActionRunBehaviorSaga
with updated parameter types and API call to match the new behavior model. The success and error action types have been updated accordingly.
1269-1271
: Updated watcher saga registration.The watcher saga now listens for the correct action type
UPDATE_ACTION_RUN_BEHAVIOR_INIT
and invokes the renamed saga function.app/client/cypress/support/Pages/ApiPage.ts (4)
107-109
: Appropriate use of locators for the new dropdown UI control.These new locators are well-defined for interacting with the run behavior dropdown, following the project's locator naming conventions.
278-289
: Refactored method to use string-based run behavior instead of boolean toggle.The
ToggleOnPageLoadRun
method has been effectively updated to use the new dropdown-based UI control with string literals, replacing the previous boolean toggle approach.
513-522
: Similar pattern applied to JSObject run behavior toggle method.This method follows the same pattern as
ToggleOnPageLoadRun
, ensuring consistency in the API for both regular and JS actions.
524-532
: Consistent implementation in clickSettingIcon method.The implementation maintains consistency with the other methods, following the same pattern for setting run behavior via the dropdown.
app/client/src/sagas/JSPaneSagas.ts (6)
104-104
: Added import for the new run behavior type.Correctly imports the required type definition for the string-based run behavior.
786-797
: Updated property checks and action dispatch for new run behavior model.The function property saga now correctly checks for "runBehavior" property and dispatches the appropriate action with the string-based value.
850-863
: Refactored saga for updating function run behavior.The saga has been properly renamed and updated to use the new string-based model, with parameters and API calls adjusted accordingly.
867-874
: Correctly updated success action type and payload structure.The success handling dispatch uses the new action type and properly includes the runBehavior in the payload.
877-881
: Updated error action type for run behavior.Error handling has been updated to use the new error action type consistent with the rename from toggle to run behavior.
947-949
: Updated root saga watcher to listen for new action type.The takeLatest effect has been properly updated to listen for the new UPDATE_FUNCTION_RUN_BEHAVIOR_INIT action type.
app/client/src/ce/constants/ReduxActionConstants.tsx (4)
69-72
: Added new action types for JS editor run behavior.The appropriate Redux action types have been added to support the migration from boolean toggle to string-based run behavior for JS functions.
87-87
: Added corresponding error type for JS editor run behavior.Error action type properly added for handling run behavior update failures.
808-811
: Added action types for general action run behavior.These action types complete the model change by providing the needed constants for regular actions in addition to JS functions.
824-824
: Added corresponding error type for action run behavior.Error action type consistently added for regular actions to match the pattern used with JS functions.
…com/appsmithorg/appsmith into fix/some-more-cypress
c5d2f5d
into
feat/reactive-actions-run-behaviour
Description
Fixing remaining 4 failing cypress test cases
Fixes #39833
Automation
/ok-to-test tags="@tag.ImportExport, @tag.JS"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/14760268599
Commit: 8d4c84c
Cypress dashboard.
Tags:
@tag.ImportExport, @tag.JS
Spec:
Wed, 30 Apr 2025 18:02:13 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Documentation
Chores