Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b15c7a7
feat: add page unload action execution support
rahulbarwal Jun 25, 2025
8b9744e
feat: add selector for page unload actions
rahulbarwal Jun 25, 2025
cad5d05
refactor: simplify executePageUnloadActions by removing unused parameter
rahulbarwal Jun 25, 2025
94bdbad
feat: add navigation action to support page transitions
rahulbarwal Jun 25, 2025
7e52be7
refactor: update MenuItem component to use styled div and handle navi…
rahulbarwal Jun 25, 2025
7ea82a5
feat: implement PluginActionSaga for executing plugin actions
rahulbarwal Jun 25, 2025
5ef3f42
refactor: clean up PluginActionSaga by removing unused functions and …
rahulbarwal Jun 25, 2025
3f9caea
feat: add support for page unload actions execution
rahulbarwal Jun 25, 2025
f5da5ea
refactor: simplify active page detection in MenuItem component
rahulbarwal Jun 25, 2025
eebd52b
test: add unit tests for MenuItem component
rahulbarwal Jun 26, 2025
54597c8
test: add unit tests for NavigateActionSaga
rahulbarwal Jun 26, 2025
943dd4a
test: add unit tests for executePageUnloadActionsSaga
rahulbarwal Jun 26, 2025
9da78dc
refactor: remove MenuItem component and its associated tests
rahulbarwal Jun 26, 2025
3f7204d
feat: implement NavigateActionSaga for page navigation
rahulbarwal Jun 26, 2025
c06bc97
refactor: move TriggerMeta interface to a separate types file
rahulbarwal Jun 26, 2025
0925504
Updates imports
rahulbarwal Jun 26, 2025
3e66087
refactor: update SourceEntity imports to new types file
rahulbarwal Jun 26, 2025
233dbc5
chore: add circular dependencies documentation and refactor TriggerMe…
rahulbarwal Jun 26, 2025
fd4024f
refactor: enhance MoreDropdownButton component structure and navigati…
rahulbarwal Jun 27, 2025
b35abf1
refactor: enhance pushToHistory function and navigation handling in N…
rahulbarwal Jun 27, 2025
277d324
fix: update XPath selector for active page retrieval in AppSettings
rahulbarwal Jun 27, 2025
082f414
test: enhance NavigateActionSaga tests for improved navigation handling
rahulbarwal Jun 27, 2025
d3e4e43
test: enhance MenuItem tests with useNavigateToAnotherPage mock
rahulbarwal Jun 27, 2025
69ec3cc
removes unnecessary files
rahulbarwal Jul 1, 2025
fce2595
Revert "chore: add circular dependencies documentation and refactor T…
rahulbarwal Jul 2, 2025
a95e07b
Revert "refactor: update SourceEntity imports to new types file"
rahulbarwal Jul 2, 2025
2a68fbb
Revert "refactor: move TriggerMeta interface to a separate types file"
rahulbarwal Jul 2, 2025
2192adb
feat: implement PluginActionSaga to handle plugin action execution
rahulbarwal Jul 2, 2025
f09e3c4
Merge pull request #41071 from appsmithorg/rahulbarwal/test1
rahulbarwal Jul 2, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class AppSettings {
".t--app-viewer-navigation-top-inline-more-dropdown-item",
_scrollArrows: ".scroll-arrows",
_getActivePage: (pageName: string) =>
`//span[contains(text(),"${pageName}")]//ancestor::a[contains(@class,'is-active')]`,
`//span[contains(text(),"${pageName}")]//ancestor::div[contains(@class,'is-active')]`,
_importBtn: "[data-testid='t--app-setting-import-btn']",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
PREPARED_STATEMENT_WARNING,
} from "ee/constants/messages";
import { ENTITY_TYPE } from "ee/entities/AppsmithConsole/utils";
import type { SourceEntity } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";

import BindDataButton from "../BindDataButton";
import { NoResponse } from "../NoResponse";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Tooltip } from "@appsmith/ads";
import LOG_TYPE from "entities/AppsmithConsole/logtype";
import { type Action } from "entities/Action";
import type { ActionResponse } from "api/ActionAPI";
import type { SourceEntity } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";

import { getErrorMessageFromActionResponse } from "../../utils";
import { REACT_JSON_PROPS } from "../../constants";
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/actions/debuggerActions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import type { Log, Message, SourceEntity } from "entities/AppsmithConsole";
import type { Log, Message } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";
import type { ENTITY_TYPE } from "ee/entities/AppsmithConsole/utils";
import type {
CanvasDebuggerState,
Expand Down
8 changes: 8 additions & 0 deletions app/client/src/actions/pageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type { PACKAGE_PULL_STATUS } from "ee/constants/ModuleConstants";
import type { ApiResponse } from "api/ApiResponses";
import type { EvaluationReduxAction } from "./EvaluationReduxActionTypes";
import { appsmithTelemetry } from "instrumentation";
import type { NavigateToAnotherPagePayload } from "sagas/ActionExecution/NavigateActionSaga/types";

export interface FetchPageListPayload {
applicationId: string;
Expand Down Expand Up @@ -696,3 +697,10 @@ export const setupPublishedPage = (
pageWithMigratedDsl,
},
});

