chore: Splitting entities reducer for supporting more reducers on EE (#27560)

## Description

Splitting entities reducer for supporting more reducers on EE

#### PR fixes following issue(s)
Fixes [#27559](https://github.com/appsmithorg/appsmith/issues/27559)

#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)

## Testing

#### How Has This Been Tested?
- [x] Manual
- [ ] JUnit
- [ ] Jest
- [x] Cypress

## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] 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:
Ankita Kinger 2023-09-22 18:12:20 +05:30 committed by GitHub
parent 1cb3a1178a
commit 1012c43ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 68 additions and 70 deletions

View File

@ -17,7 +17,7 @@ import {
SAAS_EDITOR_API_ID_PATH,
SAAS_EDITOR_DATASOURCE_ID_PATH,
} from "pages/Editor/SaaSEditor/constants";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { JSCollectionData } from "reducers/entityReducers/jsActionsReducer";
import type { PluginType } from "entities/Action";
import localStorage from "utils/localStorage";

View File

@ -710,10 +710,7 @@ function WorkspaceInviteUsersForm(props: any) {
</ErrorBox>
{canManage && !disableManageUsers && (
<ManageUsersContainer>
<ManageUsers
isApplicationInvite={isApplicationInvite}
workspaceId={props.workspaceId}
/>
<ManageUsers workspaceId={props.workspaceId} />
</ManageUsersContainer>
)}
</StyledForm>

View File

@ -0,0 +1,29 @@
import actionsReducer from "@appsmith/reducers/entityReducers/actionsReducer";
import appReducer from "reducers/entityReducers/appReducer";
import canvasWidgetsReducer from "reducers/entityReducers/canvasWidgetsReducer";
import canvasWidgetsStructureReducer from "reducers/entityReducers/canvasWidgetsStructureReducer";
import metaWidgetsReducer from "reducers/entityReducers/metaWidgetsReducer";
import datasourceReducer from "reducers/entityReducers/datasourceReducer";
import jsActionsReducer from "reducers/entityReducers/jsActionsReducer";
import jsExecutionsReducer from "reducers/entityReducers/jsExecutionsReducer";
import metaReducer from "reducers/entityReducers/metaReducer";
import pageListReducer from "reducers/entityReducers/pageListReducer";
import pluginsReducer from "reducers/entityReducers/pluginsReducer";
import autoHeightLayoutTreeReducer from "reducers/entityReducers/autoHeightReducers/autoHeightLayoutTreeReducer";
import canvasLevelsReducer from "reducers/entityReducers/autoHeightReducers/canvasLevelsReducer";
export const entityReducerObject = {
canvasWidgets: canvasWidgetsReducer,
canvasWidgetsStructure: canvasWidgetsStructureReducer,
metaWidgets: metaWidgetsReducer,
actions: actionsReducer,
datasources: datasourceReducer,
pageList: pageListReducer,
jsExecutions: jsExecutionsReducer,
plugins: pluginsReducer,
meta: metaReducer,
app: appReducer,
jsActions: jsActionsReducer,
autoHeightLayoutTree: autoHeightLayoutTreeReducer,
canvasLevels: canvasLevelsReducer,
};

View File

@ -1,11 +1,11 @@
import entityReducer from "reducers/entityReducers";
import entityReducer from "@appsmith/reducers/entityReducers";
import uiReducer from "reducers/uiReducers";
import evaluationsReducer from "reducers/evaluationReducers";
import { reducer as formReducer } from "redux-form";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";
import type { EditorReduxState } from "reducers/uiReducers/editorReducer";
import type { ErrorReduxState } from "reducers/uiReducers/errorReducer";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { PropertyPaneReduxState } from "reducers/uiReducers/propertyPaneReducer";
import type { TemplatesReduxState } from "reducers/uiReducers/templateReducer";
import type { DatasourceDataState } from "reducers/entityReducers/datasourceReducer";

View File

@ -2,7 +2,7 @@ import type { AppState } from "@appsmith/reducers";
import type {
ActionData,
ActionDataState,
} from "reducers/entityReducers/actionsReducer";
} from "@appsmith/reducers/entityReducers/actionsReducer";
import type { ActionResponse } from "api/ActionAPI";
import { createSelector } from "reselect";
import type {

View File

@ -20,7 +20,7 @@ import { getActionConfig } from "pages/Editor/Explorer/Actions/helpers";
import { JsFileIconV2 } from "pages/Editor/Explorer/ExplorerIcons";
import { useMemo } from "react";
import { useDispatch, useSelector } from "react-redux";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { JSCollectionData } from "reducers/entityReducers/jsActionsReducer";
import { getCurrentPageId } from "selectors/editorSelectors";
import {

View File

@ -40,7 +40,7 @@ import {
getEnvironmentConfiguration,
isEnvironmentValid,
} from "@appsmith/utils/Environments";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import { getDatatype } from "utils/AppsmithUtils";
import { getCurrentEnvironmentId } from "@appsmith/selectors/environmentSelectors";

View File

@ -0,0 +1,4 @@
export * from "ce/reducers/entityReducers/actionsReducer";
import { default as CE_actionsReducer } from "ce/reducers/entityReducers/actionsReducer";
export default CE_actionsReducer;

View File

@ -0,0 +1,7 @@
export * from "ce/reducers/entityReducers";
import { entityReducerObject as CE_entityReducerObject } from "ce/reducers/entityReducers";
import { combineReducers } from "redux";
const entityReducer = combineReducers({ ...CE_entityReducerObject });
export default entityReducer;

View File

@ -1,6 +1,6 @@
import type { DependencyMap, DynamicPath } from "utils/DynamicBindingUtils";
import { ENTITY_TYPE } from "entities/DataTree/dataTreeFactory";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import {
getBindingAndReactivePathsOfAction,
getDataTreeActionConfigPath,

View File

@ -1,4 +1,4 @@
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { WidgetProps } from "widgets/BaseWidget";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";
import type { MetaState } from "reducers/entityReducers/metaReducer";

View File

@ -12,7 +12,6 @@ import type { ApplicationPayload } from "@appsmith/constants/ReduxActionConstant
import {
APPLICATION_INVITE,
createMessage,
INVITE_USERS_PLACEHOLDER,
SHARE_APP,
} from "@appsmith/constants/messages";
import FormDialogComponent from "components/editorComponents/form/FormDialogComponent";
@ -82,7 +81,6 @@ const ShareButton = (props: ShareButtonProps) => {
hideDefaultTrigger
isOpen={showModal}
onClose={() => setShowModal(false)}
placeholder={createMessage(INVITE_USERS_PLACEHOLDER, cloudHosting)}
title={createMessage(
APPLICATION_INVITE,
currentWorkspace?.name,

View File

@ -6,7 +6,7 @@ import type { RouteComponentProps } from "react-router";
import { withRouter } from "react-router";
import styled from "styled-components";
import type { AppState } from "@appsmith/reducers";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import { CURL_IMPORT_FORM } from "@appsmith/constants/forms";
import type { BuilderRouteParams } from "constants/routes";
import type { curlImportFormValues } from "./helpers";

View File

@ -12,7 +12,7 @@ import {
getProvidersTemplatesLoadingState,
} from "@appsmith/selectors/applicationSelectors";
import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { ProviderTemplateArray } from "constants/providerConstants";
import { DEFAULT_TEMPLATE_TYPE } from "constants/providerConstants";
import type { AddApiToPageRequest } from "api/ProvidersApi";

View File

@ -10,7 +10,7 @@ import type { RouteComponentProps } from "react-router";
import type {
ActionData,
ActionDataState,
} from "reducers/entityReducers/actionsReducer";
} from "@appsmith/reducers/entityReducers/actionsReducer";
import _ from "lodash";
import { getCurrentApplication } from "@appsmith/selectors/applicationSelectors";
import AnalyticsUtil from "utils/AnalyticsUtil";

View File

@ -80,7 +80,6 @@ import {
DEPLOY_MENU_OPTION,
EDITOR_HEADER,
INVITE_TAB,
INVITE_USERS_PLACEHOLDER,
IN_APP_EMBED_SETTING,
LOCK_ENTITY_EXPLORER_MESSAGE,
LOGO_TOOLTIP,
@ -565,10 +564,6 @@ export function EditorHeader() {
<TabPanel value="invite">
<AppInviteUsersForm
applicationId={applicationId}
placeholder={createMessage(
INVITE_USERS_PLACEHOLDER,
cloudHosting,
)}
workspaceId={workspaceId}
/>
</TabPanel>

View File

@ -13,7 +13,7 @@ import type { Plugin } from "api/PluginApi";
import { useSelector } from "react-redux";
import type { AppState } from "@appsmith/reducers";
import { groupBy } from "lodash";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import { getNextEntityName } from "utils/AppsmithUtils";
import {
apiEditorIdURL,

View File

@ -12,7 +12,7 @@ import {
getActions,
getDatasources,
} from "@appsmith/selectors/entitiesSelector";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import { matchPath, useLocation } from "react-router";
import {
API_EDITOR_ID_PATH,

View File

@ -44,7 +44,7 @@ import {
SIGNPOSTING_TOOLTIP,
} from "@appsmith/constants/messages";
import type { Datasource } from "entities/Datasource";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { CanvasWidgetsReduxState } from "reducers/entityReducers/canvasWidgetsReducer";
import { SIGNPOSTING_STEP, SignpostingWalkthroughConfig } from "./Utils";
import { builderURL, integrationEditorURL } from "RouteBuilder";

View File

@ -25,7 +25,7 @@ import {
getPluginDocumentationLinks,
getDatasourceScopeValue,
} from "@appsmith/selectors/entitiesSelector";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { JSONtoFormProps } from "../DataSourceEditor/JSONtoForm";
import { JSONtoForm } from "../DataSourceEditor/JSONtoForm";
import { normalizeValues, validate } from "components/formControls/utils";

View File

@ -13,7 +13,7 @@ import type { SaaSAction } from "entities/Action";
import { createActionRequest } from "actions/pluginActionActions";
import type { Datasource } from "entities/Datasource";
import { createNewApiName } from "utils/AppsmithUtils";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
// Design
import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper";

View File

@ -1,32 +0,0 @@
import { combineReducers } from "redux";
import actionsReducer from "./actionsReducer";
import appReducer from "./appReducer";
import canvasWidgetsReducer from "./canvasWidgetsReducer";
import canvasWidgetsStructureReducer from "./canvasWidgetsStructureReducer";
import metaWidgetsReducer from "./metaWidgetsReducer";
import datasourceReducer from "./datasourceReducer";
import jsActionsReducer from "./jsActionsReducer";
import jsExecutionsReducer from "./jsExecutionsReducer";
import metaReducer from "./metaReducer";
import pageListReducer from "./pageListReducer";
import pluginsReducer from "reducers/entityReducers/pluginsReducer";
import autoHeightLayoutTreeReducer from "./autoHeightReducers/autoHeightLayoutTreeReducer";
import canvasLevelsReducer from "./autoHeightReducers/canvasLevelsReducer";
const entityReducer = combineReducers({
canvasWidgets: canvasWidgetsReducer,
canvasWidgetsStructure: canvasWidgetsStructureReducer,
metaWidgets: metaWidgetsReducer,
actions: actionsReducer,
datasources: datasourceReducer,
pageList: pageListReducer,
jsExecutions: jsExecutionsReducer,
plugins: pluginsReducer,
meta: metaReducer,
app: appReducer,
jsActions: jsActionsReducer,
autoHeightLayoutTree: autoHeightLayoutTreeReducer,
canvasLevels: canvasLevelsReducer,
});
export default entityReducer;

View File

@ -148,7 +148,7 @@ import type { TRunDescription } from "workers/Evaluation/fns/actionFns";
import { DEBUGGER_TAB_KEYS } from "components/editorComponents/Debugger/helpers";
import { FILE_SIZE_LIMIT_FOR_BLOBS } from "constants/WidgetConstants";
import { getCurrentActions } from "@appsmith/selectors/entitiesSelector";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import { handleStoreOperations } from "./StoreActionSaga";
import { fetchPage } from "actions/pageActions";
import type { Datasource } from "entities/Datasource";

View File

@ -64,7 +64,7 @@ import {
import type {
ActionData,
ActionDataState,
} from "reducers/entityReducers/actionsReducer";
} from "@appsmith/reducers/entityReducers/actionsReducer";
import {
getAction,
getActions,

View File

@ -45,7 +45,7 @@ import {
import type {
ActionData,
ActionDataState,
} from "reducers/entityReducers/actionsReducer";
} from "@appsmith/reducers/entityReducers/actionsReducer";
import {
createActionRequest,
setActionProperty,

View File

@ -64,7 +64,7 @@ import {
} from "@appsmith/actions/applicationActions";
import { setPreviewModeAction } from "actions/editorActions";
import type { FlattenedWidgetProps } from "WidgetProvider/constants";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import { batchUpdateMultipleWidgetProperties } from "actions/controlActions";
import {
setExplorerActiveAction,

View File

@ -23,7 +23,7 @@ import {
getPulginActionDefaultValues,
} from "./ActionSagas";
import "../WidgetQueryGenerators";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import "WidgetQueryGenerators";
import { getWidgetByID } from "./selectors";
import type {

View File

@ -38,7 +38,7 @@ import type {
FormDependencyConfigs,
FormDatasourceButtonConfigs,
} from "utils/DynamicBindingUtils";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
function* fetchPluginsSaga(
action: ReduxAction<{ workspaceId?: string } | undefined>,

View File

@ -2,7 +2,7 @@ import { all, call, put, select, takeLeading } from "redux-saga/effects";
import type { ReduxAction } from "@appsmith/constants/ReduxActionConstants";
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import { snipingModeBindToSelector } from "selectors/editorSelectors";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import { getCanvasWidgets } from "@appsmith/selectors/entitiesSelector";
import {
batchUpdateWidgetDynamicProperty,

View File

@ -9,7 +9,7 @@ import { getActions } from "@appsmith/selectors/entitiesSelector";
import type {
ActionData,
ActionDataState,
} from "reducers/entityReducers/actionsReducer";
} from "@appsmith/reducers/entityReducers/actionsReducer";
import type { ReduxAction } from "@appsmith/constants/ReduxActionConstants";
import {
ReduxActionErrorTypes,

View File

@ -9,7 +9,7 @@ import type { WidgetProps } from "widgets/BaseWidget";
import _, { defaults, omit } from "lodash";
import type { WidgetType } from "constants/WidgetConstants";
import { WIDGET_PROPS_TO_SKIP_FROM_EVAL } from "constants/WidgetConstants";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { Page } from "@appsmith/constants/ReduxActionConstants";
import { getActions, getPlugins } from "@appsmith/selectors/entitiesSelector";
import type { Plugin } from "api/PluginApi";

View File

@ -1,6 +1,6 @@
import { getFormValues, isValid, getFormInitialValues } from "redux-form";
import type { AppState } from "@appsmith/reducers";
import type { ActionData } from "reducers/entityReducers/actionsReducer";
import type { ActionData } from "@appsmith/reducers/entityReducers/actionsReducer";
import type {
DynamicValues,
FormEvalOutput,

View File

@ -8,7 +8,7 @@ import { AppIconCollection } from "design-system-old";
import _, { isPlainObject } from "lodash";
import * as log from "loglevel";
import { osName } from "react-device-detect";
import type { ActionDataState } from "reducers/entityReducers/actionsReducer";
import type { ActionDataState } from "@appsmith/reducers/entityReducers/actionsReducer";
import type { JSCollectionData } from "reducers/entityReducers/jsActionsReducer";
import AnalyticsUtil from "./AnalyticsUtil";