10000 fix: Cyclic dependencies for reactive queries run behavior changes by ankitakinger · Pull Request #40481 · appsmithorg/appsmith · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Cyclic dependencies for reactive queries run behavior changes #40481

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

Conversation

ankitakinger
Copy link
Contributor
@ankitakinger ankitakinger commented Apr 29, 2025

Description

Fixing cyclic dependencies for reactive queries run behavior changes

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=""

🔍 Cypress test results

Warning

Tests have not run on the HEAD 72c296c yet


Tue, 29 Apr 2025 16:52:23 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a "Run behavior" dropdown for actions and queries, allowing users to choose between running on page load or manually.
    • Enhanced dropdown controls now display descriptive labels and subtexts for run behavior options.
  • Improvements

    • Replaced the previous "Run on page load" toggle with a more flexible run behavior selection across all supported plugins and action types.
    • Updated UI labels and tooltips to clarify run behavior settings.
  • Bug Fixes

    • Ensured consistent handling and display of run behavior settings throughout the application.
  • Documentation

    • Updated descriptions and labels to reflect the new run behavior terminology.
  • Tests

    • Revised and added tests to validate the new run behavior functionality and its backward compatibility.
  • Chores

    • Deprecated the old execute-on-load property and API, migrating to the new run behavior approach for future extensibility.

Copy link
Contributor
coderabbitai bot commented Apr 29, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • pg
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update replaces the legacy boolean property executeOnLoad with a new, more expressive runBehavior property throughout both client and server codebases. The change introduces a RunBehaviorEnum (Java) and ActionRunBehaviour (TypeScript) to standardize when actions or queries should run—either manually or automatically on page load. All related APIs, Redux actions, reducers, sagas, UI components, test fixtures, and plugin configuration files are updated to use the new model. Backward compatibility is maintained on the server side by synchronizing the deprecated executeOnLoad with runBehavior. New endpoints and settings are added to support this transition, and comprehensive tests are provided to ensure correct behavior.

Changes

