diff --git a/app/client/src/ce/workers/Evaluation/evaluationUtils.ts b/app/client/src/ce/workers/Evaluation/evaluationUtils.ts index 3fcb5d57a8..1df27bf905 100644 --- a/app/client/src/ce/workers/Evaluation/evaluationUtils.ts +++ b/app/client/src/ce/workers/Evaluation/evaluationUtils.ts @@ -988,3 +988,7 @@ export const isAPathDynamicBindingPath = ( export const isNotEntity = (entity: DataTreeEntity) => { return !isAction(entity) && !isWidget(entity) && !isJSAction(entity); }; + +export const isEntityAction = (entity: DataTreeEntity) => { + return isAction(entity); +}; diff --git a/app/client/src/components/editorComponents/ActionCreator/helpers.tsx b/app/client/src/components/editorComponents/ActionCreator/helpers.tsx index b81640ebde..359e3ca3ae 100644 --- a/app/client/src/components/editorComponents/ActionCreator/helpers.tsx +++ b/app/client/src/components/editorComponents/ActionCreator/helpers.tsx @@ -11,7 +11,10 @@ import { setGlobalSearchCategory } from "actions/globalSearchActions"; import { createNewJSCollection } from "actions/jsPaneActions"; import { createModalAction } from "actions/widgetActions"; import type { AppState } from "@appsmith/reducers"; -import { getEntityNameAndPropertyPath } from "@appsmith/workers/Evaluation/evaluationUtils"; +import { + getEntityNameAndPropertyPath, + isEntityAction, +} from "@appsmith/workers/Evaluation/evaluationUtils"; import type { TreeDropdownOption } from "design-system-old"; import { Icon } from "design-system"; import { PluginType } from "entities/Action"; @@ -62,10 +65,7 @@ import { } from "./utils"; import store from "store"; import { selectEvaluationVersion } from "@appsmith/selectors/applicationSelectors"; -import { - isAction, - isJSAction, -} from "@appsmith/workers/Evaluation/evaluationUtils"; +import { isJSAction } from "@appsmith/workers/Evaluation/evaluationUtils"; import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes"; import type { ModuleInstanceDataState } from "@appsmith/constants/ModuleInstanceConstants"; import { MODULE_TYPE } from "@appsmith/constants/ModuleConstants"; @@ -111,7 +111,7 @@ export function getFieldFromValue( const entity = dataTree && dataTree[entityProps.entityName]; if (entity && "ENTITY_TYPE" in entity) { - if (isAction(entity as DataTreeEntity)) { + if (isEntityAction(entity as DataTreeEntity)) { // get fields for API action return getActionEntityFields( fields, diff --git a/app/client/src/components/editorComponents/ActionCreator/types.ts b/app/client/src/components/editorComponents/ActionCreator/types.ts index 83110b7959..9d116ea54a 100644 --- a/app/client/src/components/editorComponents/ActionCreator/types.ts +++ b/app/client/src/components/editorComponents/ActionCreator/types.ts @@ -12,6 +12,7 @@ import type { AdditionalDynamicDataTree } from "utils/autocomplete/customTreeTyp import type { FieldType, ViewTypes, AppsmithFunction } from "./constants"; import type { APPSMITH_INTEGRATIONS } from "./constants"; import type { Variants } from "./constants"; +import type { MODULE_TYPE } from "@appsmith/constants/ModuleConstants"; export type GenericFunction = (...args: any[]) => any; @@ -162,6 +163,7 @@ export interface DataTreeForActionCreator { [key: string]: { ENTITY_TYPE?: EntityTypeValue; meta?: Record; + type?: MODULE_TYPE; }; } diff --git a/app/client/src/sagas/selectors.tsx b/app/client/src/sagas/selectors.tsx index f9b91b800d..2b0b413132 100644 --- a/app/client/src/sagas/selectors.tsx +++ b/app/client/src/sagas/selectors.tsx @@ -97,6 +97,7 @@ export const getDataTreeForActionCreator = memoize((state: AppState) => { dataTree[key] = { meta: value?.meta || null, ENTITY_TYPE: value?.ENTITY_TYPE || null, + type: value?.type || null, }; }); return dataTree;