diff --git a/app/client/src/ce/api/ApplicationApi.tsx b/app/client/src/ce/api/ApplicationApi.tsx index 2ffa8cc883fb..29f9a3666ffb 100644 --- a/app/client/src/ce/api/ApplicationApi.tsx +++ b/app/client/src/ce/api/ApplicationApi.tsx @@ -14,8 +14,7 @@ import type { LayoutSystemTypes, } from "layoutSystems/types"; import type { BaseAction } from "entities/Action"; - -export type EvaluationVersion = number; +import type { EvaluationVersion } from "constants/EvalConstants"; export interface PublishApplicationRequest { applicationId: string; diff --git a/app/client/src/ce/constants/ReduxActionConstants.tsx b/app/client/src/ce/constants/ReduxActionConstants.tsx index 8d49cfbc7b36..03c4b2a50f84 100644 --- a/app/client/src/ce/constants/ReduxActionConstants.tsx +++ b/app/client/src/ce/constants/ReduxActionConstants.tsx @@ -3,7 +3,6 @@ import type { Workspace } from "@appsmith/constants/workspaceConstants"; import type { AppEmbedSetting, ApplicationPagePayload, - EvaluationVersion, GitApplicationMetadata, } from "@appsmith/api/ApplicationApi"; import type { ApplicationVersion } from "@appsmith/actions/applicationActions"; @@ -17,6 +16,7 @@ import type { AppLayoutConfig } from "reducers/entityReducers/pageListReducer"; import type { DSLWidget } from "WidgetProvider/constants"; import type { LayoutSystemTypeConfig } from "layoutSystems/types"; import type { AffectedJSObjects } from "sagas/EvaluationsSagaUtils"; +import type { EvaluationVersion } from "constants/EvalConstants"; export const ReduxSagaChannels = { WEBSOCKET_APP_LEVEL_WRITE_CHANNEL: "WEBSOCKET_APP_LEVEL_WRITE_CHANNEL", diff --git a/app/client/src/ce/constants/WorkflowConstants.ts b/app/client/src/ce/constants/WorkflowConstants.ts index 9dd2947cd151..753854d23a7e 100644 --- a/app/client/src/ce/constants/WorkflowConstants.ts +++ b/app/client/src/ce/constants/WorkflowConstants.ts @@ -1,3 +1,5 @@ +import type { EvaluationVersion } from "constants/EvalConstants"; + type ID = string; // Type for the workflow object. @@ -14,6 +16,9 @@ export interface Workflow { slug: string; // Slug of the workflow (Not in use currently). mainJsObjectId: string; // ID of the main JS object. tokenGenerated: boolean; + // Evaluation version of the application. Used to ensure the escape characters are properly evaluated. + // PR for reference: https://github.com/appsmithorg/appsmith/pull/8796 + evaluationVersion: EvaluationVersion; token?: string; } diff --git a/app/client/src/ce/selectors/applicationSelectors.tsx b/app/client/src/ce/selectors/applicationSelectors.tsx index 9c7fc0326675..a89b2f8c18d5 100644 --- a/app/client/src/ce/selectors/applicationSelectors.tsx +++ b/app/client/src/ce/selectors/applicationSelectors.tsx @@ -15,6 +15,7 @@ import { type ThemeSetting, defaultThemeSetting, } from "constants/AppConstants"; +import { DEFAULT_EVALUATION_VERSION } from "constants/EvalConstants"; const fuzzySearchOptions = { keys: ["applications.name", "workspace.name", "packages.name"], @@ -178,8 +179,6 @@ export const getIsDeletingNavigationLogo = (state: AppState) => { return state.ui.applications.isDeletingNavigationLogo; }; -const DEFAULT_EVALUATION_VERSION = 2; - export const selectEvaluationVersion = (state: AppState) => state.ui.applications.currentApplication?.evaluationVersion || DEFAULT_EVALUATION_VERSION; diff --git a/app/client/src/ce/workers/Evaluation/Actions.ts b/app/client/src/ce/workers/Evaluation/Actions.ts index 429bc551cc98..8a9658b9c53f 100644 --- a/app/client/src/ce/workers/Evaluation/Actions.ts +++ b/app/client/src/ce/workers/Evaluation/Actions.ts @@ -8,7 +8,7 @@ import type { DataTreeEntity, } from "entities/DataTree/dataTreeTypes"; import type { EvalContext } from "workers/Evaluation/evaluate"; -import type { EvaluationVersion } from "@appsmith/api/ApplicationApi"; +import type { EvaluationVersion } from "constants/EvalConstants"; import { addFn } from "workers/Evaluation/fns/utils/fnGuard"; import { getEntityFunctions, diff --git a/app/client/src/constants/EvalConstants.ts b/app/client/src/constants/EvalConstants.ts new file mode 100644 index 000000000000..0a90343bcd69 --- /dev/null +++ b/app/client/src/constants/EvalConstants.ts @@ -0,0 +1,2 @@ +export type EvaluationVersion = number; +export const DEFAULT_EVALUATION_VERSION: EvaluationVersion = 2; diff --git a/app/client/src/ee/configs/index.ts b/app/client/src/ee/configs/index.ts index b9e9e7b43cd8..562285dc2377 100644 --- a/app/client/src/ee/configs/index.ts +++ b/app/client/src/ee/configs/index.ts @@ -1,5 +1,5 @@ export * from "ce/configs/index"; -import type { EvaluationVersion } from "@appsmith/api/ApplicationApi"; +import type { EvaluationVersion } from "constants/EvalConstants"; import type { INJECTED_CONFIGS } from "ce/configs/index"; declare global { diff --git a/app/client/src/sagas/EvaluationsSaga.ts b/app/client/src/sagas/EvaluationsSaga.ts index 6e85d1145662..a81d24267fa6 100644 --- a/app/client/src/sagas/EvaluationsSaga.ts +++ b/app/client/src/sagas/EvaluationsSaga.ts @@ -70,7 +70,7 @@ import { } from "constants/AppsmithActionConstants/ActionConstants"; import { validate } from "workers/Evaluation/validations"; import { REPLAY_DELAY } from "entities/Replay/replayUtils"; -import type { EvaluationVersion } from "@appsmith/api/ApplicationApi"; +import type { EvaluationVersion } from "constants/EvalConstants"; import type { LogObject } from "entities/AppsmithConsole"; import { ENTITY_TYPE } from "@appsmith/entities/AppsmithConsole/utils";