Files/Paths (Grouped) Change Summary
app/client/src/PluginActionEditor/types/PluginActionTypes.ts, app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/RunBehaviorEnum.java Introduced new enums/types for run behavior (ActionRunBehaviour in TS, RunBehaviorEnum in Java), constants, and type aliases to represent and describe action run behaviors.
app/client/src/entities/Action/index.ts, app/client/src/entities/Action/actionProperties.test.ts, app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts, app/client/test/factories/Actions/API.ts, app/client/test/factories/Actions/GoogleSheetFactory.ts, app/client/test/factories/Actions/JSObject.ts, app/client/test/factories/Actions/Postgres.ts, app/client/src/pages/Editor/JSEditor/utils.test.ts, app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts, app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx, app/client/src/utils/JSPaneUtils.test.ts, app/client/src/utils/JSPaneUtils.tsx, app/client/src/utils/DynamicBindingUtils.test.ts, app/client/src/utils/FilterInternalProperties/JsAction.ts Replaced all uses of executeOnLoad (boolean) with runBehavior (enum/string) in action/JS action objects, test fixtures, and utility logic. Updated related imports and checks.
app/client/src/components/formControls/DropDownControl.tsx, app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx Enhanced dropdown controls to support option subtexts and refactored UI for setting run behavior, replacing switches with dropdowns.
app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts, app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts, app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts Updated form configuration to replace "Run on page load" switch with a "Run behavior" dropdown, using new run behavior options and labels.
app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts, app/client/test/factories/MockPluginsState.ts, app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json, app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json Updated mock/plugin/editor state and configuration files to use runBehavior dropdowns/options instead of executeOnLoad switches.
app/client/src/ce/reducers/entityReducers/actionsReducer.tsx, app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx, app/client/src/ce/sagas/PageSagas.tsx, app/client/src/sagas/ActionSagas.ts, app/client/src/sagas/JSPaneSagas.ts, app/client/src/actions/pluginActionActions.ts Refactored Redux reducers, sagas, and action creators to handle runBehavior instead of executeOnLoad, updated action types, payloads, and handler logic.
app/client/src/api/ActionAPI.tsx, app/client/src/api/PageApi.tsx, app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ActionControllerCE.java, app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCE.java, app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java Added new API endpoints and service methods for updating runBehavior, deprecated old executeOnLoad endpoints, and ensured bidirectional sync between the two properties for backward compatibility.
app/server/appsmith-plugins/*/setting.json Updated all plugin settings to use a "Run behavior" dropdown (runBehavior) instead of a boolean "Run on page load" switch (executeOnLoad).
app/client/src/ce/constants/ReduxActionConstants.tsx, app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts Renamed and updated Redux action type constants and related types to use "run behavior" terminology and types.
app/client/src/PluginActionEditor/constants/PluginActionConstants.ts Deleted the obsolete constants file for THEME.
app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx Updated import for THEME to new location.
app/client/src/ce/constants/messages.ts Updated UI string to reference "run behavior" instead of "run on page load".
app/client/src/components/editorComponents/CodeEditor/EditorConfig.ts, app/client/src/components/editorComponents/CodeEditor/MarkHelpers/entityMarker.ts, app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts, app/client/src/components/editorComponents/CodeEditor/index.tsx, app/client/src/ce/components/editorComponents/GPT/index.tsx, app/client/src/ce/utils/moduleInstanceNavigationData.ts, app/client/src/selectors/navigationSelectors.ts, app/client/src/utils/NavigationSelector/JsChildren.ts, app/client/src/utils/NavigationSelector/WidgetChildren.ts, app/client/src/utils/NavigationSelector/common.ts, app/client/src/entities/DataTree/dataTreeTypes.ts Centralized and updated type imports for navigation data, removing local duplications and consolidating type definitions.
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java Added new runBehavior field (default MANUAL), deprecated executeOnLoad with documentation.
app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java Added tests to verify correct synchronization and updating of runBehavior and executeOnLoad.

Sequence Diagram(s)

sequenceDiagram
    participant UI
    participant Redux
    participant Saga
    participant API
    participant Server

    UI->>Redux: Dispatch SET_ACTION_RUN_BEHAVIOR (runBehavior)
    Redux->>Saga: Watch for SET_ACTION_RUN_BEHAVIOR
    Saga->>API: Call updateActionRunBehavior(actionId, runBehavior)
    API->>Server: PUT /runBehavior/{actionId} { behavior: runBehavior }
    Server->>Server: Update Action.runBehavior & sync executeOnLoad
    Server-->>API: Return updated Action
    API-->>Saga: Return updated Action
    Saga-->>Redux: Dispatch UPDATE_ACTION_RUN_BEHAVIOR_SUCCESS
    Redux-->>UI: Update state with new runBehavior
Loading

Suggested labels

skip-changelog, CI, ok-to-test

Poem

Out with the old, in with the flair—
"executeOnLoad" retires with care.
Now "runBehavior" leads the show,
Manual or auto, you choose the flow!
Enums and dropdowns, tests in tow,
The codebase shines with a modern glow.
🎉 Here’s to more expressive, readable code—let’s go! 🚀


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongl 8000 y 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ankitakinger ankitakinger changed the title Fix/reactive cyclic dependencies fix: Cyclic dependencies for reactive queries run behavior changes Apr 29, 2025
@github-actions github-actions bot added the Bug Something isn't working label Apr 29, 2025
Copy link
Contributor
@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (3)
app/client/src/entities/Action/actionProperties.test.ts (1)

13-13: Replaced executeOnLoad with runBehavior in DEFAULT_ACTION

The change from executeOnLoad: false to runBehavior: "MANUAL" is consistent with the refactoring effort. However, I notice that the value is a string literal here rather than using the enum value as in other files (ActionRunBehaviour.MANUAL). Consider using the enum for consistency if applicable.

app/client/src/ce/sagas/PageSagas.tsx (2)

542-544: Consider using Object.hasOwn() instead of direct hasOwnProperty calls.

Using the hasOwnProperty method directly on objects can be unsafe if the property has been overridden on the object's prototype chain.

-const jsActions = actionUpdates.filter((d) =>
-  d.hasOwnProperty("collectionId"),
-);
+const jsActions = actionUpdates.filter((d) =>
+  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-546: Consider using optional chaining for cleaner null checks.

The current null check pattern can be simplified using optional chaining for better readability.

-if (jsActions && jsActions.length) {
+if (jsActions?.length) {
🧰 Tools
🪛 Biome (1.9.4)

[error] 546-546: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61d4801 and 2058505.

📒 Files selected for processing (71)
  • 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/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/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 (2 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
🧬 Code Graph Analysis (11)
app/client/src/api/PageApi.tsx (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
  • ActionRunBehaviourType (25-25)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
  • ActionRunBehaviourType (25-25)
app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
  • RUN_BEHAVIOR (10-21)
  • RUN_BEHAVIOR_VALUES (23-23)
app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
  • RUN_BEHAVIOR (10-21)
  • RUN_BEHAVIOR_VALUES (23-23)
app/client/src/sagas/ActionExecution/PluginActionSaga.ts (2)
app/client/src/ce/reducers/entityReducers/actionsReducer.tsx (1)
  • ActionData (18-22)
app/client/src/ce/selectors/entitiesSelector.ts (1)
  • getCurrentActions (694-702)
app/client/src/api/ActionAPI.tsx (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
  • ActionRunBehaviourType (25-25)
app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (2)
  • RUN_BEHAVIOR (10-21)
  • RUN_BEHAVIOR_VALUES (23-23)
app/client/src/entities/DataTree/dataTreeTypes.ts (1)
app/client/src/ce/entities/DataTree/types.ts (1)
  • EntityTypeValue (37-37)
app/client/src/entities/Action/index.ts (1)
app/client/src/PluginActionEditor/types/PluginActionTypes.ts (1)
  • ActionRunBehaviourType (25-25)
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 (25-25)
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/ads/src/Select/Select.tsx (1)
  • Option (143-143)
🪛 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 (5)
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: server-unit-tests / server-unit-tests
🔇 Additional comments (131)
app/client/src/ce/components/editorComponents/GPT/index.tsx (1)

6-6: Inconsistent import path for EntityNavigationData
This file imports EntityNavigationData from "ee/entities/DataTree/types", whereas other modules reference the centralized "entities/DataTree/dataTreeTypes" location. Please verify that "ee/entities/DataTree/types" is the intended source or update this import to the shared dataTreeTypes module to ensure consistency.

app/client/src/ce/utils/moduleInstanceNavigationData.ts (1)

2-2: Centralized import of EntityNavigationData
Good update: importing EntityNavigationData from entities/DataTree/dataTreeTypes removes duplication and aligns with the new shared type definitions.

app/client/src/components/editorComponents/CodeEditor/MarkHelpers/entityMarker.ts (1)

4-4: Updated import for navigation types
Switching EntityNavigationData and NavigationData imports to the centralized entities/DataTree/dataTreeTypes is correct and maintains type consistency across editor components.

app/client/src/utils/NavigationSelector/JsChildren.ts (1)

10-10: Consistent navigation type imports
Using entities/DataTree/dataTreeTypes for EntityNavigationData and NavigationData aligns this selector with the refactor. No further changes needed here.

app/client/src/utils/NavigationSelector/common.ts (1)

5-5: Consolidated import of navigation types
Great to see EntityNavigationData and NavigationData now imported from the centralized entities/DataTree/dataTreeTypes module, removing old duplicates.

app/client/src/PluginActionEditor/components/PluginActionSettings/SettingsPopover.tsx (1)

16-16: Import updated for THEME constant
Switching the import to ../../types/PluginActionTypes aligns with the refactor.

app/client/src/components/editorComponents/CodeEditor/commandsHelper.ts (1)

21-21: Centralize navigation types import
Importing EntityNavigationData and NavigationData from entities/DataTree/dataTreeTypes is correct and improves consistency.

app/client/src/utils/NavigationSelector/WidgetChildren.ts (1)

5-5: Consolidate EntityNavigationData import
This change centralizes the type in dataTreeTypes as intended.

app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts (2)

47-47: Update test fixture to use runBehavior
Replacing executeOnLoad with runBehavior: "MANUAL" matches the new model.


89-89: Align second action with runBehavior
Good consistency—both fixtures now reflect the manual run behavior.

app/client/src/components/editorComponents/CodeEditor/EditorConfig.ts (1)

3-6: Consolidate navigation type imports
Importing DataTree and EntityNavigationData from dataTreeTypes centralizes the definitions.

app/client/src/components/editorComponents/CodeEditor/index.tsx (1)

125-125: Import path updated to use centralized type definition.

The import for EntityNavigationData now comes from a centralized location in the dataTreeTypes module rather than from the navigationSelectors. This helps reduce type duplication and improves maintainability.

app/client/src/sagas/BuildingBlockSagas/tests/fixtures.ts (1)

132-132: Replace boolean executeOnLoad with expressive runBehavior property.

The change replaces the legacy boolean property executeOnLoad with the more descriptive runBehavior string property set to "ON_PAGE_LOAD". This improves code readability and provides more flexibility for run behavior options.

app/client/src/utils/DynamicBindingUtils.test.ts (1)

123-123: Replace boolean executeOnLoad with expressive runBehavior property.

The test fixture now uses runBehavior: "MANUAL" instead of the boolean executeOnLoad flag. This aligns with the broader refactoring to standardize action run behavior across the codebase.

app/client/test/factories/Actions/JSObject.ts (1)

33-33: Replace boolean executeOnLoad with expressive runBehavior property.

Both JS action objects in the factory now use runBehavior: "MANUAL" instead of the boolean executeOnLoad flag. This aligns with the system-wide migration from boolean flags to a more expressive string-based enum for controlling when actions run.

Also applies to: 73-73

app/client/src/ce/constants/messages.ts (1)

2592-2592: Change improves message clarity for new run behavior model

Updated message title aligns with the new runBehavior property model, making it clearer that this is about choosing when functions run rather than specifically about page load execution.

app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts (1)

47-47: Boolean flag replaced with explicit string enum

The test fixtures have been updated to use runBehavior: "MANUAL" instead of the previous boolean executeOnLoad: false. This change maintains the same functional behavior while adopting the more expressive run behavior model.

Also applies to: 94-94, 242-242, 289-289

app/client/test/factories/Actions/GoogleSheetFactory.ts (1)

66-66: Test factory updated to use new run behavior property

The Google Sheet test factory now correctly uses runBehavior: "MANUAL" instead of a boolean flag, aligning with the architectural changes made throughout the codebase.

app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts (1)

84-84: Updated property path check in tab selection logic

The navigation logic has been properly updated to check for the new runBehavior property path instead of the deprecated executeOnLoad property path when determining which editor tab to display.

app/client/src/components/editorComponents/utils.test.ts (2)

2-2: Added necessary import for ActionRunBehaviour enum

The import is required to support the updated test fixture.


34-34: Updated test fixture to use runBehavior instead of executeOnLoad

This change aligns the test data with the broader refactoring from boolean executeOnLoad to the more expressive ActionRunBehaviour enum. The MANUAL value is the equivalent replacement for what was likely false in the previous implementation.

app/client/test/factories/Actions/Postgres.ts (1)

34-34:

❌ Incorrect review comment

Replaced executeOnLoad with runBehavior in PostgresFactory

The change from executeOnLoad to runBehavior: "MANUAL" is aligned with the overall refactoring. However, if the original value was executeOnLoad: true, the logical equivalent would be runBehavior: "ON_PAGE_LOAD" rather than "MANUAL". Verify that this change doesn't alter the expected behavior of tests using this factory.


🏁 Script executed:

#!/bin/bash
# Verify if this factory was originally using executeOnLoad: true
git show HEAD~1:app/client/test/factories/Actions/Postgres.ts | grep executeOnLoad

Length of output: 84


Let’s search the entire repo for any executeOnLoad references to confirm its prior usage:


🏁 Script executed:

#!/bin/bash
# Search for any executeOnLoad references across the codebase
rg executeOnLoad -n .

Length of output: 65790


No executeOnLoad in PostgresFactory – original comment can be ignored

This factory never defined an executeOnLoad property, so there’s no prior true value to map. The new runBehavior: "MANUAL" aligns with the updated API and requires no further action.

Likely an incorrect or invalid review comment.

app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCE.java (2)

4-4: Added import for RunBehaviorEnum

This import supports the newly added method for setting run behavior.


21-21:

✅ Verification successful

Added new method to set run behavior

The new setRunBehavior method complements the existing setExecuteOnLoad method, providing a more expressive way to control action execution behavior. This is a good approach that maintains backward compatibility while introducing the new functionality.

Let's check if the implementation of this method properly synchronizes with the legacy executeOnLoad property:


🏁 Script executed:

#!/bin/bash
# Check implementation of setRunBehavior in the implementation class
fd "LayoutActionServiceCEImpl.java" --type f | xargs grep -A 20 "setRunBehavior"

Length of output: 3850


Implementation correctly updates executeOnLoad for backward compatibility

Verified that the setRunBehavior implementation in LayoutActionServiceCEImpl.java:

  • Calls action.setUserSetOnLoad(true)
  • Sets the new RunBehaviorEnum
  • Updates executeOnLoad to true if RunBehaviorEnum.ON_PAGE_LOAD, otherwise to false

This preserves backward compatibility with the legacy executeOnLoad property. No changes required.

app/client/src/pages/Editor/JSEditor/JSEditorToolbar/types.ts (1)

3-3: Good type refinement for better type safety

Replacing the generic boolean | number with the more specific ActionRunBehaviourType ensures stronger type checking and better code clarity. This aligns with the broader refactor to standardize run behavior across the application.

Also applies to: 6-6

app/client/test/factories/Actions/API.ts (1)

66-66: Proper update for test factory

The factory has been correctly updated to use runBehavior: "MANUAL" instead of the previous boolean flag. This ensures test data consistency with the new behavior model.

app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/RunBehaviorEnum.java (1)

1-9: Well-structured enum implementation

The enum is well-documented with clear comments explaining each value's purpose. This provides a type-safe way to represent run behaviors and aligns with the client-side implementation.

app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts (1)

18-18: Test fixture correctly updated

The test fixture now properly uses the new run behavior model with "MANUAL" corresponding to the previous false value for executeOnLoad.

app/client/src/sagas/ActionExecution/PluginActionSaga.ts (2)

172-172: Import added for new enum type

The addition of this import supports the transition from boolean executeOnLoad to the more expressive ActionRunBehaviour enum.


1557-1566: Correctly replaced boolean flag with enum-based behavior

Good implementation of the refactoring pattern - replacing the boolean check with a more expressive enum comparison. The comment has been properly updated to reflect the new condition logic.

app/client/src/api/PageApi.tsx (2)

12-12: Added ActionRunBehaviourType import

Appropriate import to support the type change in SavePageResponseData.


73-73: Updated action property from boolean to typed enum

Updated SavePageResponseData interface to use the more expressive ActionRunBehaviourType instead of a boolean flag, aligning with the application-wide refactoring pattern.

app/client/src/pages/Editor/JSEditor/utils.test.ts (2)

9-9: Added import for ActionRunBehaviour enum

Required import to support the test fixture updates.


48-48: Test fixture updated from boolean to enum

Correctly updated the test fixture from executeOnLoad: false to runBehavior: ActionRunBehaviour.MANUAL, preserving the same functional behavior while implementing the new type system.

app/client/src/entities/Action/index.ts (2)

13-13: Added import for ActionRunBehaviourType

Required import to support the interface updates.


143-143: Core interface updated from boolean to typed enum

Critical change to the BaseAction interface that replaces the boolean executeOnLoad property with the more expressive runBehavior property. This change propagates to all action types in the application.

app/client/src/constants/AppsmithActionConstants/formConfig/QuerySettingsConfig.ts (2)

1-4: Correctly imported new run behavior constants.

These imports support the new dropdown-based run behavior configuration, replacing the previous boolean switch.


12-16: Good implementation of the run behavior dropdown.

The change from a boolean toggle to a dropdown with multiple options improves clarity and extensibility. Setting the default to MANUAL is a sensible choice for queries as it prevents unnecessary database calls.

app/client/src/utils/FilterInternalProperties/JsAction.ts (2)

4-4: Appropriate import added for ActionRunBehaviour enum.

This import supports the updated condition check for run behavior.


19-22: Correctly updated conditional logic.

The condition has been properly updated to check for the specific enum value instead of the boolean flag, which maintains the same logical behavior while using the new property structure.

app/server/appsmith-plugins/postgresPlugin/src/main/resources/setting.json (1)

8-24: Proper implementation of run behavior dropdown in PostgreSQL plugin.

The configuration has been correctly updated to use a dropdown with clear options. Good job providing helpful subtext for each option to guide users.

app/client/src/constants/AppsmithActionConstants/formConfig/GoogleSheetsSettingsConfig.ts (2)

1-4: Correctly imported run behavior constants.

These imports align with the implementation in other action configurations.


12-16: Good implementation of run behavior dropdown for Google Sheets.

The change is consistent with other action configurations, using the same pattern and defaults. This consistency will help users understand the behavior across different action types.

app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx (2)

7-7: New enum import properly added

The import for ActionRunBehaviour is correctly added to support the test cases using the new run behavior enum values.


58-58: Updated test cases to use new enum values

Test cases now properly use ActionRunBehaviour.ON_PAGE_LOAD and ActionRunBehaviour.MANUAL instead of boolean flags, maintaining the same test coverage while adapting to the new data model.

Also applies to: 62-62

app/server/appsmith-plugins/googleAiPlugin/src/main/resources/setting.json (1)

8-23:

✅ Verification successful

Improved configuration with runBehavior dropdown

The configuration properly replac 10000 es the boolean switch with a more expressive dropdown control. The labels and subtext provide clear guidance to users about the behavior of each option.

One thing to verify is that any existing queries with executeOnLoad: true will be correctly migrated to use runBehavior: "ON_PAGE_LOAD".


🏁 Script executed:

#!/bin/bash
# Verify migration logic between executeOnLoad and runBehavior
grep -r "executeOnLoad.*runBehavior" --include="*.java" app/server/

Length of output: 276


🏁 Script executed:

#!/bin/bash
FILE="app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java"
echo "Matches for executeOnLoad:"
grep -n "executeOnLoad" "$FILE"
echo -e "\nMatches for runBehavior:"
grep -n "runBehavior" "$FILE"
echo -e "\nContext (lines 200–260):"
sed -n '200,260p' "$FILE"

Length of output: 4193


🏁 Script executed:

#!/bin/bash
FILE="app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java"

echo "Context around forward compatibility mapping (lines 280–340):"
sed -n '280,340p' "$FILE"

echo -e "\nContext around backward compatibility mapping and clone handling (lines 420–480):"
sed -n '420,480p' "$FILE"

Length of output: 7076


Migration mapping verified in LayoutActionServiceCEImpl

The setExecuteOnLoad and setRunBehavior methods already handle forward‐ and backward‐compatibility between executeOnLoad and runBehavior, including clone-page scenarios:

• In LayoutActionServiceCEImpl.setExecuteOnLoad(...):
trueRunBehaviorEnum.ON_PAGE_LOAD
falseRunBehaviorEnum.MANUAL

• In LayoutActionServiceCEImpl.setRunBehavior(...):
ON_PAGE_LOADexecuteOnLoad = true
– others ⇒ executeOnLoad = false

• Clone handling (in the same class) also re-assigns runBehavior based on existing executeOnLoad.

No further changes required.

app/client/src/api/ActionAPI.tsx (2)

13-13: Added import for ActionRunBehaviourType

The import for the new type is correctly added to support the API method changes.


305-311:

✅ Verification successful

Replaced executeOnLoad API with runBehavior

The API method has been properly renamed and updated to use the new runBehavior parameter and endpoint. This change supports the transition from boolean flags to a more expressive enum-based approach.

Ensure that the backend endpoint and handling have been updated consistently.


🏁 Script executed:

#!/bin/bash
# Check for the new API endpoint implementation in the backend
grep -r "runBehavior.*mapping" --include="*.java" app/server/

Length of output: 63


Additional backend validation needed
The initial grep yielded no references to the new runBehavior endpoint. Let’s search more broadly across the server code for any occurrences:


🏁 Script executed:

#!/bin/bash
# 1. Find all references to runBehavior in server code
grep -R "runBehavior" -n app/server/

# 2. Look specifically for mapping annotations tied to runBehavior
grep -R "@.*Mapping.*runBehavior" -n app/server/

# 3. Search for the literal endpoint path in strings
grep -R "\"/runBehavior" -n app/server/

Length of output: 3234


Backend endpoint /runBehavior/{branchedActionId} verified
The server’s controller, service, and tests have all been updated to support the new runBehavior enum:

  • app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ActionControllerCE.java
    • @PutMapping("/runBehavior/{branchedActionId}") at line 120
  • app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java
    • Logic updated for runBehavior (forward-compatibility, cloning scenarios)
  • app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java
    • Tests for ON_PAGE_LOAD and MANUAL behaviors

All backend changes are in place—no further action required.

app/server/appsmith-plugins/googleSheetsPlugin/src/main/resources/setting.json (1)

8-23: Consistent implementation of runBehavior configuration

The Google Sheets plugin settings have been properly updated to use the same dropdown pattern as seen in other plugins. The consistent implementation across plugins ensures a unified user experience.

app/client/src/selectors/navigationSelectors.ts (1)

36-36: Type import centralization looks good

This change appropriately centralizes the EntityNavigationData type import from entities/DataTree/dataTreeTypes instead of maintaining a local definition, which promotes code reuse and type consistency across the application.

app/client/src/constants/AppsmithActionConstants/formConfig/ApiSettingsConfig.ts (2)

9-12: Import of run behavior types is appropriate

Clean import of the necessary run behavior constants from the centralized types file.


20-25: Good replacement of boolean toggle with more expressive dropdown

Replacing the binary executeOnLoad boolean with a more flexible runBehavior dropdown improves extensibility and user clarity. This change allows for more nuanced control over API execution behavior.

app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json (1)

8-23:

❓ Verification inconclusive

Good configuration for plugin run behavior settings

The implementation correctly replaces the boolean executeOnLoad with a more descriptive runBehavior dropdown in the Oracle plugin configuration. The options include helpful subText that clearly explains the behavior differences to users.

Note that the default is set to "MANUAL" which is a change from the previous behavior. Ensure this is the intended default for backward compatibility.


🏁 Script executed:

#!/bin/bash
# Check other plugin configurations to verify consistent defaults
find app/server/appsmith-plugins -name "setting.json" -type f -exec grep -l "runBehavior" {} \; | xargs grep -l "initialValue" | xargs grep "initialValue"

Length of output: 2753


🏁 Script executed:

#!/bin/bash
# Display the first 200 lines of the Oracle plugin settings to inspect both runBehavior and any lingering executeOnLoad entries
sed -n '1,200p' app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json

Length of output: 1692


Default runBehavior “MANUAL” Is Consistent Across Plugins
The Oracle plugin’s runBehavior dropdown now defaults to "MANUAL", matching every other updated Appsmith plugin (S3, MongoDB, PostgreSQL, etc.). No code changes are required.

• File: app/server/appsmith-plugins/oraclePlugin/src/main/resources/setting.json – initialValue: "MANUAL"

Please confirm that switching from the old executeOnLoad: true default to manual aligns with your backward-compatibility requirements.

app/client/test/factories/MockPluginsState.ts (4)

6955-6973: Good implementation of the runBehavior dropdown replacement.

The switch from a boolean executeOnLoad to a more expressive runBehavior dropdown with clear options improves readability and user understanding. The descriptive subtext for each option is particularly helpful.


7035-7053: Consistent implementation for GraphQL API plugin settings.

The same dropdown configuration is correctly applied here, maintaining consistency across plugin types.


7115-7133: Properly implemented for Appsmith AI plugin settings.

The dropdown implementation with "ON_PAGE_LOAD" and "MANUAL" options is correctly applied, with appropriate subtext descriptions.


7159-7177: PostgreSQL plugin settings properly updated.

The implementation here matches the pattern used in other plugins, ensuring a consistent user experience across the application.

app/client/src/utils/JSPaneUtils.test.ts (1)

44-44: Consistent migration from executeOnLoad to runBehavior

All test objects have been properly updated to use the new runBehavior: "MANUAL" property instead of the legacy boolean executeOnLoad: false. This change ensures the test fixtures remain in sync with the implementation code.

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/appsmithAiPlugin/src/main/resources/setting.json (1)

8-23: Improved UX with dropdown for run behavior

The configuration has been appropriately updated from a boolean toggle to a more descriptive dropdown with clear options. The labels and subtext provide better context to users about when their queries will execute.

app/server/appsmith-plugins/mssqlPlugin/src/main/resources/setting.json (1)

8-23: Appropriate UI control for run behavior options

The run behavior dropdown implementation is consistent with the design pattern used in the AI plugin, maintaining a uniform user experience across different plugins. The subtext explanations effectively communicate the behavior differences.

app/client/src/utils/JSPaneUtils.tsx (3)

6-6: Added import for ActionRunBehaviour enum

Correctly added the import for the ActionRunBehaviour enum to support the migration from boolean flags to enum values.


134-135: Updated object creation to use ActionRunBehaviour.MANUAL

The new action creation in getDifferenceInJSCollection now correctly uses the enum value instead of the boolean flag.


233-234: Consistent usage of ActionRunBehaviour enum in action creators

The utility functions for creating JS actions (createDummyJSCollectionActions and createSingleFunctionJsCollection) have been properly updated to use the ActionRunBehaviour.MANUAL enum value, maintaining consistency across the codebase.

Also applies to: 245-246, 285-286

app/server/appsmith-plugins/mysqlPlugin/src/main/resources/setting.json (1)

8-23: Improved UI configuration with more descriptive run behavior options

The change from a boolean switch to a dropdown with explicit options provides better clarity for users about when their queries will execute. The subtext descriptions are particularly helpful for understanding the behavior differences.

app/server/appsmith-plugins/openAiPlugin/src/main/resources/setting.json (1)

8-23: Consistent implementation of run behavior dropdown across plugins

The implementation matches the pattern used in other plugins, maintaining consistency in the user experience. Good job maintaining the same options and descriptive subtext.

app/server/appsmith-plugins/amazons3Plugin/src/main/resources/setting.json (1)

8-23: Standardized run behavior dropdown consistent with other plugins

The implementation correctly follows the same pattern used across all plugins, providing a consistent configuration interface with clear explanatory text for each option.

app/server/appsmith-plugins/anthropicPlugin/src/main/resources/setting.json (1)

8-23: Good implementation of run behavior dropdown.

The dropdown implementation for run behavior is well-structured with clear labels and helpful subtext descriptions for each option. The default value of "MANUAL" is a safe choice as it prevents queries from automatically running without explicit user action.

app/server/appsmith-plugins/mongoPlugin/src/main/resources/setting.json (1)

8-23: Consistent implementation with other plugins.

The run behavior dropdown implementation matches the pattern used in other plugins, maintaining consistency throughout the application. The labels and descriptions effectively communicate the behavior differences between options.

app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/ce/ActionCE_DTO.java (2)

18-18: Import for new RunBehaviorEnum added correctly.

The new import for RunBehaviorEnum is properly added to support the transition from boolean executeOnLoad to typed run behavior.


104-113:

✅ Verification successful

Properly deprecating executeOnLoad while adding runBehavior.

Good implementation of the new runBehavior field with:

  1. Clear deprecation notice for executeOnLoad with migration guidance
  2. Appropriate default value of MANUAL for safety
  3. Same JSON view annotations for both fields to ensure consistent serialization

This approach maintains backward compatibility while encouraging migration to the new field.

However, we should ensure synchronization between these fields is handled in the service layer to maintain consistency.


🏁 Script executed:

#!/bin/bash
# Check if the service layer synchronizes executeOnLoad and runBehavior values
rg -A 10 -B 5 "executeOnLoad.*runBehavior|runBehavior.*executeOnLoad" --type java

Length of output: 4996


Service layer already synchronizes executeOnLoad and runBehavior—no further action needed

The LayoutActionServiceCEImpl class contains explicit mappings between executeOnLoad and runBehavior (both for new actions and cloned pages), ensuring the two fields stay in sync. Everything looks correct:

  • On action creation/update, isExecuteOnLoad drives runBehavior to either ON_PAGE_LOAD or MANUAL
  • In clone flows, the same mapping is applied based on the deprecated field
  • Default values and JSON views remain consistent

Great work on the deprecation and migration strategy—approving these changes.

app/server/appsmith-plugins/firestorePlugin/src/main/resources/setting.json (1)

8-23: Consistent run behavior implementation.

The run behavior dropdown follows the same pattern as other plugins, ensuring a consistent user experience across the application. The change from a boolean toggle to a more descriptive dropdown improves clarity about when queries will execute.

app/client/src/entities/DataTree/dataTreeTypes.ts (3)

6-6: Proper import of EntityTypeValue for type safety.

Adding this import makes sense as it will be used to type the type property in the newly added NavigationData interface.


28-44: Good centralization of NavigationData interface.

This change centralizes the NavigationData interface in the data tree types module, improving maintainability by establishing a single source of truth for navigation-related type definitions.


46-46: Appropriate type alias for EntityNavigationData.

The type alias complements the NavigationData interface and completes the centralization of navigation-related types.

app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ActionControllerCE.java (3)

5-5: Required import for the new RunBehaviorEnum.

This import supports the new endpoint parameter type.


119-127: Well-structured new endpoint for run behavior.

The implementation follows standard patterns with:

  • Proper annotations
  • Descriptive logging
  • Clear return type handling
  • Delegation to the appropriate service method

129-132: Correct Javadoc comment and deprecation marking.

The deprecated endpoint is properly documented with clear instructions to use the new endpoint instead.

app/client/src/pages/Editor/SaaSEditor/__data__/FinalState.json (3)

86-86: Replaced executeOnLoad with runBehavior property.

The boolean executeOnLoad has been properly replaced with the more expressive string enum runBehavior set to "MANUAL" as the default.


2545-2562: Well-designed UI control for run behavior.

The dropdown implementation provides:

  • Clear labeling with "Run behavior"
  • Descriptive options with helpful subtext explaining each behavior
  • Proper default value set to "MANUAL"

2592-2607: Consistent implementation across multiple plugin types.

The same dropdown configuration has been applied consistently across SQL, REST API, Firestore, Google Sheets, S3, and Redis plugin types, ensuring a uniform user experience.

Also applies to: 2638-2653, 2690-2705, 2729-2744, 2775-2790, 2821-2836

app/client/src/ce/reducers/entityReducers/actionsReducer.tsx (2)

16-16: Imported the required ActionRunBehaviourType.

This type is correctly imported to support the new payload structure.


314-332: Properly updated reducer to handle the new run behavior.

The changes include:

  • Updated action type name to SET_ACTION_RUN_BEHAVIOR (line 314)
  • Changed payload type from executeOnLoad boolean to runBehavior enum (line 318)
  • Updated the property assignment in the reducer logic (lines 328-329)

This maintains the same functionality but with a more expressive model.

app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx (6)

2-8: Appropriate addition of imports for the UI components.

These imports support the updated dropdown UI for runtime behavior.


17-21: Good addition of new types for run behavior.

Proper imports for the run behavior types from their dedicated file, replacing the previous boolean flag.


23-36: Well-structured styled components for the dropdown options.

Good separation of styling concerns with clear naming conventions. The styling is properly scoped and follows the design system variables.


49-50: State management updated to use runBehavior.

Correctly updated state from boolean executeOnLoad to the more expressive runBehavior enum.


52-67: Well-refactored callback function for handling runtime behavior changes.

The callback now properly handles the ActionRunBehaviourType instead of a boolean flag. The analytics tracking is maintained with the new value type.


69-107: UI updated from Switch to Select with improved layout.

The component layout has been improved with better alignment and spacing. The dropdown now clearly displays both the label and explanatory subtext for each option.

app/client/src/components/formControls/DropDownControl.tsx (4)

23-32: Enhanced imports for flexible dropdown option rendering.

Added Flex and Text components to support the new styled option layouts.


34-43: Well-defined styled components for dropdown options.

Good use of styled components to maintain consistent styling for option labels and subtexts. The color variables from the design system ensure theme consistency.


477-477: Fixed listHeight for consistent dropdown experience.

Setting a fixed list height of 240px ensures a consistent dropdown size across the application.


510-541: Enhanced option rendering with conditional layout for subtexts.

The renderOptionWithIcon function now intelligently renders options with a vertical layout when subtext is present, improving readability and user experience.

app/client/src/PluginActionEditor/types/PluginActionTypes.ts (4)

1-3: Good import and constant definition.

Properly imports the theme and defines a constant for it.


5-8: Well-defined enum for action run behavior.

The enum clearly defines the two possible run behaviors with descriptive names.


10-21: Comprehensive metadata for run behavior options.

The RUN_BEHAVIOR object provides rich metadata including labels and descriptive subtexts, which improves the UI/UX for developers selecting these options.


23-25: Good helper exports for type-safe access.

RUN_BEHAVIOR_VALUES provides easy access to the options array, and ActionRunBehaviourType ensures type safety when working with the string literals.

app/client/src/pages/Editor/SaaSEditor/__data__/InitialState.json (4)

85-85: Added runBehavior property to replace executeOnLoad.

Properly set the default value to "MANUAL", which is safer by requiring explicit action to execute.


2545-2560: Consistent configuration for MongoDB plugin settings.

Good implementation of the dropdown control with clear labels and helpful subtexts to guide users.


2591-2606: Consistent configuration for PostgreSQL plugin settings.

Maintains the same pattern as other plugins, ensuring consistent user experience across different data sources.


2637-2652: Consistent implementation across all plugins.

The run behavior dropdown is consistently implemented across all plugin settings (REST API, Firebase, Google Sheets, S3, and Redis), with identical options and helpful descriptions.

Also applies to: 2689-2704, 2728-2743, 2774-2789, 2820-2835

app/server/appsmith-server/src/test/java/com/appsmith/server/services/LayoutActionServiceTest.java (2)

1357-1402: Good implementation of tests for the new RunBehavior functionality.

The test testSetRunBehavior_WhenRunBehaviorChanged_ValuesUpdatedCorrectly thoroughly verifies the synchronization between runBehavior and executeOnLoad properties. It confirms that:

  • Setting runBehavior to ON_PAGE_LOAD sets executeOnLoad to true
  • Setting runBehavior to MANUAL sets executeOnLoad to false
  • The userSetOnLoad property remains true when toggling between behaviors
  • Changes are correctly persisted in the repository

1404-1441: Comprehensive testing of backward compatibility.

This test validates that the legacy setExecuteOnLoad method correctly updates the new runBehavior property, ensuring bidirectional synchronization between the two properties. This approach maintains backward compatibility while allowing the migration to the new enum-based model.

app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/LayoutActionServiceCEImpl.java (3)

304-310: Good backward compatibility implementation.

The modification to setExecuteOnLoad ensures that the new runBehavior property stays synchronized with the legacy executeOnLoad flag. This maintains compatibility with existing code while enabling the transition to the more expressive enum-based approach.


322-349: Well-structured implementation of the new setRunBehavior method.

The new method follows consistent patterns with the existing code:

  • Proper permission checks before finding the action
  • Error handling when action is not found
  • Updates both runBehavior and executeOnLoad to keep them in sync
  • Updates the page layout to reflect the changes

427-434: Proper initialization of runBehavior during action creation.

This code ensures that the new runBehavior property is properly initialized based on the action's executeOnLoad setting during cloning operations. For new actions and cloned actions, the values are set consistently with appropriate defaults.

app/client/src/actions/pluginActionActions.ts (3)

23-23: Appropriate import for the new type.

Adding the import for ActionRunBehaviourType properly introduces the type needed for the refactored action creators.


355-366: Good function rename to align with backend changes.

Renamed from setActionsToExecuteOnPageLoad to setActionsRunBehavior and updated the parameter type to use the new runBehavior enum instead of the boolean executeOnLoad. This maintains consistency with the server-side model.


368-380: Consistent naming pattern applied to JS actions.

The function for JavaScript actions follows the same naming pattern, creating a consistent API across different action types. The update to use runBehavior instead of executeOnLoad aligns with the new model.

app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts (5)

2310-2310: Good implementation of the new runBehavior property

The change from boolean executeOnLoad to enum-style runBehavior with "ON_PAGE_LOAD" value improves code readability and makes behavior more explicit.


2394-2394: Correctly implemented runBehavior for manual execution

The "MANUAL" value here appropriately replaces what was likely executeOnLoad: false in the previous implementation.


10041-10058: Well-designed UI configuration for the run behavior dropdown

The dropdown implementation is well-structured with clear labels and helpful subtext that explains each option's behavior to users. This is a significant improvement over the previous boolean toggle approach.


10092-10109: Consistent implementation across multiple plugin configurations

The run behavior dropdown is consistently implemented across different plugins with identical options and descriptions, which ensures a uniform user experience.

Also applies to: 10143-10160, 10223-10240


10415-10415: Consistent JS action configuration with runBehavior property

The JS actions are correctly configured with the "MANUAL" run behavior, maintaining consistency with the overall refactoring approach.

Also applies to: 10465-10465, 10549-10549, 10599-10599

app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx (3)

11-11: Import of ActionRunBehaviourType added for type safety.

This import supports the transition from boolean executeOnLoad to enum-based runBehavior property, improving type safety and making the code more self-documenting.


364-392: Redux action handler updated to use runBehavior instead of executeOnLoad.

The Redux action handler now properly uses the typed runBehavior property instead of the boolean executeOnLoad, making the code more expressive and maintainable.


393-420: Handler for setting run behavior on JS actions refactored.

The migration from executeOnLoad to runBehavior is well-implemented. The code maintains functionality while using the new property name, improving clarity around when actions run.

app/client/src/sagas/ActionSagas.ts (4)

150-150: Added import for typed run behavior enum.

This import correctly brings in the typed ActionRunBehaviourType to replace the previous boolean flag.


1042-1052: Updated property saga to handle run behavior property.

The saga now properly dispatches the new action type with the runBehavior value when this property is being updated.


1064-1089: Renamed and updated saga for action run behavior.

Saga has been correctly renamed from toggleActionExecuteOnLoadSaga to updateActionRunBehaviorSaga to match the new semantics. The implementation properly uses the typed runBehavior parameter instead of the boolean shouldExecute.


1269-1271: Updated saga watcher for new action type.

The watcher saga now correctly listens for the new action type UPDATE_ACTION_RUN_BEHAVIOR_INIT instead of the legacy TOGGLE_ACTION_EXECUTE_ON_LOAD_INIT.

app/client/src/sagas/JSPaneSagas.ts (4)

104-104: Added import for typed run behavior enum.

Correctly imports the new ActionRunBehaviourType type to support refactoring from boolean to enum-based property.


786-797: Updated function property saga to handle run behavior.

The saga now properly checks for and handles the runBehavior property, dispatching the updated action type.


850-882: Renamed and updated saga for JS function run behavior.

Saga has been properly renamed from toggleFunctionExecuteOnLoadSaga to updateFunctionRunBehaviorSaga to reflect the new semantics. The implementation now correctly uses the typed runBehavior property.


947-948: Updated saga watcher for new action type.

The watcher saga now listens for the updated action type, completing the refactoring from toggle to update semantics.

app/client/src/ce/constants/ReduxActionConstants.tsx (4)

69-73: Updated JSEditorActionTypes to use run behavior terminology.

Action types have been renamed from executeOnLoad to runBehavior variants, ensuring consistent terminology across the codebase.


87-87: Updated error action type for run behavior.

Error action type has been updated to maintain consistency with the new naming scheme.


808-810: Added new action types for action run behavior.

These new action types support the more flexible run behavior model for actions, replacing the boolean toggle approach.


824-824: Added error type for action run behavior.

Error type has been added to properly handle failures in the updated run behavior flow.

app/client/src/ce/sagas/PageSagas.tsx (3)

91-92: Action creator imports updated to align with new run behavior naming convention.

The import names have been changed from execution-centric naming (setActionsToExecuteOnPageLoad) to behavior-centric naming (setActionsRunBehavior), which better reflects the enum-based approach being implemented.


539-540: Updated action dispatch to use new run behavior action creator.

This change properly replaces the legacy executeOnLoad boolean approach with the new runBehavior enum-based system for regular actions.


547-548: Updated JS action dispatch to use new run behavior action creator.

This change properly replaces the legacy executeOnLoad boolean approach with the new runBehavior enum-based system for JS actions.

@ankitakinger ankitakinger changed the base branch from release to feat/reactive-actions-run-behaviour April 29, 2025 17:14
@ankitakinger ankitakinger requested review from AmanAgarwal041 and removed request for a team, ApekshaBhosale and ayushpahwa April 29, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0