diff --git a/app/client/src/PluginActionEditor/constants/PluginActionConstants.ts b/app/client/src/PluginActionEditor/constants/PluginActionConstants.ts index dd7714fb7ea1..ce50c573b874 100644 --- a/app/client/src/PluginActionEditor/constants/PluginActionConstants.ts +++ b/app/client/src/PluginActionEditor/constants/PluginActionConstants.ts @@ -3,15 +3,15 @@ import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig export const THEME = EditorTheme.LIGHT; export enum ActionRunBehaviour { - PAGE_LOAD = "PAGE_LOAD", + ON_PAGE_LOAD = "ON_PAGE_LOAD", MANUAL = "MANUAL", } export const RUN_BEHAVIOR = { - PAGE_LOAD: { + ON_PAGE_LOAD: { label: "On page load", subText: "Query runs when the page loads or when manually triggered", - value: ActionRunBehaviour.PAGE_LOAD, + value: ActionRunBehaviour.ON_PAGE_LOAD, }, MANUAL: { label: "Manual", @@ -21,3 +21,5 @@ export const RUN_BEHAVIOR = { }; export const RUN_BEHAVIOR_VALUES = Object.values(RUN_BEHAVIOR); + +export type ActionRunBehaviourType = `${ActionRunBehaviour}`; diff --git a/app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts b/app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts index 4298185f29ea..1f070b230076 100644 --- a/app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts +++ b/app/client/src/PluginActionEditor/transformers/RestActionTransformers.test.ts @@ -9,15 +9,13 @@ import { MultiPartOptionTypes, POST_BODY_FORMAT_OPTIONS, } from "../constants/CommonApiConstants"; -import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; // jest.mock("POST_"); const BASE_ACTION: ApiAction = { dynamicBindingPathList: [], cacheResponse: "", - executeOnLoad: false, - runBehavior: ActionRunBehaviour.MANUAL, + runBehavior: "MANUAL", invalids: [], isValid: false, workspaceId: "", diff --git a/app/client/src/actions/pluginActionActions.ts b/app/client/src/actions/pluginActionActions.ts index ef0bcd204e07..98fd6425378c 100644 --- a/app/client/src/actions/pluginActionActions.ts +++ b/app/client/src/actions/pluginActionActions.ts @@ -20,6 +20,7 @@ import type { EventLocation } from "ee/utils/analyticsUtilTypes"; import type { GenerateDestinationIdInfoReturnType } from "ee/sagas/helpers"; import type { Span } from "instrumentation/types"; import type { EvaluationReduxAction } from "./EvaluationReduxActionTypes"; +import type { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; export const createActionRequest = ( payload: Partial, @@ -351,29 +352,29 @@ export const executePageLoadActions = ( }; }; -export const setActionsToExecuteOnPageLoad = ( +export const setActionsRunBehavior = ( actions: Array<{ - executeOnLoad: boolean; + runBehavior: ActionRunBehaviour; id: string; name: string; }>, ) => { return { - type: ReduxActionTypes.SET_ACTION_TO_EXECUTE_ON_PAGELOAD, + type: ReduxActionTypes.SET_ACTION_RUN_BEHAVIOR, payload: actions, }; }; -export const setJSActionsToExecuteOnPageLoad = ( +export const setJSActionsRunBehavior = ( actions: Array<{ - executeOnLoad: boolean; + runBehavior: ActionRunBehaviour; id: string; name: string; collectionId?: string; }>, ) => { return { - type: ReduxActionTypes.SET_JS_ACTION_TO_EXECUTE_ON_PAGELOAD, + type: ReduxActionTypes.SET_JS_ACTION_RUN_BEHAVIOR, payload: actions, }; }; diff --git a/app/client/src/api/ActionAPI.tsx b/app/client/src/api/ActionAPI.tsx index ada85c39b255..3855f9d4c172 100644 --- a/app/client/src/api/ActionAPI.tsx +++ b/app/client/src/api/ActionAPI.tsx @@ -10,6 +10,7 @@ import type { APIRequest } from "constants/AppsmithActionConstants/ActionConstan import type { WidgetType } from "constants/WidgetConstants"; import type { ActionParentEntityTypeInterface } from "ee/entities/Engine/actionHelpers"; import type { PostActionRunConfig } from "./types"; +import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants"; export interface Property { key: string; @@ -301,12 +302,12 @@ class ActionAPI extends API { }); } - static async toggleActionExecuteOnLoad( + static async updateActionRunBehavior( actionId: string, - shouldExecute: boolean, + runBehavior: ActionRunBehaviourType, ) { - return API.put(ActionAPI.url + `/executeOnLoad/${actionId}`, undefined, { - flag: shouldExecute.toString(), + return API.put(ActionAPI.url + `/runBehavior/${actionId}`, undefined, { + behavior: runBehavior, }); } } diff --git a/app/client/src/api/PageApi.tsx b/app/client/src/api/PageApi.tsx index db81058b901d..ae05cd00af62 100644 --- a/app/client/src/api/PageApi.tsx +++ b/app/client/src/api/PageApi.tsx @@ -9,6 +9,7 @@ import type { import type { DSLWidget } from "WidgetProvider/constants"; import type { FetchApplicationResponse } from "ee/api/ApplicationApi"; import type { APP_MODE } from "entities/App"; +import type { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; export interface FetchPageRequest { pageId: string; @@ -69,7 +70,7 @@ export interface SavePageResponseData { dsl: Partial; messages: string[]; actionUpdates: Array<{ - executeOnLoad: boolean; + runBehavior: ActionRunBehaviour; id: string; name: string; collectionId?: string; diff --git a/app/client/src/ce/constants/ReduxActionConstants.tsx b/app/client/src/ce/constants/ReduxActionConstants.tsx index 57ad73c96b46..0a5c7a7ab369 100644 --- a/app/client/src/ce/constants/ReduxActionConstants.tsx +++ b/app/client/src/ce/constants/ReduxActionConstants.tsx @@ -66,11 +66,10 @@ const JSEditorActionTypes = { SET_FUNCTION_PROPERTY: "SET_FUNCTION_PROPERTY", UPDATE_JS_FUNCTION_PROPERTY_INIT: "UPDATE_JS_FUNCTION_PROPERTY_INIT", UPDATE_JS_FUNCTION_PROPERTY_SUCCESS: "UPDATE_JS_FUNCTION_PROPERTY_SUCCESS", - TOGGLE_FUNCTION_EXECUTE_ON_LOAD_INIT: "TOGGLE_FUNCTION_EXECUTE_ON_LOAD_INIT", - TOGGLE_FUNCTION_EXECUTE_ON_LOAD_SUCCESS: - "TOGGLE_FUNCTION_EXECUTE_ON_LOAD_SUCCESS", - SET_JS_ACTION_TO_EXECUTE_ON_PAGELOAD: "SET_JS_ACTION_TO_EXECUTE_ON_PAGELOAD", + SET_JS_ACTION_RUN_BEHAVIOR: "SET_JS_ACTION_RUN_BEHAVIOR", SET_ACTIVE_JS_ACTION: "SET_ACTIVE_JS_ACTION", + UPDATE_FUNCTION_RUN_BEHAVIOR_INIT: "UPDATE_FUNCTION_RUN_BEHAVIOR_INIT", + UPDATE_FUNCTION_RUN_BEHAVIOR_SUCCESS: "UPDATE_FUNCTION_RUN_BEHAVIOR_SUCCESS", }; const JSEditorActionErrorTypes = { @@ -85,6 +84,7 @@ const JSEditorActionErrorTypes = { REFACTOR_JS_ACTION_NAME_ERROR: "REFACTOR_JS_ACTION_NAME_ERROR", UPDATE_JS_ACTION_BODY_ERROR: "UPDATE_JS_ACTION_BODY_ERROR", UPDATE_JS_FUNCTION_PROPERTY_ERROR: "UPDATE_JS_FUNCTION_PROPERTY_ERROR", + UPDATE_FUNCTION_RUN_BEHAVIOR_ERROR: "UPDATE_FUNCTION_RUN_BEHAVIOR_ERROR", }; const GitActionTypes = { @@ -805,10 +805,9 @@ const ActionActionTypes = { SET_ACTION_PROPERTY: "SET_ACTION_PROPERTY", UPDATE_ACTION_PROPERTY: "UPDATE_ACTION_PROPERTY", SWITCH_DATASOURCE: "SWITCH_DATASOURCE", - SET_ACTION_TO_EXECUTE_ON_PAGELOAD: "SET_ACTION_TO_EXECUTE_ON_PAGELOAD", - TOGGLE_ACTION_EXECUTE_ON_LOAD_SUCCESS: - "TOGGLE_ACTION_EXECUTE_ON_LOAD_SUCCESS", - TOGGLE_ACTION_EXECUTE_ON_LOAD_INIT: "TOGGLE_ACTION_EXECUTE_ON_LOAD_INIT", + SET_ACTION_RUN_BEHAVIOR: "SET_ACTION_RUN_BEHAVIOR", + UPDATE_ACTION_RUN_BEHAVIOR_INIT: "UPDATE_ACTION_RUN_BEHAVIOR_INIT", + UPDATE_ACTION_RUN_BEHAVIOR_SUCCESS: "UPDATE_ACTION_RUN_BEHAVIOR_SUCCESS", }; const ActionActionErrorTypes = { @@ -822,7 +821,7 @@ const ActionActionErrorTypes = { FETCH_ACTIONS_FOR_PAGE_ERROR: "FETCH_ACTIONS_FOR_PAGE_ERROR", SAVE_ACTION_NAME_ERROR: "SAVE_ACTION_NAME_ERROR", SAVE_API_NAME_ERROR: "SAVE_API_NAME_ERROR", - TOGGLE_ACTION_EXECUTE_ON_LOAD_ERROR: "TOGGLE_ACTION_EXECUTE_ON_LOAD_ERROR", + UPDATE_ACTION_RUN_BEHAVIOR_ERROR: "UPDATE_ACTION_RUN_BEHAVIOR_ERROR", }; const PropertyPanelActionTypes = { diff --git a/app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts b/app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts index f9765a1ad245..158b9839e6f5 100644 --- a/app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts +++ b/app/client/src/ce/entities/DataTree/dataTreeJSAction.test.ts @@ -44,7 +44,7 @@ describe("generateDataTreeJSAction", () => { body: "async () => {\n\t\t//use async-await or promises\n\t}", jsArguments: [], }, - executeOnLoad: false, + runBehavior: "MANUAL", dynamicBindingPathList: [ { key: "body", @@ -91,7 +91,7 @@ describe("generateDataTreeJSAction", () => { body: "() => {\n\t\t//write code here\n\t}", jsArguments: [], }, - executeOnLoad: false, + runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ { @@ -239,7 +239,7 @@ describe("generateDataTreeJSAction", () => { body: "async () => {\n\t\t//use async-await or promises\n\t}", jsArguments: [], }, - executeOnLoad: false, + runBehavior: "MANUAL", dynamicBindingPathList: [ { key: "body", @@ -286,7 +286,7 @@ describe("generateDataTreeJSAction", () => { body: "() => {\n\t\t//write code here\n\t}", jsArguments: [], }, - executeOnLoad: false, + runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ { diff --git a/app/client/src/ce/reducers/entityReducers/actionsReducer.tsx b/app/client/src/ce/reducers/entityReducers/actionsReducer.tsx index b02f54ac5263..87b686bdc0b1 100644 --- a/app/client/src/ce/reducers/entityReducers/actionsReducer.tsx +++ b/app/client/src/ce/reducers/entityReducers/actionsReducer.tsx @@ -13,6 +13,7 @@ import type { UpdateActionPropertyActionPayload, } from "actions/pluginActionActions"; import { klona } from "klona"; +import type { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; export interface ActionData { isLoading: boolean; @@ -310,11 +311,11 @@ export const handlers = { }, ]); }, - [ReduxActionTypes.SET_ACTION_TO_EXECUTE_ON_PAGELOAD]: ( + [ReduxActionTypes.SET_ACTION_RUN_BEHAVIOR]: ( draftMetaState: ActionDataState, action: ReduxAction< Array<{ - executeOnLoad: boolean; + runBehavior: ActionRunBehaviour; id: string; name: string; }> @@ -324,8 +325,8 @@ export const handlers = { draftMetaState.forEach((action) => { if (action.config.id in actionUpdateSearch) { - action.config.executeOnLoad = - actionUpdateSearch[action.config.id].executeOnLoad; + action.config.runBehavior = + actionUpdateSearch[action.config.id].runBehavior; } }); }, diff --git a/app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx b/app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx index 4d267d75d041..326532256a79 100644 --- a/app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx +++ b/app/client/src/ce/reducers/entityReducers/jsActionsReducer.tsx @@ -8,6 +8,7 @@ import { import { set, keyBy, findIndex, unset } from "lodash"; import { create } from "mutative"; import { klona } from "klona"; +import type { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; export const initialState: JSCollectionDataState = []; @@ -360,19 +361,19 @@ export const handlers = { return a; }), - [ReduxActionTypes.TOGGLE_FUNCTION_EXECUTE_ON_LOAD_SUCCESS]: ( + [ReduxActionTypes.UPDATE_FUNCTION_RUN_BEHAVIOR_SUCCESS]: ( state: JSCollectionDataState, action: ReduxAction<{ actionId: string; collectionId: string; - executeOnLoad: boolean; + runBehavior: ActionRunBehaviour; }>, ): JSCollectionDataState => state.map((a) => { if (a.config.id === action.payload.collectionId) { const updatedActions = a.config.actions.map((jsAction) => { if (jsAction.id === action.payload.actionId) { - set(jsAction, `executeOnLoad`, action.payload.executeOnLoad); + set(jsAction, `runBehavior`, action.payload.runBehavior); } return jsAction; @@ -389,11 +390,11 @@ export const handlers = { return a; }), - [ReduxActionTypes.SET_JS_ACTION_TO_EXECUTE_ON_PAGELOAD]: ( + [ReduxActionTypes.SET_JS_ACTION_RUN_BEHAVIOR]: ( state: JSCollectionDataState, action: ReduxAction< Array<{ - executeOnLoad: boolean; + runBehavior: ActionRunBehaviour; id: string; name: string; collectionId: string; @@ -410,7 +411,7 @@ export const handlers = { allActions.forEach((js) => { if (js.id in actionUpdateSearch) { - js.executeOnLoad = actionUpdateSearch[js.id].executeOnLoad; + js.runBehavior = actionUpdateSearch[js.id].runBehavior; } }); } diff --git a/app/client/src/ce/sagas/PageSagas.tsx b/app/client/src/ce/sagas/PageSagas.tsx index bbadd0ab499d..0ce2ece57247 100644 --- a/app/client/src/ce/sagas/PageSagas.tsx +++ b/app/client/src/ce/sagas/PageSagas.tsx @@ -88,8 +88,8 @@ import { fetchActionsForPageError, fetchActionsForPageSuccess, fetchActionsForView, - setActionsToExecuteOnPageLoad, - setJSActionsToExecuteOnPageLoad, + setActionsRunBehavior, + setJSActionsRunBehavior, } from "actions/pluginActionActions"; import type { UrlDataState } from "reducers/entityReducers/appReducer"; import { APP_MODE } from "entities/App"; @@ -536,7 +536,7 @@ export function* savePageSaga(action: ReduxAction<{ isRetry?: boolean }>) { ); if (actions && actions.length) { - yield put(setActionsToExecuteOnPageLoad(actions)); + yield put(setActionsRunBehavior(actions)); } const jsActions = actionUpdates.filter((d) => @@ -544,7 +544,7 @@ export function* savePageSaga(action: ReduxAction<{ isRetry?: boolean }>) { ); if (jsActions && jsActions.length) { - yield put(setJSActionsToExecuteOnPageLoad(jsActions)); + yield put(setJSActionsRunBehavior(jsActions)); } } diff --git a/app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts b/app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts index 0b5e260e35ea..7425f70d0eef 100644 --- a/app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts +++ b/app/client/src/ce/utils/autocomplete/EntityDefinitions.test.ts @@ -44,7 +44,7 @@ const jsObject: JSCollectionData = { jsArguments: [], isAsync: false, }, - executeOnLoad: false, + runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ { @@ -86,7 +86,7 @@ const jsObject: JSCollectionData = { jsArguments: [], isAsync: true, }, - executeOnLoad: false, + runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ { diff --git a/app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts b/app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts index f778afdcc940..3fc4e2ae851d 100644 --- a/app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts +++ b/app/client/src/components/editorComponents/PartialImportExport/PartialExportModal/unitTestUtils.ts @@ -2307,8 +2307,7 @@ export const defaultAppState = { }, ], }, - executeOnLoad: true, - runBehavior: "PAGE_LOAD", + runBehavior: "ON_PAGE_LOAD", dynamicBindingPathList: [], isValid: true, invalids: [], @@ -2392,7 +2391,6 @@ export const defaultAppState = { }, }, }, - executeOnLoad: false, runBehavior: "MANUAL", isValid: true, invalids: [], @@ -10049,7 +10047,7 @@ export const defaultAppState = { label: "On page load", subText: "Query runs when the page loads or when manually triggered", - value: "PAGE_LOAD", + value: "ON_PAGE_LOAD", }, { label: "Manual", @@ -10100,7 +10098,7 @@ export const defaultAppState = { label: "On page load", subText: "Query runs when the page loads or when manually triggered", - value: "PAGE_LOAD", + value: "ON_PAGE_LOAD", }, { label: "Manual", @@ -10151,7 +10149,7 @@ export const defaultAppState = { label: "On page load", subText: "Query runs when the page loads or when manually triggered", - value: "PAGE_LOAD", + value: "ON_PAGE_LOAD", }, { label: "Manual", @@ -10231,7 +10229,7 @@ export const defaultAppState = { label: "On page load", subText: "Query runs when the page loads or when manually triggered", - value: "PAGE_LOAD", + value: "ON_PAGE_LOAD", }, { label: "Manual", @@ -10414,7 +10412,6 @@ export const defaultAppState = { selfReferencingDataPaths: [], jsArguments: [], }, - executeOnLoad: false, runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ @@ -10465,7 +10462,6 @@ export const defaultAppState = { selfReferencingDataPaths: [], jsArguments: [], }, - executeOnLoad: false, runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ @@ -10550,7 +10546,6 @@ export const defaultAppState = { selfReferencingDataPaths: [], jsArguments: [], }, - executeOnLoad: false, runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ @@ -10601,7 +10596,6 @@ export const defaultAppState = { selfReferencingDataPaths: [], jsArguments: [], }, - executeOnLoad: false, runBehavior: "MANUAL", clientSideExecution: true, dynamicBindingPathList: [ diff --git a/app/client/src/components/editorComponents/utils.test.ts b/app/client/src/components/editorComponents/utils.test.ts index d0cb4f124788..3315e1945410 100644 --- a/app/client/src/components/editorComponents/utils.test.ts +++ b/app/client/src/components/editorComponents/utils.test.ts @@ -1,4 +1,5 @@ import { getJSResponseViewState, JSResponseState } from "./utils"; +import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; const TEST_JS_FUNCTION_ID = "627ccff468e1fa5185b7f901"; const TEST_JS_FUNCTION_BASE_ID = "627ccff468e1fa5185b7f912"; @@ -30,7 +31,7 @@ const TEST_JS_FUNCTION = { jsArguments: [], isAsync: true, }, - executeOnLoad: false, + runBehavior: ActionRunBehaviour.MANUAL, clientSideExecution: true, dynamicBindingPathList: [ { diff --git a/app/client/src/entities/Action/actionProperties.test.ts b/app/client/src/entities/Action/actionProperties.test.ts index 54b695bc9e47..23e827e6d5d4 100644 --- a/app/client/src/entities/Action/actionProperties.test.ts +++ b/app/client/src/entities/Action/actionProperties.test.ts @@ -10,7 +10,7 @@ const DEFAULT_ACTION: Action = { id: "randomDatasource", }, dynamicBindingPathList: [], - executeOnLoad: false, + runBehavior: "MANUAL", id: "", baseId: "", invalids: [], diff --git a/app/client/src/entities/Action/index.ts b/app/client/src/entities/Action/index.ts index 31bb2564d0d8..61a7687cdb99 100644 --- a/app/client/src/entities/Action/index.ts +++ b/app/client/src/entities/Action/index.ts @@ -10,7 +10,7 @@ import { type Plugin, type PluginName, } from "../Plugin"; -import type { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; +import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants"; export enum PaginationType { NONE = "NONE", @@ -140,8 +140,7 @@ export interface BaseAction { pageId: string; collectionId?: string; pluginId: string; - executeOnLoad: boolean; - runBehavior?: ActionRunBehaviour; + runBehavior: ActionRunBehaviourType; dynamicBindingPathList: DynamicPath[]; isValid: boolean; invalids: string[]; diff --git a/app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts b/app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts index 20aafe584921..9bf7b7dca3f5 100644 --- a/app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts +++ b/app/client/src/pages/Editor/EntityNavigation/JSObjectsPane/index.ts @@ -81,7 +81,7 @@ export default class JSObjectsPaneNavigation extends PaneNavigation { *getTab(propertyPath: string) { if ( - propertyPath.includes("executeOnLoad") || + propertyPath.includes("runBehavior") || propertyPath.includes("confirmBeforeExecute") ) { return JSEditorTab.SETTINGS; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx index 3662a47e06c4..5dff0fde7728 100644 --- a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.test.tsx @@ -4,6 +4,7 @@ import { render, screen } from "test/testUtils"; import { JSFunctionSettings } from "./JSFunctionSettings"; import { useFeatureFlag } from "utils/hooks/useFeatureFlag"; import { JSObjectFactory } from "test/factories/Actions/JSObject"; +import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; // Mock the useFeatureFlag hook jest.mock("utils/hooks/useFeatureFlag"); @@ -54,11 +55,11 @@ describe("JSFunctionSettings", () => { const updatedJSActions = [ { ...actions[0], - executeOnLoad: true, + runBehavior: ActionRunBehaviour.ON_PAGE_LOAD, }, { ...actions[1], - executeOnLoad: false, + runBehavior: ActionRunBehaviour.MANUAL, }, ]; diff --git a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx index 76e69311a428..169ff0d3ed73 100644 --- a/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx +++ b/app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionSettings.tsx @@ -15,10 +15,7 @@ import { import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import type { OnUpdateSettingsProps } from "../types"; import type { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants"; -import { - RUN_BEHAVIOR, - RUN_BEHAVIOR_VALUES, -} from "PluginActionEditor/constants/PluginActionConstants"; +import { RUN_BEHAVIOR_VALUES } from "PluginActionEditor/constants/PluginActionConstants"; import styled from "styled-components"; const OptionLabel = styled(Text)` @@ -71,24 +68,22 @@ const FunctionSettingRow = (props: FunctionSettingsRowProps) => { - {props.action.name} + {props.action.name} {options.map((option) => (