export const navigateToAnotherPage = (
payload: NavigateToAnotherPagePayload,
) => ({
type: ReduxActionTypes.NAVIGATE_TO_ANOTHER_PAGE,
payload,
});
4 changes: 4 additions & 0 deletions app/client/src/ce/constants/ReduxActionConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ const PageActionTypes = {
RESET_PAGE_LIST: "RESET_PAGE_LIST",
SET_ONLOAD_ACTION_EXECUTED: "SET_ONLOAD_ACTION_EXECUTED",
EXECUTE_REACTIVE_QUERIES: "EXECUTE_REACTIVE_QUERIES",
NAVIGATE_TO_ANOTHER_PAGE: "NAVIGATE_TO_ANOTHER_PAGE",
};

const PageActionErrorTypes = {
Expand Down Expand Up @@ -731,6 +732,9 @@ const ActionExecutionTypes = {
CANCEL_ACTION_MODAL: "CANCEL_ACTION_MODAL",
CONFIRM_ACTION_MODAL: "CONFIRM_ACTION_MODAL",
EXECUTE_PAGE_LOAD_ACTIONS: "EXECUTE_PAGE_LOAD_ACTIONS",
EXECUTE_PAGE_UNLOAD_ACTIONS: "EXECUTE_PAGE_UNLOAD_ACTIONS",
EXECUTE_PAGE_UNLOAD_ACTIONS_SUCCESS: "EXECUTE_PAGE_UNLOAD_ACTIONS_SUCCESS",
EXECUTE_PAGE_UNLOAD_ACTIONS_ERROR: "EXECUTE_PAGE_UNLOAD_ACTIONS_ERROR",
EXECUTE_PLUGIN_ACTION_REQUEST: "EXECUTE_PLUGIN_ACTION_REQUEST",
EXECUTE_PLUGIN_ACTION_SUCCESS: "EXECUTE_PLUGIN_ACTION_SUCCESS",
SET_ACTION_RESPONSE_DISPLAY_FORMAT: "SET_ACTION_RESPONSE_DISPLAY_FORMAT",
Expand Down
4 changes: 2 additions & 2 deletions app/client/src/ce/entities/AppsmithConsole/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { DataTreeEntity } from "entities/DataTree/dataTreeTypes";
import type { DataTreeEntityConfig } from "../DataTree/types";
import type { TriggerMeta } from "ee/sagas/ActionExecution/ActionExecutionSagas";
import type { SourceEntity } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";
import type { TriggerMeta } from "ee/sagas/ActionExecution/types";

export enum ENTITY_TYPE {
ACTION = "ACTION",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import type {
EventType,
ExecuteTriggerPayload,
TriggerSource,
} from "constants/AppsmithActionConstants/ActionConstants";
import { TriggerKind } from "constants/AppsmithActionConstants/ActionConstants";
import log from "loglevel";
Expand Down Expand Up @@ -46,13 +45,7 @@ import type { DefaultRootState } from "react-redux";
import { getAction } from "ee/selectors/entitiesSelector";
import { getSourceFromTriggerMeta } from "ee/entities/AppsmithConsole/utils";
import { globalFunctionLogoutUser } from "../userSagas";

export interface TriggerMeta {
source?: TriggerSource;
triggerPropertyName?: string;
triggerKind?: TriggerKind;
onPageLoad: boolean;
}
import type { TriggerMeta } from "./types";

/**
* The controller saga that routes different trigger effects to its executor sagas
Expand Down
11 changes: 11 additions & 0 deletions app/client/src/ce/sagas/ActionExecution/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {
TriggerKind,
TriggerSource,
} from "constants/AppsmithActionConstants/ActionConstants";

export interface TriggerMeta {
source?: TriggerSource;
triggerPropertyName?: string;
triggerKind?: TriggerKind;
onPageLoad: boolean;
}
2 changes: 1 addition & 1 deletion app/client/src/ce/sagas/analyticsSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getInstanceId } from "ee/selectors/organizationSelectors";
import { call, select } from "redux-saga/effects";
import type { APP_MODE } from "entities/App";
import { getCurrentPageId } from "selectors/editorSelectors";
import type { TriggerMeta } from "ee/sagas/ActionExecution/ActionExecutionSagas";
import type { TriggerMeta } from "ee/sagas/ActionExecution/types";
import { TriggerKind } from "constants/AppsmithActionConstants/ActionConstants";
import { isArray } from "lodash";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from "react";
import { Classes as BPClasses } from "@blueprintjs/core";
import type { Dispatch } from "redux";
import { useDispatch } from "react-redux";
import type { Message, SourceEntity } from "entities/AppsmithConsole";
import type { Message } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";
import { PropertyEvaluationErrorType } from "utils/DynamicBindingUtils";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { getAppsmithConfigs } from "ee/configs";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import type { Message, SourceEntity } from "entities/AppsmithConsole";
import type { Message } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";
import type LOG_TYPE from "entities/AppsmithConsole/logtype";
import type { Plugin } from "entities/Plugin";
import { Link } from "@appsmith/ads";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { useDispatch } from "react-redux";
import type { Log, Message, SourceEntity } from "entities/AppsmithConsole";
import type { Log, Message } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";
import { LOG_CATEGORY, Severity } from "entities/AppsmithConsole";
import styled from "styled-components";
import { Classes, getTypographyByKey } from "@appsmith/ads-old";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { PluginErrorDetails } from "api/ActionAPI";
import { Button } from "@appsmith/ads";
import type { SourceEntity } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";
import type LOG_TYPE from "entities/AppsmithConsole/logtype";
import React, { useCallback, useMemo } from "react";
import styled from "styled-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react";
import { Collapse } from "@blueprintjs/core";
import { isString } from "lodash";
import type { Message, SourceEntity } from "entities/AppsmithConsole";
import type { Message } from "entities/AppsmithConsole";
import type { SourceEntity } from "entities/AppsmithConsole/types";
import { LOG_CATEGORY, Severity } from "entities/AppsmithConsole";
import type { PropsWithChildren } from "react";
import ReactJson from "react-json-view";
Expand Down
1 change: 1 addition & 0 deletions app/client/src/ee/sagas/ActionExecution/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "ce/sagas/ActionExecution/types";
1 change: 1 addition & 0 deletions app/client/src/entities/Action/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export enum ActionExecutionContext {
PAGE_LOAD = "PAGE_LOAD",
EVALUATION_ACTION_TRIGGER = "EVALUATION_ACTION_TRIGGER",
REFRESH_ACTIONS_ON_ENV_CHANGE = "REFRESH_ACTIONS_ON_ENV_CHANGE",
PAGE_UNLOAD = "PAGE_UNLOAD",
}

export interface KeyValuePair {
Expand Down
24 changes: 3 additions & 21 deletions app/client/src/entities/AppsmithConsole/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import type { ReduxAction } from "actions/ReduxActionTypes";
import type LOG_TYPE from "./logtype";
import type { PLATFORM_ERROR } from "ee/entities/AppsmithConsole/utils";
import type { PropertyEvaluationErrorType } from "utils/DynamicBindingUtils";
import type { PluginType } from "entities/Plugin";
import type { HTTP_METHOD } from "PluginActionEditor/constants/CommonApiConstants";
import type {
ENTITY_TYPE,
PLATFORM_ERROR,
} from "ee/entities/AppsmithConsole/utils";
import type LOG_TYPE from "./logtype";
import type { SourceEntity } from "./types";

export type Methods =
| "log"
Expand Down Expand Up @@ -57,20 +53,6 @@ export interface UserAction {
reduxAction: ReduxAction<unknown>;
}

export interface SourceEntity {
type: ENTITY_TYPE;
// Widget or action name
name: string;
// Id of the widget or action
id: string;
// property path of the child
propertyPath?: string;
// plugin type of the action or type of widget
pluginType?: PluginType | string;
// http method of the api. (Only for api actions)
httpMethod?: HTTP_METHOD;
}

export enum LOG_CATEGORY {
USER_GENERATED = "USER_GENERATED",
PLATFORM_GENERATED = "PLATFORM_GENERATED",
Expand Down
17 changes: 17 additions & 0 deletions app/client/src/entities/AppsmithConsole/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { ENTITY_TYPE } from "ee/entities/AppsmithConsole/utils";
import type { PluginType } from "entities/Plugin";
import type { HTTP_METHOD } from "PluginActionEditor/constants/CommonApiConstants";

export interface SourceEntity {
type: ENTITY_TYPE;
// Widget or action name
name: string;
// Id of the widget or action
id: string;
// property path of the child
propertyPath?: string;
// plugin type of the action or type of widget
pluginType?: PluginType | string;
// http method of the api. (Only for api actions)
httpMethod?: HTTP_METHOD;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import {
getMenuItemBackgroundColorWhenActive,
getMenuItemTextColor,
} from "pages/AppViewer/utils";
import { NavLink } from "react-router-dom";
import styled from "styled-components";

export const StyledMenuItem = styled(NavLink)<{
export const StyledMenuItem = styled.div<{
borderRadius: string;
primaryColor: string;
navColorStyle: NavigationSetting["colorStyle"];
Expand Down
Loading
Loading