feat: adding current env name to the appsmith context (#38894)

This commit is contained in:
Aman Agarwal 2025-02-03 13:48:28 +05:30 committed by GitHub
parent 4c278803cd
commit 9bd1a40513
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 1 deletions

View File

@ -193,6 +193,7 @@ export interface AppsmithEntity extends Omit<AppDataState, "store"> {
currentPageName: string;
workspaceName: string;
appName: string;
currentEnvironmentName: string;
}
export interface DataTreeSeed {

View File

@ -0,0 +1 @@
export const getCurrentEnvironmentName = () => "";

View File

@ -0,0 +1 @@
export * from "ce/selectors/dataTreeCyclicSelectors";

View File

@ -44,6 +44,8 @@ import {
import { getCurrentApplication } from "ee/selectors/applicationSelectors";
import { getCurrentAppWorkspace } from "ee/selectors/selectedWorkspaceSelectors";
import type { PageListReduxState } from "reducers/entityReducers/pageListReducer";
import { getCurrentEnvironmentName } from "ee/selectors/dataTreeCyclicSelectors";
import { objectKeys } from "@appsmith/utils";
export const getLoadingEntities = (state: AppState) =>
state.evaluations.loadingEntities;
@ -152,6 +154,7 @@ export const getUnevaluatedDataTree = createSelector(
getCurrentAppWorkspace,
getCurrentApplication,
getCurrentPageName,
getCurrentEnvironmentName,
(
actions,
jsActions,
@ -162,6 +165,7 @@ export const getUnevaluatedDataTree = createSelector(
currentWorkspace,
currentApplication,
getCurrentPageName,
currentEnvironmentName,
) => {
let dataTree: UnEvalTree = {
...actions.dataTree,
@ -183,6 +187,7 @@ export const getUnevaluatedDataTree = createSelector(
currentPageName: getCurrentPageName,
workspaceName: currentWorkspace.name,
appName: currentApplication?.name,
currentEnvironmentName,
} as AppsmithEntity;
(dataTree.appsmith as AppsmithEntity).ENTITY_TYPE = ENTITY_TYPE.APPSMITH;
dataTree = { ...dataTree, ...metaWidgets.dataTree };
@ -225,7 +230,7 @@ export const getWidgetEvalValues = createSelector(
export const getDataTreeForAutocomplete = createSelector(
getDataTree,
(tree: DataTree) => {
return _.omit(tree, Object.keys(DATATREE_INTERNAL_KEYWORDS));
return _.omit(tree, objectKeys(DATATREE_INTERNAL_KEYWORDS));
},
);