chore: separated tree type into common file to be extended on EE (#27812)

## Description
UnEvalTree, dataTree and configTree's entities needs to be extended on
EE to accommodate module inputs and different types of modules hence the
separation.
I have added few more sanity checks in the existing code which were
throwing errors/warning on EE.

#### PR fixes following issue(s)
Fixes # (issue number)

#### Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video
>
>
#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)

>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] JUnit
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
Apeksha Bhosale 2023-10-10 18:02:17 +05:30 committed by GitHub
parent 8eac493b80
commit 0f393a2423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
100 changed files with 252 additions and 258 deletions

View File

@ -145,11 +145,6 @@ export type UnEvalTreeEntityObject =
| JSActionEntity
| WidgetEntity;
export type UnEvalTreeEntity = UnEvalTreeEntityObject | AppsmithEntity | Page[];
export type UnEvalTree = {
[entityName: string]: UnEvalTreeEntity;
};
export interface WidgetEntity extends WidgetProps {
meta: Record<string, unknown>;
ENTITY_TYPE: ENTITY_TYPE.WIDGET;
@ -160,12 +155,6 @@ export type DataTreeEntityObject =
| WidgetEntity
| AppsmithEntity;
export type DataTreeEntity = DataTreeEntityObject | Page[] | ActionDispatcher;
export type DataTree = {
[entityName: string]: DataTreeEntity;
};
export interface WidgetEntityConfig
extends Partial<WidgetProps>,
Omit<WidgetConfigProps, "widgetName" | "rows" | "columns">,
@ -207,12 +196,3 @@ export type DataTreeEntityConfig =
| WidgetEntityConfig
| ActionEntityConfig
| JSActionEntityConfig;
export type ConfigTree = {
[entityName: string]: DataTreeEntityConfig;
};
export type unEvalAndConfigTree = {
unEvalTree: UnEvalTree;
configTree: ConfigTree;
};

View File

@ -2,14 +2,12 @@ import type {
PropertyOverrideDependency,
OverridingPropertyPaths,
ModuleInput,
DataTreeEntity,
WidgetEntity,
ActionEntity,
JSActionEntity,
ConfigTree,
UnEvalTree,
DataTreeEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import { OverridingPropertyType } from "@appsmith/entities/DataTree/types";
import {
isAction,
@ -70,14 +68,12 @@ export const setOverridingProperty = ({
};
export const generateDataTreeModuleInputs = (
dataTree: UnEvalTree,
configTree: ConfigTree,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
moduleInputs: Record<string, ModuleInput>,
moduleInput: ModuleInput,
) => {
return {
dataTree,
configTree,
unEvalEntity: null,
configEntity: null,
};
};

View File

@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/ban-types */
import set from "lodash/set";
import type { DataTreeEntityConfig } from "@appsmith/entities/DataTree/types";
import type {
ConfigTree,
DataTree,
DataTreeEntity,
DataTreeEntityConfig,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import type { EvalContext } from "workers/Evaluation/evaluate";
import type { EvaluationVersion } from "@appsmith/api/ApplicationApi";
import { addFn } from "workers/Evaluation/fns/utils/fnGuard";

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { makeEntityConfigsAsObjProperties } from "@appsmith/workers/Evaluation/dataTreeUtils";
import { smallDataSet } from "workers/Evaluation/__tests__/generateOpimisedUpdates.test";
import produce from "immer";

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { get, isObject, set, unset } from "lodash";
import { klona } from "klona/json";
import type { EvalProps } from "workers/common/DataTreeEvaluator";

View File

@ -4,19 +4,20 @@ import { RenderModes } from "constants/WidgetConstants";
import { ValidationTypes } from "constants/WidgetValidation";
import type {
ConfigTree,
DataTreeEntity,
WidgetEntity,
WidgetEntityConfig,
PrivateWidgets,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
import {
ENTITY_TYPE_VALUE,
EvaluationSubstitutionType,
} from "entities/DataTree/dataTreeFactory";
import type {
PrivateWidgets,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
ConfigTree,
DataTreeEntity,
DataTree,
} from "entities/DataTree/dataTreeTypes";
import type { DataTreeDiff } from "@appsmith/workers/Evaluation/evaluationUtils";
import {
addErrorToEntityProperty,
@ -36,7 +37,6 @@ import {
overrideWidgetProperties,
findDatatype,
} from "@appsmith/workers/Evaluation/evaluationUtils";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { EvalMetaUpdates } from "@appsmith/workers/common/DataTreeEvaluator/types";
import { generateDataTreeWidget } from "entities/DataTree/dataTreeWidget";
import TableWidget from "widgets/TableWidget";

View File

@ -9,28 +9,28 @@ import {
} from "utils/DynamicBindingUtils";
import type { Diff } from "deep-diff";
import type {
DataTree,
AppsmithEntity,
DataTreeEntity,
WidgetEntity,
DataTreeEntityConfig,
DataTree,
ConfigTree,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "@appsmith/entities/DataTree/types";
import _, { difference, find, get, has, isNil, set } from "lodash";
import _, { difference, find, get, has, isEmpty, isNil, set } from "lodash";
import type { WidgetTypeConfigMap } from "WidgetProvider/factory";
import { PluginType } from "entities/Action";
import { klona } from "klona/full";
import { warn as logWarn } from "loglevel";
import type { EvalMetaUpdates } from "@appsmith/workers/common/DataTreeEvaluator/types";
import { isObject } from "lodash";
import type { DataTreeEntityObject } from "@appsmith/entities/DataTree/types";
import type {
JSActionEntityConfig,
PrivateWidgets,
JSActionEntity,
ActionEntity,
AppsmithEntity,
WidgetEntity,
DataTreeEntityConfig,
WidgetEntityConfig,
DataTreeEntityObject,
} from "@appsmith/entities/DataTree/types";
import type { EvalProps } from "workers/common/DataTreeEvaluator";
import { validateWidgetProperty } from "workers/common/DataTreeEvaluator/validationUtils";
@ -656,7 +656,8 @@ export const isDynamicLeaf = (
return false;
const relativePropertyPath = convertPathToString(propPathEls);
return (
relativePropertyPath in entityConfig.reactivePaths ||
(!isEmpty(entityConfig.reactivePaths) &&
relativePropertyPath in entityConfig.reactivePaths) ||
(isWidget(entityConfig) &&
relativePropertyPath in entityConfig?.triggerPaths)
);
@ -870,8 +871,9 @@ export function isValidEntity(
if (!isObject(entity)) {
return false;
}
return "ENTITY_TYPE" in entity;
return true;
}
export const isATriggerPath = (
entityConfig: DataTreeEntityConfig,
propertyPath: string,

View File

@ -60,7 +60,7 @@ import {
isAction,
isJSAction,
} from "@appsmith/workers/Evaluation/evaluationUtils";
import type { DataTreeEntity } from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
const actionList: {
label: string;

View File

@ -1,5 +1,6 @@
import type CodeMirror from "codemirror";
import type { DataTree, ENTITY_TYPE } from "@appsmith/entities/DataTree/types";
import type { ENTITY_TYPE } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { AutocompleteDataType } from "utils/autocomplete/AutocompleteDataType";
import type { EntityNavigationData } from "selectors/navigationSelectors";
import type { ExpectedValueExample } from "utils/validation/common";

View File

@ -31,10 +31,8 @@ import _, { debounce, isEqual } from "lodash";
import scrollIntoView from "scroll-into-view-if-needed";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import type {
DataTree,
EvaluationSubstitutionType,
} from "@appsmith/entities/DataTree/types";
import type { EvaluationSubstitutionType } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { Skin } from "constants/DefaultTheme";
import AnalyticsUtil from "utils/AnalyticsUtil";
import "components/editorComponents/CodeEditor/sql/customMimes";

View File

@ -34,7 +34,7 @@ import { getCurrentApplicationId } from "selectors/editorSelectors";
import { Indices } from "constants/Layers";
import { getExpectedValue } from "utils/validation/common";
import { ValidationTypes } from "constants/WidgetValidation";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { getDataTree } from "selectors/dataTreeSelectors";
import type { KeyValuePair } from "entities/Action";

View File

@ -17,7 +17,7 @@ import {
getTableStyles,
} from "widgets/TableWidget/component/TableUtilities";
import { reorderColumns } from "widgets/TableWidget/component/TableHelpers";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { getDataTreeForAutocomplete } from "selectors/dataTreeSelectors";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import { getEvalErrorPath, getEvalValuePath } from "utils/DynamicBindingUtils";

View File

@ -18,7 +18,7 @@ import {
isColumnTypeEditable,
reorderColumns,
} from "widgets/TableWidgetV2/widget/utilities";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import {
getDataTreeForAutocomplete,
getPathEvalErrors,

View File

@ -9,12 +9,14 @@ import {
import { generateDataTreeModuleInputs } from "@appsmith/entities/DataTree/utils";
import type {
DataTreeSeed,
unEvalAndConfigTree,
ConfigTree,
AppsmithEntity,
UnEvalTree,
ENTITY_TYPE,
} from "@appsmith/entities/DataTree/types";
import type {
unEvalAndConfigTree,
ConfigTree,
UnEvalTree,
} from "entities/DataTree/dataTreeTypes";
import { isEmpty } from "lodash";
export class DataTreeFactory {
@ -34,8 +36,8 @@ export class DataTreeFactory {
widgets,
widgetsMeta,
}: DataTreeSeed): unEvalAndConfigTree {
let dataTree: UnEvalTree = {};
let configTree: ConfigTree = {};
const dataTree: UnEvalTree = {};
const configTree: ConfigTree = {};
const start = performance.now();
const startActions = performance.now();
@ -64,13 +66,14 @@ export class DataTreeFactory {
const startWidgets = performance.now();
if (!isEmpty(moduleInputs)) {
const data = generateDataTreeModuleInputs(
dataTree,
configTree,
moduleInputs,
);
dataTree = data.dataTree;
configTree = data.configTree;
for (const [key, value] of Object.entries(moduleInputs)) {
const { configEntity, unEvalEntity } =
generateDataTreeModuleInputs(value);
if (!!configEntity && !!unEvalEntity) {
dataTree[key] = unEvalEntity;
configTree[key] = configEntity;
}
}
}
Object.values(widgets).forEach((widget) => {

View File

@ -0,0 +1,27 @@
import type {
DataTreeEntityConfig,
DataTreeEntityObject,
ActionDispatcher,
UnEvalTreeEntityObject,
AppsmithEntity,
} from "@appsmith/entities/DataTree/types";
import type { Page } from "@appsmith/constants/ReduxActionConstants";
export type unEvalAndConfigTree = {
unEvalTree: UnEvalTree;
configTree: ConfigTree;
};
export type ConfigTree = {
[entityName: string]: DataTreeEntityConfig;
};
export type DataTreeEntity = DataTreeEntityObject | Page[] | ActionDispatcher;
export type DataTree = {
[entityName: string]: DataTreeEntity;
};
export type UnEvalTreeEntity = UnEvalTreeEntityObject | AppsmithEntity | Page[];
export type UnEvalTree = {
[entityName: string]: UnEvalTreeEntity;
};

View File

@ -12,7 +12,7 @@ import { getErrorCount } from "layoutSystems/common/widgetName/utils";
import type { WidgetPositions } from "./types";
import type { WidgetProps } from "widgets/BaseWidget";
import type { WidgetNameData } from "./WidgetNamesCanvas/WidgetNameTypes";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
export const getWidgetPositions = (state: AppState) =>
state.entities.widgetPositions;

View File

@ -1,4 +1,4 @@
import type { ConfigTree, DataTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { isEmpty } from "lodash";
import type { EvalContext } from "workers/Evaluation/evaluate";
import { getEvaluationContext } from "./utils/getEvaluationContext";

View File

@ -2,7 +2,7 @@ import type {
ConfigTree,
DataTree,
DataTreeEntity,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import type { IEntity } from ".";
import type { Diff } from "deep-diff";
import EntityFactory from ".";

View File

@ -8,7 +8,6 @@ import type {
WidgetEntity as TWidgetEntity,
AppsmithEntity as TAppsmithEntity,
DataTreeEntityConfig,
DataTreeEntity,
WidgetEntityConfig as TWidgetEntityConfig,
JSActionEntity as TJSActionEntity,
ActionEntity as TActionEntity,
@ -16,6 +15,7 @@ import type {
ActionEntityConfig as TActionEntityConfig,
JSActionEntityConfig as TJSActionEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import {
defaultDiffGenerator,
type EntityDiffGenerator,

View File

@ -2,7 +2,7 @@ import type {
ConfigTree,
DataTree,
DataTreeEntity,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import type { LintErrorsStore } from "reducers/lintingReducers/lintErrorsReducers";
import type {
createEvaluationContext,

View File

@ -1,9 +1,9 @@
import type {
DataTreeEntity,
DataTreeEntityConfig,
JSActionEntityConfig,
JSActionEntity as TJSActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import { EvaluationSubstitutionType } from "@appsmith/entities/DataTree/types";
import type { TParsedJSProperty } from "@shared/ast";
import { isJSFunctionProperty } from "@shared/ast";

View File

@ -18,7 +18,7 @@ import type {
JSEntity,
WidgetEntity,
} from "../lib/entity";
import type { DataTreeEntity } from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
export function getEntityDependencies(
entity: IEntity,

View File

@ -1,4 +1,4 @@
import type { ConfigTree, DataTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { createEvaluationContext } from "workers/Evaluation/evaluate";
import { getActionTriggerFunctionNames } from "@appsmith/workers/Evaluation/fns";

View File

@ -1,4 +1,4 @@
import type { DataTreeEntity } from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import { isJSAction } from "@appsmith/workers/Evaluation/evaluationUtils";
// Removes "export default" statement from js Object

View File

@ -1,4 +1,4 @@
import type { DataTreeEntity } from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import { isDataTreeEntity } from "@appsmith/workers/Evaluation/evaluationUtils";
import { entityFns } from "@appsmith/workers/Evaluation/fns";
import setters from "workers/Evaluation/setters";

View File

@ -1,7 +1,5 @@
import type {
DataTree,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { JSActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { LintError } from "utils/DynamicBindingUtils";
import { PropertyEvaluationErrorType } from "utils/DynamicBindingUtils";
import { getScriptToEval, getScriptType } from "workers/Evaluation/evaluate";

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { LintError } from "utils/DynamicBindingUtils";
import { isNil } from "lodash";
import {

View File

@ -1,4 +1,4 @@
import type { DataTree, ConfigTree } from "@appsmith/entities/DataTree/types";
import type { DataTree, ConfigTree } from "entities/DataTree/dataTreeTypes";
import {
getEntityNameAndPropertyPath,
isATriggerPath,

View File

@ -2,7 +2,7 @@ import type { ReduxAction } from "@appsmith/constants/ReduxActionConstants";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import type { Diff } from "deep-diff";
import { applyChange } from "deep-diff";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { createImmerReducer } from "utils/ReducerUtils";
import * as Sentry from "@sentry/react";
import { get } from "lodash";

View File

@ -13,11 +13,8 @@ import { getType, Types } from "utils/TypeHelpers";
import type { FlattenedWidgetProps } from "WidgetProvider/constants";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import { getDataTree, getConfigTree } from "selectors/dataTreeSelectors";
import type {
DataTree,
ConfigTree,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { WidgetEntityConfig } from "@appsmith/entities/DataTree/types";
import type { DataTree, ConfigTree } from "entities/DataTree/dataTreeTypes";
import { isWidget } from "@appsmith/workers/Evaluation/evaluationUtils";
import type { TResetWidgetDescription } from "workers/Evaluation/fns/resetWidget";

View File

@ -34,7 +34,7 @@ import type { Action } from "entities/Action";
import { PluginType } from "entities/Action";
import type { JSCollection } from "entities/JSCollection";
import LOG_TYPE from "entities/AppsmithConsole/logtype";
import type { ConfigTree, DataTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import {
getConfigTree,
getDataTree,

View File

@ -27,7 +27,7 @@ import type {
JSVarMutatedEvents,
} from "workers/Evaluation/types";
import isEmpty from "lodash/isEmpty";
import type { UnEvalTree } from "@appsmith/entities/DataTree/types";
import type { UnEvalTree } from "entities/DataTree/dataTreeTypes";
import { sortJSExecutionDataByCollectionId } from "workers/Evaluation/JSObject/utils";
import type { LintTreeSagaRequestData } from "plugins/Linting/types";
export type UpdateDataTreeMessageData = {

View File

@ -82,12 +82,8 @@ import {
getAllActionValidationConfig,
getAllJSActionsData,
} from "@appsmith/selectors/entitiesSelector";
import type {
DataTree,
UnEvalTree,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { WidgetEntityConfig } from "@appsmith/entities/DataTree/types";
import type { DataTree, UnEvalTree } from "entities/DataTree/dataTreeTypes";
import { initiateLinting, lintWorker } from "./LintingSagas";
import type {
EvalTreeRequestData,

View File

@ -22,7 +22,7 @@ import { getDataTree } from "selectors/dataTreeSelectors";
import { getDynamicBindings, isDynamicValue } from "utils/DynamicBindingUtils";
import get from "lodash/get";
import { klona } from "klona/lite";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import {
extractFetchDynamicValueFormConfigs,
extractQueueOfValuesToBeFetched,

View File

@ -77,7 +77,7 @@ import { selectWidgetInitAction } from "actions/widgetSelectionActions";
import { hideIndicator } from "pages/Editor/GuidedTour/utils";
import { updateWidgetName } from "actions/propertyPaneActions";
import AnalyticsUtil from "utils/AnalyticsUtil";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";
import type { User } from "constants/userConstants";
import { builderURL, queryEditorIdURL } from "RouteBuilder";

View File

@ -4,12 +4,12 @@ import {
PLATFORM_ERROR,
Severity,
} from "entities/AppsmithConsole";
import type { WidgetEntityConfig } from "@appsmith/entities/DataTree/types";
import type {
ConfigTree,
DataTree,
UnEvalTree,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import type { DataTreeDiff } from "@appsmith/workers/Evaluation/evaluationUtils";
import {
DataTreeDiffEvent,

View File

@ -1,6 +1,6 @@
import { ENTITY_TYPE, Severity } from "entities/AppsmithConsole";
import LOG_TYPE from "entities/AppsmithConsole/logtype";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { isEmpty } from "lodash";
import AppsmithConsole from "utils/AppsmithConsole";
import {

View File

@ -37,7 +37,7 @@ import {
} from "WidgetProvider/constants";
import { getPropertiesToUpdate } from "./WidgetOperationSagas";
import { klona as clone } from "klona/full";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { generateAutoHeightLayoutTreeAction } from "actions/autoHeightActions";
import { toast } from "design-system";
import { ResponsiveBehavior } from "layoutSystems/common/utils/constants";

View File

@ -4,7 +4,7 @@ import {
getEvaluationInverseDependencyMap,
getDataTree,
} from "selectors/dataTreeSelectors";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { getActions } from "@appsmith/selectors/entitiesSelector";
import type {
ActionData,

View File

@ -137,11 +137,8 @@ import {
purgeOrphanedDynamicPaths,
} from "./WidgetOperationUtils";
import { widgetSelectionSagas } from "./WidgetSelectionSagas";
import type {
DataTree,
ConfigTree,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { WidgetEntityConfig } from "@appsmith/entities/DataTree/types";
import type { DataTree, ConfigTree } from "entities/DataTree/dataTreeTypes";
import { getCanvasSizeAfterWidgetMove } from "./CanvasSagas/DraggingCanvasSagas";
import widgetAdditionSagas from "./WidgetAdditionSagas";
import widgetDeletionSagas from "./WidgetDeletionSagas";

View File

@ -16,7 +16,7 @@ import {
WIDGET_PADDING,
} from "constants/WidgetConstants";
import { all, call } from "redux-saga/effects";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { select } from "redux-saga/effects";
import { getCopiedWidgets } from "utils/storage";
import type { WidgetProps } from "widgets/BaseWidget";

View File

@ -14,7 +14,8 @@ import {
} from "widgets/WidgetUtils";
import { getChildOfContainerLikeWidget } from "./helpers";
import { getDataTree } from "selectors/dataTreeSelectors";
import type { DataTree, WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { getLayoutTree } from "./layoutTree";
import { getWidgetsForBreakpoint } from "selectors/editorSelectors";

View File

@ -15,7 +15,8 @@ import { previewModeSelector } from "selectors/editorSelectors";
import { getAppMode } from "@appsmith/selectors/entitiesSelector";
import { isAutoHeightEnabledForWidget } from "widgets/WidgetUtils";
import { getCanvasHeightOffset } from "utils/WidgetSizeUtils";
import type { DataTree, WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { getDataTree } from "selectors/dataTreeSelectors";
export function* shouldWidgetsCollapse() {

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { createSelector } from "reselect";
import WidgetFactory from "WidgetProvider/factory";
import type { FlattenedWidgetProps } from "WidgetProvider/constants";

View File

@ -7,7 +7,8 @@ import {
getCurrentJSCollections,
getInputsForModule,
} from "@appsmith/selectors/entitiesSelector";
import type { DataTree, WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { DataTreeFactory } from "entities/DataTree/dataTreeFactory";
import {
getMetaWidgets,

View File

@ -1,6 +1,6 @@
import { Severity, ENTITY_TYPE, LOG_CATEGORY } from "entities/AppsmithConsole";
import LOG_TYPE from "entities/AppsmithConsole/logtype";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";
import { PropertyEvaluationErrorType } from "utils/DynamicBindingUtils";
import { getFilteredErrors } from "./debuggerSelectors";

View File

@ -1,5 +1,6 @@
import type { Log } from "entities/AppsmithConsole";
import type { DataTree, WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { isEmpty } from "lodash";
import type { AppState } from "@appsmith/reducers";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";

View File

@ -25,11 +25,10 @@ import {
} from "constants/WidgetConstants";
import { APP_MODE } from "entities/App";
import type {
DataTree,
ConfigTree,
WidgetEntity,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTree, ConfigTree } from "entities/DataTree/dataTreeTypes";
import { find, sortBy } from "lodash";
import {
getDataTree,

View File

@ -9,7 +9,7 @@ import type {
import { createSelector } from "reselect";
import { isEmpty, replace } from "lodash";
import { getDataTree } from "./dataTreeSelectors";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { Action } from "entities/Action";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import { getActionIdFromURL } from "@appsmith/pages/Editor/Explorer/helpers";

View File

@ -1,4 +1,5 @@
import type { DataTree, ENTITY_TYPE } from "@appsmith/entities/DataTree/types";
import type { ENTITY_TYPE } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { createSelector } from "reselect";
import {

View File

@ -1,11 +1,8 @@
import type { AppState } from "@appsmith/reducers";
import { find, get, set } from "lodash";
import { createSelector } from "reselect";
import type {
DataTree,
DataTreeEntity,
WidgetEntity,
} from "@appsmith/entities/DataTree/types";
import type { WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree, DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";
import type {
PropertyPaneReduxState,

View File

@ -10,10 +10,8 @@ import {
isTrueObject,
isWidget,
} from "@appsmith/workers/Evaluation/evaluationUtils";
import type {
DataTreeEntity,
DataTreeEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTreeEntityConfig } from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import { getType, Types } from "./TypeHelpers";
import { ViewTypes } from "components/formControls/utils";

View File

@ -1,5 +1,6 @@
import { entityDefinitions } from "@appsmith/utils/autocomplete/EntityDefinitions";
import type { DataTree, ActionEntity } from "@appsmith/entities/DataTree/types";
import type { ActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
export const getActionChildrenPeekData = (
actionName: string,

View File

@ -1,8 +1,6 @@
import { entityDefinitions } from "@appsmith/utils/autocomplete/EntityDefinitions";
import type {
AppsmithEntity,
DataTree,
} from "@appsmith/entities/DataTree/types";
import type { AppsmithEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { createObjectPeekData } from "./Common";
export const getAppsmithPeekData = (dataTree: DataTree) => {

View File

@ -1,7 +1,5 @@
import type {
DataTree,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { JSActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { JSCollectionData } from "reducers/entityReducers/jsActionsReducer";
export const getJsActionPeekData = (

View File

@ -1,9 +1,8 @@
import type {
ConfigTree,
DataTree,
WidgetEntity,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import type { EntityDefinitionsOptions } from "@appsmith/utils/autocomplete/EntityDefinitions";
import { isFunction } from "lodash";
import type { Def } from "tern";

View File

@ -3,7 +3,7 @@ import type {
ConfigTree,
DataTree,
DataTreeEntity,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import type { JSCollectionDataState } from "reducers/entityReducers/jsActionsReducer";
import { getWidgetChildrenPeekData } from "./Widget";
import { getJsActionPeekData } from "./JsAction";

View File

@ -1,7 +1,5 @@
import type {
DataTree,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { JSActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { keyBy } from "lodash";
import type { JSCollectionData } from "reducers/entityReducers/jsActionsReducer";

View File

@ -1,4 +1,5 @@
import type { DataTree, WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { builderURL } from "RouteBuilder";
import type { EntityNavigationData } from "selectors/navigationSelectors";

View File

@ -1,4 +1,4 @@
import type { UnEvalTreeEntity } from "@appsmith/entities/DataTree/types";
import type { UnEvalTreeEntity } from "entities/DataTree/dataTreeTypes";
export type SuccessfulBindings = {
[entityName: string]: UnEvalTreeEntity;

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { get, set } from "lodash";
import {
isJSObject,

View File

@ -1,10 +1,12 @@
import type {
WidgetEntityConfig,
JSActionEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type {
ConfigTree,
DataTree,
DataTreeEntity,
WidgetEntityConfig,
JSActionEntityConfig,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { uniqueId, isFunction, isObject } from "lodash";
import { entityDefinitions } from "@appsmith/utils/autocomplete/EntityDefinitions";

View File

@ -1,4 +1,4 @@
import type { ConfigTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree } from "entities/DataTree/dataTreeTypes";
export default class ConfigTreeActions {
static tree: ConfigTree = {};

View File

@ -1,8 +1,8 @@
import type {
DataTree,
WidgetEntity,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";
import type { MetaWidgetsReduxState } from "reducers/entityReducers/metaWidgetsReducer";
import { buildChildWidgetTree, createCanvasWidget } from "./widgetRenderUtils";

View File

@ -3,11 +3,10 @@ import type {
FlattenedWidgetProps,
} from "reducers/entityReducers/canvasWidgetsReducer";
import type {
ConfigTree,
DataTree,
WidgetEntity,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { pick } from "lodash";
import {

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { createEvaluationContext } from "workers/Evaluation/evaluate";
import JSObjectCollection from "../Collection";

View File

@ -1,9 +1,6 @@
import { get, isEmpty, merge, set } from "lodash";
import type {
ConfigTree,
DataTree,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { JSActionEntity } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { EvalErrorTypes, getEvalValuePath } from "utils/DynamicBindingUtils";
import type { JSUpdate, ParsedJSSubAction } from "utils/JSPaneUtils";
import { parseJSObject, isJSFunctionProperty } from "@shared/ast";

View File

@ -1,4 +1,4 @@
import type { ConfigTree, UnEvalTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, UnEvalTree } from "entities/DataTree/dataTreeTypes";
import { getUpdatedLocalUnEvalTreeAfterJSUpdates } from ".";
describe("updateJSCollectionInUnEvalTree", function () {

View File

@ -1,10 +1,12 @@
import type {
JSActionEntityConfig,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
import type {
ConfigTree,
DataTree,
DataTreeEntity,
JSActionEntityConfig,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory";
import type { ParsedBody, ParsedJSSubAction } from "utils/JSPaneUtils";
import { unset, set, get, find } from "lodash";

View File

@ -1,4 +1,5 @@
import type { DataTree, ActionEntity } from "@appsmith/entities/DataTree/types";
import type { ActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { PluginType } from "entities/Action";
import type { EvalContext } from "workers/Evaluation/evaluate";

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { errorModifier } from "../errorModifier";
import DependencyMap from "entities/DependencyMap";
import { APP_MODE } from "entities/App";

View File

@ -2,7 +2,8 @@ import evaluate, {
evaluateAsync,
convertAllDataTypesToString,
} from "workers/Evaluation/evaluate";
import type { DataTree, WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { WidgetEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { RenderModes } from "constants/WidgetConstants";
import setupEvalEnv from "../handlers/setupEvalEnv";

View File

@ -1,11 +1,10 @@
import type {
ConfigTree,
WidgetEntity,
UnEvalTree,
WidgetEntityConfig,
ActionEntityConfig,
ActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { UnEvalTree, ConfigTree } from "entities/DataTree/dataTreeTypes";
import {
ENTITY_TYPE_VALUE,
EvaluationSubstitutionType,

View File

@ -2,7 +2,7 @@ import { generateDataTreeWidget } from "entities/DataTree/dataTreeWidget";
import setters from "../setters";
import TableWidget from "widgets/TableWidgetV2/widget";
import { RenderModes } from "constants/WidgetConstants";
import type { ConfigTree, DataTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { createEvaluationContext } from "../evaluate";
import { registerWidgets } from "WidgetProvider/factory/registrationHelper";

View File

@ -1,5 +1,6 @@
import { PluginType } from "entities/Action";
import type { DataTree, ActionEntity } from "@appsmith/entities/DataTree/types";
import type { ActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { createEvaluationContext } from "../evaluate";
import { addPlatformFunctionsToEvalContext } from "@appsmith/workers/Evaluation/Actions";

View File

@ -1,6 +1,6 @@
import { convertPathToString } from "@appsmith/workers/Evaluation/evaluationUtils";
import type { Diff } from "deep-diff";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { get, set, unset } from "lodash";
export type TDataStore = Record<string, Record<string, unknown>>;

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { TDataStore } from ".";
import {
isAction,

View File

@ -1,4 +1,4 @@
import type { ConfigTree, DataTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { getAllAsyncFunctions } from "@appsmith/workers/Evaluation/Actions";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import { PropertyEvaluationErrorCategory } from "utils/DynamicBindingUtils";

View File

@ -2,7 +2,7 @@ import type {
ConfigTree,
DataTree,
UnEvalTree,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import { dataTreeEvaluator } from "./handlers/evalTree";
import type { DataTreeDiff } from "@appsmith/workers/Evaluation/evaluationUtils";
import type { EvalMetaUpdates } from "@appsmith/workers/common/DataTreeEvaluator/types";

View File

@ -3,7 +3,7 @@ import type {
ConfigTree,
DataTree,
DataTreeEntity,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import { PropertyEvaluationErrorType } from "utils/DynamicBindingUtils";
import unescapeJS from "unescape-js";

View File

@ -1,6 +1,7 @@
import { addPlatformFunctionsToEvalContext } from "@appsmith/workers/Evaluation/Actions";
import { PluginType } from "entities/Action";
import type { DataTree, ActionEntity } from "@appsmith/entities/DataTree/types";
import type { ActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { createEvaluationContext } from "workers/Evaluation/evaluate";
import initLocalStorage from "../overrides/localStorage";
import { ENTITY_TYPE } from "pages/common/SearchSnippets";

View File

@ -2,7 +2,8 @@ jest.useFakeTimers();
import { EventType } from "constants/AppsmithActionConstants/ActionConstants";
import { PluginType } from "entities/Action";
import type { DataTree, ActionEntity } from "@appsmith/entities/DataTree/types";
import type { ActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import { overrideWebAPIs } from "../overrides";
import ExecutionMetaData from "../utils/ExecutionMetaData";

View File

@ -46,10 +46,8 @@ import {
isAction,
isAppsmithEntity,
} from "@appsmith/workers/Evaluation/evaluationUtils";
import type {
DataTreeEntity,
ActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { ActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import type {
TGetGeoLocationActionType,
TGetGeoLocationDescription,

View File

@ -1,4 +1,4 @@
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE } from "pages/common/SearchSnippets";
import { createEvaluationContext } from "workers/Evaluation/evaluate";

View File

@ -1,7 +1,5 @@
import type {
DataTreeEntity,
JSActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { JSActionEntity } from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE_VALUE } from "entities/DataTree/dataTreeFactory";
import JSObjectCollection from "./JSObject/Collection";
import JSFactory from "./JSObject/JSVariableFactory";

View File

@ -1,4 +1,4 @@
import type { ConfigTree, DataTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import type ReplayEntity from "entities/Replay";
import ReplayCanvas from "entities/Replay/ReplayEntity/ReplayCanvas";
import { isEmpty } from "lodash";

View File

@ -1,7 +1,7 @@
import { serialiseToBigInt } from "@appsmith/workers/Evaluation/evaluationUtils";
import type { Diff } from "deep-diff";
import { diff } from "deep-diff";
import type { DataTree } from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import equal from "fast-deep-equal";
import { get, isNumber, isObject } from "lodash";
import { EvalErrorTypes } from "utils/DynamicBindingUtils";

View File

@ -8,12 +8,12 @@ import { evalTreeWithChanges } from "./evalTreeWithChanges";
import { dataTreeEvaluator } from "./handlers/evalTree";
import { get, set } from "lodash";
import { validate } from "./validations";
import type { DataTreeEntityConfig } from "@appsmith/entities/DataTree/types";
import type {
ConfigTree,
DataTree,
DataTreeEntity,
DataTreeEntityConfig,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import { getFnWithGuards, isAsyncGuard } from "./fns/utils/fnGuard";
import { shouldAddSetter } from "./evaluate";

View File

@ -1,7 +1,7 @@
import type {
ConfigTree,
unEvalAndConfigTree,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import type { ActionValidationConfigMap } from "constants/PropertyControlConstants";
import type { AppTheme } from "entities/AppTheming";

View File

@ -19,18 +19,21 @@ import {
} from "utils/DynamicBindingUtils";
import type { WidgetTypeConfigMap } from "WidgetProvider/factory";
import type {
DataTree,
DataTreeEntity,
WidgetEntity,
ConfigTree,
WidgetEntityConfig,
DataTreeEntityConfig,
UnEvalTree,
ActionEntity,
JSActionEntity,
JSActionEntityConfig,
PrivateWidgets,
ActionEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type {
DataTree,
DataTreeEntity,
ConfigTree,
UnEvalTree,
} from "entities/DataTree/dataTreeTypes";
import { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory";
import { ENTITY_TYPE_VALUE } from "@appsmith/entities/DataTree/types";
import type { DataTreeDiff } from "@appsmith/workers/Evaluation/evaluationUtils";
@ -50,7 +53,6 @@ import {
trimDependantChangePaths,
overrideWidgetProperties,
getAllPaths,
isValidEntity,
isNewEntity,
getStaleMetaStateIds,
convertJSFunctionsToString,
@ -1000,7 +1002,8 @@ export default class DataTreeEvaluator {
if (requiresEval) {
const evaluationSubstitutionType =
entityConfig?.reactivePaths?.[propertyPath] ||
(!isEmpty(entityConfig.reactivePaths) &&
entityConfig.reactivePaths[propertyPath]) ||
EvaluationSubstitutionType.TEMPLATE;
const contextData: EvaluateContext = {};
@ -1099,17 +1102,19 @@ export default class DataTreeEvaluator {
break;
}
case ENTITY_TYPE_VALUE.ACTION: {
const actionEntity = entity as ActionEntity;
const configProperty = propertyPath.replace(
"config",
"actionConfiguration",
);
const validationConfig =
this.allActionValidationConfig?.[entity.actionId]?.[
this.allActionValidationConfig?.[actionEntity.actionId]?.[
configProperty
];
this.validateActionProperty(
fullPropertyPath,
entity as ActionEntity,
actionEntity,
contextTree,
evalPropertyValue,
unEvalPropertyValue,
@ -1278,7 +1283,8 @@ export default class DataTreeEvaluator {
if (entity && isWidget(entity)) {
entityType = entity.type;
} else if (entity && isAction(entity)) {
entityType = entityConfig.pluginType;
const actionEntityConfig = entityConfig as ActionEntityConfig;
entityType = actionEntityConfig.pluginType;
} else if (entity && isJSAction(entity)) {
entityType = entity.ENTITY_TYPE;
}
@ -1618,23 +1624,6 @@ export default class DataTreeEvaluator {
});
}
/**
* Update the entity config set as prototype according to latest unEvalTree changes else code would consume stale configs.
*
* Example scenario: On addition of a JS binding to widget, it's dynamicBindingPathList changes and needs to be updated.
*/
updateConfigForModifiedEntity(unEvalTree: DataTree, entityName: string) {
const unEvalEntity = unEvalTree[entityName];
// skip entity if entity is not present in the evalTree or is not a valid entity
if (!this.evalTree[entityName] || !isValidEntity(this.evalTree[entityName]))
return;
const entityConfig = Object.getPrototypeOf(unEvalEntity);
const newEntityObject = Object.create(entityConfig);
this.evalTree[entityName] = Object.assign(newEntityObject, {
...this.evalTree[entityName],
});
}
updateEvalTreeWithChanges({
differences,
}: {
@ -1688,20 +1677,22 @@ export default class DataTreeEvaluator {
);
}
const parentPropertyPath = convertPathToString(path);
Object.keys(entityConfig.reactivePaths).forEach((relativePath) => {
const childPropertyPath = `${entityName}.${relativePath}`;
// Check if relative path has dynamic binding
if (
entityDynamicBindingPaths &&
entityDynamicBindingPaths.length &&
entityDynamicBindingPaths.includes(relativePath)
) {
changePaths.add(childPropertyPath);
}
if (isChildPropertyPath(parentPropertyPath, childPropertyPath)) {
changePaths.add(childPropertyPath);
}
});
if (!isEmpty(entityConfig.reactivePaths)) {
Object.keys(entityConfig.reactivePaths).forEach((relativePath) => {
const childPropertyPath = `${entityName}.${relativePath}`;
// Check if relative path has dynamic binding
if (
entityDynamicBindingPaths &&
entityDynamicBindingPaths.length &&
entityDynamicBindingPaths.includes(relativePath)
) {
changePaths.add(childPropertyPath);
}
if (isChildPropertyPath(parentPropertyPath, childPropertyPath)) {
changePaths.add(childPropertyPath);
}
});
}
}
}

View File

@ -1,11 +1,11 @@
import { PluginType, PaginationType } from "entities/Action";
import type {
DataTree,
WidgetEntity,
WidgetEntityConfig,
ActionEntityConfig,
ActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import {
EvaluationSubstitutionType,
ENTITY_TYPE_VALUE,

View File

@ -1,11 +1,11 @@
import { PluginType, PaginationType } from "entities/Action";
import type {
DataTree,
WidgetEntity,
WidgetEntityConfig,
ActionEntityConfig,
ActionEntity,
} from "@appsmith/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import {
EvaluationSubstitutionType,
ENTITY_TYPE_VALUE,

View File

@ -1,7 +1,7 @@
import DataTreeEvaluator from ".";
import { unEvalTree } from "./mockData/mockUnEvalTree";
import { configTree } from "./mockData/mockConfigTree";
import type { DataTree, ConfigTree } from "@appsmith/entities/DataTree/types";
import type { DataTree, ConfigTree } from "entities/DataTree/dataTreeTypes";
import type { DataTreeDiff } from "@appsmith/workers/Evaluation/evaluationUtils";
import {
arrayAccessorCyclicDependency,

View File

@ -1,14 +1,17 @@
import {
getEntityNameAndPropertyPath,
isJSAction,
isValidEntity,
} from "@appsmith/workers/Evaluation/evaluationUtils";
import {
EXECUTION_PARAM_REFERENCE_REGEX,
THIS_DOT_PARAMS_KEY,
} from "constants/AppsmithActionConstants/ActionConstants";
import type { ConfigTree, DataTree } from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import type DependencyMap from "entities/DependencyMap";
import type { TJSPropertiesState } from "workers/Evaluation/JSObject/jsPropertiesState";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import type { DataTreeEntityConfig } from "@appsmith/entities/DataTree/types";
export function getFixedTimeDifference(endTime: number, startTime: number) {
return (endTime - startTime).toFixed(2) + " ms";
@ -54,3 +57,15 @@ export function getAllAsyncJSFunctions(
}
return allAsyncJSFunctions;
}
export function getValidEntityType(
entity: DataTreeEntity,
entityConfig: DataTreeEntityConfig,
) {
let entityType;
if (isValidEntity(entity)) {
entityType =
(!!entityConfig && entityConfig.ENTITY_TYPE) || entity.ENTITY_TYPE;
}
return !!entityType ? entityType : "noop";
}

View File

@ -1,11 +1,10 @@
import type { ValidationConfig } from "constants/PropertyControlConstants";
import { Severity } from "entities/AppsmithConsole";
import type {
ConfigTree,
DataTree,
WidgetEntity,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { get, isObject, isUndefined, set } from "lodash";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import {

View File

@ -3,18 +3,17 @@ import {
getAllPaths,
DataTreeDiffEvent,
isWidget,
isValidEntity,
getEntityNameAndPropertyPath,
isDynamicLeaf,
} from "@appsmith/workers/Evaluation/evaluationUtils";
import type {
DataTree,
WidgetEntity,
ConfigTree,
WidgetEntityConfig,
ActionEntity,
JSActionEntity,
DataTreeEntityObject,
} from "@appsmith/entities/DataTree/types";
import type { ConfigTree, DataTree } from "entities/DataTree/dataTreeTypes";
import { getEntityId, getEvalErrorPath } from "utils/DynamicBindingUtils";
import { convertArrayToObject, extractInfoFromBindings } from "./utils";
import type DataTreeEvaluator from "workers/common/DataTreeEvaluator";
@ -32,6 +31,7 @@ import {
getEntitySetterFunctions,
} from "@appsmith/workers/Evaluation/Actions";
import { isWidgetActionOrJsObject } from "@appsmith/entities/DataTree/utils";
import { getValidEntityType } from "workers/common/DataTreeEvaluator/utils";
interface CreateDependencyMap {
dependencies: Record<string, string[]>;
@ -60,7 +60,7 @@ export function createDependencyMap(
const entity = unEvalTree[entityName];
const entityConfig = configTree[entityName];
const entityDependencies = getEntityDependencies(
entity,
entity as DataTreeEntityObject,
entityConfig,
allKeys,
);
@ -142,7 +142,7 @@ export const updateDependencyMap = ({
event === DataTreeDiffEvent.DELETE
? oldUnEvalTree[entityName]
: unEvalDataTree[entityName];
const entityType = isValidEntity(entity) ? entity.ENTITY_TYPE : "noop";
const entityType = getValidEntityType(entity, entityConfig);
if (entityType !== "noop") {
switch (event) {

View File

@ -6,11 +6,10 @@ import {
import ButtonWidget from "widgets/ButtonWidget";
import SelectWidget from "widgets/SelectWidget";
import type {
DataTree,
ConfigTree,
WidgetEntity,
DataTreeEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTree, ConfigTree } from "entities/DataTree/dataTreeTypes";
import {
unEvalTreeWidgetSelectWidgetConfig,
configTree,

View File

@ -9,11 +9,11 @@ import {
isWidget,
} from "@appsmith/workers/Evaluation/evaluationUtils";
import type { WidgetEntityConfig } from "@appsmith/entities/DataTree/types";
import type {
ConfigTree,
DataTreeEntity,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
} from "entities/DataTree/dataTreeTypes";
import {
DEDICATED_WORKER_GLOBAL_SCOPE_IDENTIFIERS,
JAVASCRIPT_KEYWORDS,

View File

@ -9,20 +9,21 @@ import type {
ActionEntityConfig,
JSActionEntity,
JSActionEntityConfig,
DataTreeEntity,
DataTreeEntityConfig,
WidgetEntity,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import { find, get, union } from "lodash";
import {
getDynamicBindings,
getEntityDynamicBindingPathList,
} from "utils/DynamicBindingUtils";
import { isWidgetActionOrJsObject } from "@appsmith/entities/DataTree/utils";
import type { DataTreeEntityObject } from "@appsmith/entities/DataTree/types";
export function getEntityDependencies(
entity: DataTreeEntity,
entity: DataTreeEntityObject,
entityConfig: DataTreeEntityConfig,
allKeys: Record<string, true>,
): Record<string, string[]> {
@ -30,13 +31,13 @@ export function getEntityDependencies(
switch (entity.ENTITY_TYPE) {
case ENTITY_TYPE_VALUE.ACTION:
return getActionDependencies(
entity,
entity as ActionEntity,
entityConfig as ActionEntityConfig,
allKeys,
);
case ENTITY_TYPE_VALUE.JSACTION:
return getJSDependencies(
entity,
entity as JSActionEntity,
entityConfig as JSActionEntityConfig,
allKeys,
);
@ -159,21 +160,21 @@ export function getEntityPathDependencies(
switch (entity.ENTITY_TYPE) {
case ENTITY_TYPE_VALUE.ACTION:
return getActionPropertyPathDependencies(
entity,
entity as ActionEntity,
entityConfig as ActionEntityConfig,
fullPropertyPath,
allKeys,
);
case ENTITY_TYPE_VALUE.JSACTION:
return getJSPropertyPathDependencies(
entity,
entity as JSActionEntity,
entityConfig as JSActionEntityConfig,
fullPropertyPath,
allKeys,
);
case ENTITY_TYPE_VALUE.WIDGET:
return getWidgetPropertyPathDependencies(
entity,
entity as WidgetEntity,
entityConfig as WidgetEntityConfig,
fullPropertyPath,
);

View File

@ -1,9 +1,9 @@
import { isWidget } from "@appsmith/workers/Evaluation/evaluationUtils";
import type {
DataTreeEntity,
DataTreeEntityConfig,
WidgetEntityConfig,
} from "@appsmith/entities/DataTree/types";
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import type { DependencyMap } from "utils/DynamicBindingUtils";
const DATA_DERIVED_PROPERTY_PLACEHOLDER = "*";