Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: [Plugin Action Editor] Combine Plugin Editor UI state #36651

Merged
merged 21 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove query pane reducer
  • Loading branch information
hetunandu committed Oct 2, 2024
commit ce4ba255c5adfa7ebac07f86389b43f19fd22f27
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ import { renderHook } from "@testing-library/react-hooks/dom";
import { useDispatch } from "react-redux";
import { PluginType } from "entities/Action";
import { usePluginActionContext } from "../../../PluginActionContext";
import { changeApi } from "../../../store";
import { changeQuery } from "actions/queryPaneActions";
import { changeApi, changeQuery } from "../../../store";
ankitakinger marked this conversation as resolved.
Show resolved Hide resolved
import usePrevious from "utils/hooks/usePrevious";
import { useChangeActionCall } from "./useChangeActionCall";

jest.mock("react-redux", () => ({
useDispatch: jest.fn(),
}));

jest.mock("actions/apiPaneActions", () => ({
jest.mock("../../../store", () => ({
changeApi: jest.fn(),
}));

jest.mock("actions/queryPaneActions", () => ({
changeQuery: jest.fn(),
}));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useEffect } from "react";
import { useDispatch } from "react-redux";
import { changeQuery } from "actions/queryPaneActions";
import { PluginType } from "entities/Action";
import { usePluginActionContext } from "PluginActionEditor";
import { changeApi } from "PluginActionEditor/store";
import { changeApi, changeQuery } from "PluginActionEditor/store";
import usePrevious from "utils/hooks/usePrevious";

export const useChangeActionCall = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
type ReduxAction,
ReduxActionTypes,
} from "ee/constants/ReduxActionConstants";
import type { Action } from "entities/Action";

export const setPluginActionEditorDebuggerState = (
payload: Partial<PluginEditorDebuggerState>,
Expand All @@ -11,7 +12,7 @@ export const setPluginActionEditorDebuggerState = (
payload,
});

export const setPluginActionEditorSelectedTab = (payload: number) => ({
export const setPluginActionEditorSelectedTab = (payload: number | string) => ({
type: ReduxActionTypes.SET_PLUGIN_ACTION_EDITOR_FORM_SELECTED_TAB,
payload,
});
Expand All @@ -34,3 +35,21 @@ export const changeApi = (
payload: { id, isSaas, newApi },
};
};

export interface ChangeQueryPayload {
baseQueryId: string;
packageId?: string;
applicationId?: string;
basePageId?: string;
moduleId?: string;
workflowId?: string;
newQuery?: boolean;
action?: Action;
}

export const changeQuery = (payload: ChangeQueryPayload) => {
return {
type: ReduxActionTypes.QUERY_PANE_CHANGE,
payload,
};
};
38 changes: 0 additions & 38 deletions app/client/src/actions/queryPaneActions.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/client/src/ce/navigation/FocusElements/AppIDE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {
getPropertyPaneWidth,
getSelectedPropertyPanel,
} from "selectors/propertyPaneSelectors";
import { getLastQueryTab } from "selectors/queryPaneSelectors";
import { getLastQueryTab } from "ee/selectors/appIDESelectors";
import { getDebuggerContext } from "selectors/debuggerSelectors";
import { setDebuggerContext } from "actions/debuggerActions";
import { DefaultDebuggerContext } from "reducers/uiReducers/debuggerReducer";
Expand Down
2 changes: 0 additions & 2 deletions app/client/src/ce/reducers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type { AppViewReduxState } from "reducers/uiReducers/appViewReducer";
import type { DatasourcePaneReduxState } from "reducers/uiReducers/datasourcePaneReducer";
import type { ApplicationsReduxState } from "ee/reducers/uiReducers/applicationsReducer";
import type { PageListReduxState } from "reducers/entityReducers/pageListReducer";
import type { QueryPaneReduxState } from "ee/reducers/uiReducers/queryPaneReducer";
import type { PluginDataState } from "reducers/entityReducers/pluginsReducer";
import type { AuthState } from "reducers/uiReducers/authReducer";
import type { WorkspaceReduxState } from "ee/reducers/uiReducers/workspaceReducer";
Expand Down Expand Up @@ -110,7 +109,6 @@ export interface AppState {
users: UsersReduxState;
widgetDragResize: WidgetDragResizeState;
imports: ImportReduxState;
queryPane: QueryPaneReduxState;
datasourcePane: DatasourcePaneReduxState;
help: HelpReduxState;
apiName: ApiNameReduxState;
Expand Down
2 changes: 0 additions & 2 deletions app/client/src/ce/reducers/uiReducers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import buildingBlockReducer from "reducers/uiReducers/buildingBlockReducer";
import usersReducer from "reducers/uiReducers/usersReducer";
import { widgetDraggingReducer } from "reducers/uiReducers/dragResizeReducer";
import importReducer from "reducers/uiReducers/importReducer";
import queryPaneReducer from "ee/reducers/uiReducers/queryPaneReducer";
import helpReducer from "reducers/uiReducers/helpReducer";
import apiNameReducer from "ee/reducers/uiReducers/apiNameReducer";
import explorerReducer from "ee/reducers/uiReducers/explorerReducer";
Expand Down Expand Up @@ -67,7 +66,6 @@ export const uiReducerObject = {
users: usersReducer,
widgetDragResize: widgetDraggingReducer,
imports: importReducer,
queryPane: queryPaneReducer,
datasourcePane: datasourcePaneReducer,
datasourceName: datasourceNameReducer,
help: helpReducer,
Expand Down
231 changes: 0 additions & 231 deletions app/client/src/ce/reducers/uiReducers/queryPaneReducer.ts

This file was deleted.

Loading
Loading