PromucFlow_constructor/app/client/src/sagas/ActionExecution/NavigateActionSaga/index.ts

141 lines
4.2 KiB
TypeScript
Raw Normal View History

feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
import type { ReduxAction } from "actions/ReduxActionTypes";
chore: Cleanup Redux Actions file (#35720) ## Description Cleans out and reorganises the Redux Actions Constants file Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10489649733> > Commit: 9fa7003f7c2d1b43a6c693cb1d34ba5cc2c11832 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10489649733&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 21 Aug 2024 13:45:56 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new interfaces for enhanced structured data handling related to page management and property pane visibility. - Added functionality to control widget panel visibility with a new action. - **Bug Fixes** - Improved flexibility in closing property panes by adding an optional parameter to the related function. - **Refactor** - Streamlined import statements for various types to improve organization and maintainability. - Removed unused functions and action handlers to simplify user and data source management. - Updated action type constants for consistency across the application. - Removed sagas related to URL redirection and history management, simplifying navigation handling. - **Chores** - Cleaned up unused imports to reduce code clutter and improve readability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-08-22 04:19:30 +00:00
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import { getQueryStringfromObject } from "ee/entities/URLRedirect/URLAssembly";
feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
import { builderURL, viewerURL } from "ee/RouteBuilder";
import { setDataUrl } from "ee/sagas/PageSagas";
feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
import { getAppMode } from "ee/selectors/applicationSelectors";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { APP_MODE } from "entities/App";
import type { SourceEntity } from "entities/AppsmithConsole";
import type { Page } from "entities/Page";
import _ from "lodash";
import { call, put, select, take } from "redux-saga/effects";
import { getCurrentPageId, getPageList } from "selectors/editorSelectors";
import AppsmithConsole from "utils/AppsmithConsole";
feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
import history, { type AppsmithLocationState } from "utils/history";
fix: fixed URL validation to not restrict navigateTo URLs to limited protocols (#27399) ## Description Currently, we check to see if the URL that is passed to the `navigateTo` method starts with http(s), mailTo or tel. This limits the capability to load/navigate to other URLs that do not conform to these protocols. This PR remove this crude protocol check and only checks to see if the navigateTo argument is a valid URL. > > Links to Notion, Figma or any other documents that might be relevant to the PR > > #### PR fixes following issue(s) Fixes #4878 > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) > > > ## Testing > #### How Has This Been Tested? - [x] Manual > > #### Test Plan 1. Verify NavigateTo() for https:// mailTo ftp urls 2. Verify NavigateTo for above protocol from jsobject and from Action selector 3. Verify NavigateTo for same and NewWindow with above URLs #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] 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
2023-09-21 01:32:37 +00:00
import { isValidURL, matchesURLPattern } from "utils/URLUtils";
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com> ## Description This PR upgrades Prettier to v2 + enforces TypeScript’s [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax where applicable. It’s submitted as a separate PR so we can merge it easily. As a part of this PR, we reformat the codebase heavily: - add `import type` everywhere where it’s required, and - re-format the code to account for Prettier 2’s breaking changes: https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes This PR is submitted against `release` to make sure all new code by team members will adhere to new formatting standards, and we’ll have fewer conflicts when merging `bundle-optimizations` into `release`. (I’ll merge `release` back into `bundle-optimizations` once this PR is merged.) ### Why is this needed? This PR is needed because, for the Lodash optimization from https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3, we need to use `import type`. Otherwise, `babel-plugin-lodash` complains that `LoDashStatic` is not a lodash function. However, just using `import type` in the current codebase will give you this: <img width="962" alt="Screenshot 2023-03-08 at 17 45 59" src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png"> That’s because Prettier 1 can’t parse `import type` at all. To parse it, we need to upgrade to Prettier 2. ### Why enforce `import type`? Apart from just enabling `import type` support, this PR enforces specifying `import type` everywhere it’s needed. (Developers will get immediate TypeScript and ESLint errors when they forget to do so.) I’m doing this because I believe `import type` improves DX and makes refactorings easier. Let’s say you had a few imports like below. Can you tell which of these imports will increase the bundle size? (Tip: it’s not all of them!) ```ts // app/client/src/workers/Linting/utils.ts import { Position } from "codemirror"; import { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` It’s pretty hard, right? What about now? ```ts // app/client/src/workers/Linting/utils.ts import type { Position } from "codemirror"; import type { LintError as JSHintError, LintOptions } from "jshint"; import { get, isEmpty, isNumber, keys, last, set } from "lodash"; ``` Now, it’s clear that only `lodash` will be bundled. This helps developers to see which imports are problematic, but it _also_ helps with refactorings. Now, if you want to see where `codemirror` is bundled, you can just grep for `import \{.*\} from "codemirror"` – and you won’t get any type-only imports. This also helps (some) bundlers. Upon transpiling, TypeScript erases type-only imports completely. In some environment (not ours), this makes the bundle smaller, as the bundler doesn’t need to bundle type-only imports anymore. ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? This was tested to not break the build. ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] 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 - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
import type { TNavigateToDescription } from "workers/Evaluation/fns/navigateTo";
import { NavigationTargetType } from "workers/Evaluation/fns/navigateTo";
feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
import { TriggerFailureError } from "../errorUtils";
import type { NavigateToAnotherPagePayload } from "./types";
import type { LocationDescriptor, Path } from "history";
feat: Change navigate to UI (#14856) * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Fix types and imports * Update the tests * Add ref back to the code Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-16 04:30:16 +00:00
const isValidPageName = (
pageNameOrUrl: string,
pageList: Page[],
): Page | undefined => {
return _.find(pageList, (page: Page) => page.pageName === pageNameOrUrl);
};
export default function* navigateActionSaga(
action: TNavigateToDescription,
source?: SourceEntity,
) {
fix: access outer scope variables inside callbacks (#20168) ## Description Any platform function that accepts a callback were unable to access the variables declared in its parent scopes. This was a implementation miss when we originally designed platform functions and again when we turned almost every platform function into a Promise. This PR fixes this limitation along with some other edge cases. - Access outer scope variables inside the callback of run, postMessage, setInterval, getGeoLocation and watchGeolocation functions. - Fixes certain edge cases where functions with callbacks when called inside the then block doesn't get executed. Eg `showAlert.then(() => /* Doesn't execute */ Api1.run(() => {}))` - Changes the implementation of all the platform function in appsmith to maintain the execution metadata (info on from where a function was invoked, event associated with it etc) #### Refactor changes - Added a new folder **_fns_** that would now hold all the platform functions. - Introduced a new ExecutionMetadata singleton class that is now responsible for hold all the meta data related to the current evaluation. - Remove TRIGGER_COLLECTOR array where all callback based platform functions were batched and introduced an Event Emitter based implementation to handle batched fn calls. - All callback based functions now emits event when invoked. These events have handlers attached to the TriggerEmitter object. These handler does the job of batching these invocations and telling the main thread. It also ensures that platform fn calls that gets triggered out the the context of a request/response cycle work. #### Architecture <img width="751" alt="Screenshot 2023-02-07 at 10 04 26" src="https://user-images.githubusercontent.com/32433245/217259200-5eac71bc-f0d3-4d3c-9b69-2a8dc81351bc.png"> Fixes #13156 Fixes #20225 ## Type of change - Bug fix (non-breaking change which fixes an issue) - Refactor ## How Has This Been Tested? - Jest - Cypress - Manual ### Test Plan - [ ] https://github.com/appsmithorg/TestSmith/issues/2181 - [ ] https://github.com/appsmithorg/TestSmith/issues/2182 - [ ] Post message - https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/post-msg-app/page1-635fcfba2987b442a739b938/edit - [ ] Apps: https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/earworm-1/home-630c9d85b4658d0f257c4987/edit - [ ] https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/automation-test-cases/page-1-630c6b90d4ecd573f6bb01e9/edit#0hmn8m90ei ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## 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 - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] 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: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reviewing all Cypress test
2023-02-11 18:33:20 +00:00
const { payload } = action;
feat: adding slug names in urls (#10957) * Init commit clean urls * Changes to builder route * Refactored URLs * Remove default params from url builder functions. * Fixed more urls * Changed selector name * Minor url correction * Type fixes * Jest fixes * Fixed routing for old published apps * Fixed url slug replace * page-1 -> page1 as default page slug name * Remove application id from init editor calls * Use default page slug * Added comments and placeholder values for slug names * variable rename * Removed redirection and added back the old routes * Prevent page slug name recompute * Fixed home page load in view mode * Added null checks * Fixed jest test * Fixed jest test * Update URL slugs when app/page name changes * Added unit tests and updates types * Removed unused code * * Removed duplication fetch page call. * Fixes #11354 * Fixed sign up flow * Refactored initializeEditorSaga * Fixed warnings * Fixed integrations screen URL bugs * Cypress fixes * Fixed slug names in copy/move operations and pages screen * Minor refactor * Fixed page highlight bug in published apps * Added new url factory and middleware to store url params * Changed store to default export and fix unit tests * Fixed slugs unit test * Minor fixes * Fixes #11379 * Fixed set as home page feature * Updated types * app id adjustments for cypress * Fixed bad merge * Refactored routes to functional component * * Fixed EE active entity highlight. * Remove unused code in editor router. * jest fix * Mock history to prevent security errors * constant rename * Removed console logs * Fixed page id regex * Do not check for /pages in url * Fixed missing pageId on quick edit/deploy clicks * Missed files from previous commit * Fixed warnings * Fixed jest test * New api integration * feat: Add applicationVersion property to Application (#11626) Added a new property to Application object - applicationVersion. This property can be used to identity when there is a breaking change and can not be solved with migration. FE will use this property to detect such conditions. Another API is added to migrate the applicationVersion to latest version when user migrates the breaking changes. * Added manual upgrade modal. * Test fix * Fixed jest test * function rename * Fix deploy error * Added null check * Changes to persist URL search params when redirecting * Added updates tooltip * More unit test cases * Fixed git url redirection * Fix warning * Fixed evaluation on upgrade * Fixed warnings * File rename * Added cypress for clean urls * Fixed import/export/fork cypress * Cypress api server fixes * Fixed mongo spec * Fixed replay spec * Fixed comments spec * More cypress fixes * Fixed tooltip in update btn * Text size changes * Minor fixes * Jest test fix * Fixed type error * Fixed warnings * Fixed todo comments * Moved description to constants file * Fixed cypress CI run crash * Fixes git cypress failures * Import/Export cypress test fixes * Import export fork cypress fixes * Explorer test fix * Switch branch test fix * Added applicationVersion in export app json * Calls plugin forms in parallel * Fixed warnings * Fixed warning * Import export CI fixes * Reverts previous changes * Fixes import export * Fixed import export cypress URL verification * Pass applicationVersion when duplicating application * Cypress fix * Dummy commit Co-authored-by: Nayan <nayan@appsmith.com>
2022-03-25 10:43:26 +00:00
const pageList: Page[] = yield select(getPageList);
fix: access outer scope variables inside callbacks (#20168) ## Description Any platform function that accepts a callback were unable to access the variables declared in its parent scopes. This was a implementation miss when we originally designed platform functions and again when we turned almost every platform function into a Promise. This PR fixes this limitation along with some other edge cases. - Access outer scope variables inside the callback of run, postMessage, setInterval, getGeoLocation and watchGeolocation functions. - Fixes certain edge cases where functions with callbacks when called inside the then block doesn't get executed. Eg `showAlert.then(() => /* Doesn't execute */ Api1.run(() => {}))` - Changes the implementation of all the platform function in appsmith to maintain the execution metadata (info on from where a function was invoked, event associated with it etc) #### Refactor changes - Added a new folder **_fns_** that would now hold all the platform functions. - Introduced a new ExecutionMetadata singleton class that is now responsible for hold all the meta data related to the current evaluation. - Remove TRIGGER_COLLECTOR array where all callback based platform functions were batched and introduced an Event Emitter based implementation to handle batched fn calls. - All callback based functions now emits event when invoked. These events have handlers attached to the TriggerEmitter object. These handler does the job of batching these invocations and telling the main thread. It also ensures that platform fn calls that gets triggered out the the context of a request/response cycle work. #### Architecture <img width="751" alt="Screenshot 2023-02-07 at 10 04 26" src="https://user-images.githubusercontent.com/32433245/217259200-5eac71bc-f0d3-4d3c-9b69-2a8dc81351bc.png"> Fixes #13156 Fixes #20225 ## Type of change - Bug fix (non-breaking change which fixes an issue) - Refactor ## How Has This Been Tested? - Jest - Cypress - Manual ### Test Plan - [ ] https://github.com/appsmithorg/TestSmith/issues/2181 - [ ] https://github.com/appsmithorg/TestSmith/issues/2182 - [ ] Post message - https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/post-msg-app/page1-635fcfba2987b442a739b938/edit - [ ] Apps: https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/earworm-1/home-630c9d85b4658d0f257c4987/edit - [ ] https://appsmith-git-chore-outer-scope-variable-access-get-appsmith.vercel.app/app/automation-test-cases/page-1-630c6b90d4ecd573f6bb01e9/edit#0hmn8m90ei ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## 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 - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] 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: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reviewing all Cypress test
2023-02-11 18:33:20 +00:00
const { pageNameOrUrl, params, target } = payload;
feat: Change navigate to UI (#14856) * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Fix types and imports * Update the tests * Add ref back to the code Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-16 04:30:16 +00:00
const page = isValidPageName(pageNameOrUrl, pageList);
fix: fixed URL validation to not restrict navigateTo URLs to limited protocols (#27399) ## Description Currently, we check to see if the URL that is passed to the `navigateTo` method starts with http(s), mailTo or tel. This limits the capability to load/navigate to other URLs that do not conform to these protocols. This PR remove this crude protocol check and only checks to see if the navigateTo argument is a valid URL. > > Links to Notion, Figma or any other documents that might be relevant to the PR > > #### PR fixes following issue(s) Fixes #4878 > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) > > > ## Testing > #### How Has This Been Tested? - [x] Manual > > #### Test Plan 1. Verify NavigateTo() for https:// mailTo ftp urls 2. Verify NavigateTo for above protocol from jsobject and from Action selector 3. Verify NavigateTo for same and NewWindow with above URLs #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] 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
2023-09-21 01:32:37 +00:00
if (page) {
feat: adding slug names in urls (#10957) * Init commit clean urls * Changes to builder route * Refactored URLs * Remove default params from url builder functions. * Fixed more urls * Changed selector name * Minor url correction * Type fixes * Jest fixes * Fixed routing for old published apps * Fixed url slug replace * page-1 -> page1 as default page slug name * Remove application id from init editor calls * Use default page slug * Added comments and placeholder values for slug names * variable rename * Removed redirection and added back the old routes * Prevent page slug name recompute * Fixed home page load in view mode * Added null checks * Fixed jest test * Fixed jest test * Update URL slugs when app/page name changes * Added unit tests and updates types * Removed unused code * * Removed duplication fetch page call. * Fixes #11354 * Fixed sign up flow * Refactored initializeEditorSaga * Fixed warnings * Fixed integrations screen URL bugs * Cypress fixes * Fixed slug names in copy/move operations and pages screen * Minor refactor * Fixed page highlight bug in published apps * Added new url factory and middleware to store url params * Changed store to default export and fix unit tests * Fixed slugs unit test * Minor fixes * Fixes #11379 * Fixed set as home page feature * Updated types * app id adjustments for cypress * Fixed bad merge * Refactored routes to functional component * * Fixed EE active entity highlight. * Remove unused code in editor router. * jest fix * Mock history to prevent security errors * constant rename * Removed console logs * Fixed page id regex * Do not check for /pages in url * Fixed missing pageId on quick edit/deploy clicks * Missed files from previous commit * Fixed warnings * Fixed jest test * New api integration * feat: Add applicationVersion property to Application (#11626) Added a new property to Application object - applicationVersion. This property can be used to identity when there is a breaking change and can not be solved with migration. FE will use this property to detect such conditions. Another API is added to migrate the applicationVersion to latest version when user migrates the breaking changes. * Added manual upgrade modal. * Test fix * Fixed jest test * function rename * Fix deploy error * Added null check * Changes to persist URL search params when redirecting * Added updates tooltip * More unit test cases * Fixed git url redirection * Fix warning * Fixed evaluation on upgrade * Fixed warnings * File rename * Added cypress for clean urls * Fixed import/export/fork cypress * Cypress api server fixes * Fixed mongo spec * Fixed replay spec * Fixed comments spec * More cypress fixes * Fixed tooltip in update btn * Text size changes * Minor fixes * Jest test fix * Fixed type error * Fixed warnings * Fixed todo comments * Moved description to constants file * Fixed cypress CI run crash * Fixes git cypress failures * Import/Export cypress test fixes * Import export fork cypress fixes * Explorer test fix * Switch branch test fix * Added applicationVersion in export app json * Calls plugin forms in parallel * Fixed warnings * Fixed warning * Import export CI fixes * Reverts previous changes * Fixes import export * Fixed import export cypress URL verification * Pass applicationVersion when duplicating application * Cypress fix * Dummy commit Co-authored-by: Nayan <nayan@appsmith.com>
2022-03-25 10:43:26 +00:00
const currentPageId: string = yield select(getCurrentPageId);
feat: Change navigate to UI (#14856) * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Fix types and imports * Update the tests * Add ref back to the code Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-16 04:30:16 +00:00
AnalyticsUtil.logEvent("NAVIGATE", {
pageName: pageNameOrUrl,
pageParams: params,
});
feat: Change navigate to UI (#14856) * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Fix types and imports * Update the tests * Add ref back to the code Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-16 04:30:16 +00:00
feat: adding slug names in urls (#10957) * Init commit clean urls * Changes to builder route * Refactored URLs * Remove default params from url builder functions. * Fixed more urls * Changed selector name * Minor url correction * Type fixes * Jest fixes * Fixed routing for old published apps * Fixed url slug replace * page-1 -> page1 as default page slug name * Remove application id from init editor calls * Use default page slug * Added comments and placeholder values for slug names * variable rename * Removed redirection and added back the old routes * Prevent page slug name recompute * Fixed home page load in view mode * Added null checks * Fixed jest test * Fixed jest test * Update URL slugs when app/page name changes * Added unit tests and updates types * Removed unused code * * Removed duplication fetch page call. * Fixes #11354 * Fixed sign up flow * Refactored initializeEditorSaga * Fixed warnings * Fixed integrations screen URL bugs * Cypress fixes * Fixed slug names in copy/move operations and pages screen * Minor refactor * Fixed page highlight bug in published apps * Added new url factory and middleware to store url params * Changed store to default export and fix unit tests * Fixed slugs unit test * Minor fixes * Fixes #11379 * Fixed set as home page feature * Updated types * app id adjustments for cypress * Fixed bad merge * Refactored routes to functional component * * Fixed EE active entity highlight. * Remove unused code in editor router. * jest fix * Mock history to prevent security errors * constant rename * Removed console logs * Fixed page id regex * Do not check for /pages in url * Fixed missing pageId on quick edit/deploy clicks * Missed files from previous commit * Fixed warnings * Fixed jest test * New api integration * feat: Add applicationVersion property to Application (#11626) Added a new property to Application object - applicationVersion. This property can be used to identity when there is a breaking change and can not be solved with migration. FE will use this property to detect such conditions. Another API is added to migrate the applicationVersion to latest version when user migrates the breaking changes. * Added manual upgrade modal. * Test fix * Fixed jest test * function rename * Fix deploy error * Added null check * Changes to persist URL search params when redirecting * Added updates tooltip * More unit test cases * Fixed git url redirection * Fix warning * Fixed evaluation on upgrade * Fixed warnings * File rename * Added cypress for clean urls * Fixed import/export/fork cypress * Cypress api server fixes * Fixed mongo spec * Fixed replay spec * Fixed comments spec * More cypress fixes * Fixed tooltip in update btn * Text size changes * Minor fixes * Jest test fix * Fixed type error * Fixed warnings * Fixed todo comments * Moved description to constants file * Fixed cypress CI run crash * Fixes git cypress failures * Import/Export cypress test fixes * Import export fork cypress fixes * Explorer test fix * Switch branch test fix * Added applicationVersion in export app json * Calls plugin forms in parallel * Fixed warnings * Fixed warning * Import export CI fixes * Reverts previous changes * Fixes import export * Fixed import export cypress URL verification * Pass applicationVersion when duplicating application * Cypress fix * Dummy commit Co-authored-by: Nayan <nayan@appsmith.com>
2022-03-25 10:43:26 +00:00
const appMode: APP_MODE = yield select(getAppMode);
feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
const urlBuilder = appMode === APP_MODE.EDIT ? builderURL : viewerURL;
const path = urlBuilder({
basePageId: page.basePageId,
params,
});
feat: Change navigate to UI (#14856) * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Initial work to change navigate to UI * Remove console.logs * Adjust default parameters and getters/setters for page dropdown field * change url field getter so page names are not showm * Remove ../ from the imports Remove unnecessary todo * Add check for undefined fields * Add validations for url/page name, add error message * Make height auto to accommodate the flexible size of query param text box * Update dropdown list of pages when page names are updated * Set tab to url when a url has been entered, else default to page * Add feature tests * Add check on null value in isValueValidURL to ensure it does not crash the app * Remove unused ref * Fix bug when switch is selected and a new page addition let to page crash * Fix types and imports * Update the tests * Add ref back to the code Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-16 04:30:16 +00:00
if (target === NavigationTargetType.SAME_WINDOW) {
feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
yield call(pushToHistory, path);
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
if (currentPageId === page.pageId) {
yield call(setDataUrl);
fix: appsmith.URL.queryParams update on same page navigation (#32382) ## Description - Making sure to trigger evaluation after navigateTo on same page to make sure we update the `appsmith.URL.queryParams` - Update the cypress test to check queryParams update on same page Fixes https://github.com/appsmithorg/appsmith/issues/26831 ## Steps to test 1. Add a button widget 2. Add a `navigateTo` action on click event of button 3. NavigateTo should have params as below and should navigate to same page ```js {{ { key: "aff", key2: "dsfs" } }} ``` 4. Add a text widget with binding `{{appsmith.URL.queryParams}}` 5. Make sure that the text widget updates once the button is clicked ## Automation /ok-to-test tags="@tag.JS" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8598783804> > Commit: `634477b53582ae5392eb26dde1a1fcd434f55883` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8598783804&attempt=2" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for setting URL data through Redux actions for enhanced state management. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-09 10:31:17 +00:00
yield put({
type: ReduxActionTypes.TRIGGER_EVAL,
});
}
} else if (target === NavigationTargetType.NEW_WINDOW) {
window.open(path, "_blank");
}
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
AppsmithConsole.info({
source,
text: `navigateTo triggered`,
state: {
page,
params,
},
});
} else {
fix: fixed URL validation to not restrict navigateTo URLs to limited protocols (#27399) ## Description Currently, we check to see if the URL that is passed to the `navigateTo` method starts with http(s), mailTo or tel. This limits the capability to load/navigate to other URLs that do not conform to these protocols. This PR remove this crude protocol check and only checks to see if the navigateTo argument is a valid URL. > > Links to Notion, Figma or any other documents that might be relevant to the PR > > #### PR fixes following issue(s) Fixes #4878 > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) > > > ## Testing > #### How Has This Been Tested? - [x] Manual > > #### Test Plan 1. Verify NavigateTo() for https:// mailTo ftp urls 2. Verify NavigateTo for above protocol from jsobject and from Action selector 3. Verify NavigateTo for same and NewWindow with above URLs #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] 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
2023-09-21 01:32:37 +00:00
let url = pageNameOrUrl + getQueryStringfromObject(params);
if (!isValidURL(url)) {
const looksLikeURL = matchesURLPattern(url);
// Filter out cases like navigateTo("1");
if (!looksLikeURL)
throw new TriggerFailureError("Enter a valid URL or page name");
// Default to https protocol to support navigation to URLs like www.google.com
url = `https://${url}`;
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
fix: fixed URL validation to not restrict navigateTo URLs to limited protocols (#27399) ## Description Currently, we check to see if the URL that is passed to the `navigateTo` method starts with http(s), mailTo or tel. This limits the capability to load/navigate to other URLs that do not conform to these protocols. This PR remove this crude protocol check and only checks to see if the navigateTo argument is a valid URL. > > Links to Notion, Figma or any other documents that might be relevant to the PR > > #### PR fixes following issue(s) Fixes #4878 > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) > > > ## Testing > #### How Has This Been Tested? - [x] Manual > > #### Test Plan 1. Verify NavigateTo() for https:// mailTo ftp urls 2. Verify NavigateTo for above protocol from jsobject and from Action selector 3. Verify NavigateTo for same and NewWindow with above URLs #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] 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
2023-09-21 01:32:37 +00:00
if (!isValidURL(url))
throw new TriggerFailureError("Enter a valid URL or page name");
}
chore: add blank line eslint rule (#36369) ## Description Added ESLint rule to force blank lines between statements. Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10924926728> > Commit: 34f57714a1575ee04e94e03cbcaf95e57a96c86c > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10924926728&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Anvil/AnvilModal_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCheckboxGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilCurrencyInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilIconButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInlineButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilParagraphWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilPhoneInputWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilStatsWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchGroupWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilSwitchWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilTableWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilToolbarButtonWidgetSnapshot_spec.ts > <li>cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilZoneSectionWidgetSnapshot_spec.ts</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 18 Sep 2024 16:33:36 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --------- Co-authored-by: Valera Melnikov <valera@appsmith.com>
2024-09-18 16:35:28 +00:00
fix: fixed URL validation to not restrict navigateTo URLs to limited protocols (#27399) ## Description Currently, we check to see if the URL that is passed to the `navigateTo` method starts with http(s), mailTo or tel. This limits the capability to load/navigate to other URLs that do not conform to these protocols. This PR remove this crude protocol check and only checks to see if the navigateTo argument is a valid URL. > > Links to Notion, Figma or any other documents that might be relevant to the PR > > #### PR fixes following issue(s) Fixes #4878 > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) > > > ## Testing > #### How Has This Been Tested? - [x] Manual > > #### Test Plan 1. Verify NavigateTo() for https:// mailTo ftp urls 2. Verify NavigateTo for above protocol from jsobject and from Action selector 3. Verify NavigateTo for same and NewWindow with above URLs #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] 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
2023-09-21 01:32:37 +00:00
if (target === NavigationTargetType.SAME_WINDOW) {
window.location.assign(url);
} else if (target === NavigationTargetType.NEW_WINDOW) {
window.open(url, "_blank");
}
fix: appsmith.URL.queryParams update on same page navigation (#32382) ## Description - Making sure to trigger evaluation after navigateTo on same page to make sure we update the `appsmith.URL.queryParams` - Update the cypress test to check queryParams update on same page Fixes https://github.com/appsmithorg/appsmith/issues/26831 ## Steps to test 1. Add a button widget 2. Add a `navigateTo` action on click event of button 3. NavigateTo should have params as below and should navigate to same page ```js {{ { key: "aff", key2: "dsfs" } }} ``` 4. Add a text widget with binding `{{appsmith.URL.queryParams}}` 5. Make sure that the text widget updates once the button is clicked ## Automation /ok-to-test tags="@tag.JS" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8598783804> > Commit: `634477b53582ae5392eb26dde1a1fcd434f55883` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8598783804&attempt=2" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for setting URL data through Redux actions for enhanced state management. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-09 10:31:17 +00:00
fix: fixed URL validation to not restrict navigateTo URLs to limited protocols (#27399) ## Description Currently, we check to see if the URL that is passed to the `navigateTo` method starts with http(s), mailTo or tel. This limits the capability to load/navigate to other URLs that do not conform to these protocols. This PR remove this crude protocol check and only checks to see if the navigateTo argument is a valid URL. > > Links to Notion, Figma or any other documents that might be relevant to the PR > > #### PR fixes following issue(s) Fixes #4878 > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) > > > ## Testing > #### How Has This Been Tested? - [x] Manual > > #### Test Plan 1. Verify NavigateTo() for https:// mailTo ftp urls 2. Verify NavigateTo for above protocol from jsobject and from Action selector 3. Verify NavigateTo for same and NewWindow with above URLs #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] 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
2023-09-21 01:32:37 +00:00
AppsmithConsole.info({
text: `navigateTo('${url}') was triggered`,
state: {
params,
},
});
AnalyticsUtil.logEvent("NAVIGATE", {
navUrl: pageNameOrUrl,
});
}
}
feat: integrates on page unload behavior with backend for deployed mode of the app (#41036) ## Description **TLDR:** Adds support for executing page unload actions during navigation in deployed mode, refactors related components, and improves action handling. <ins>Problem</ins> Page unload actions were not triggered during navigation in deployed mode, leading to incomplete workflows especially for cleanup. <ins>Root cause</ins> The application lacked integration for executing unload actions on page transitions, and related components did not properly handle navigation or action execution. <ins>Solution</ins> This PR handles the integration of page unload action execution during navigation in deployed mode. It introduces selectors for unload actions, refactors the MenuItem component for better navigation handling, and improves the PluginActionSaga for executing plugin actions. Unused parameters and functions are removed for clarity and maintainability. Fixes #40997 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/16021075820> > Commit: f09e3c44d379488e43aec6ab27228d7675f79415 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16021075820&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 02 Jul 2025 10:21:00 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for actions that execute automatically when navigating away from a page. * Introduced new navigation logic and hooks for consistent page transitions within the app. * Added new menu and dropdown components for improved navigation UI. * **Bug Fixes** * Updated navigation item styling and active state detection for improved accuracy. * **Tests** * Added comprehensive tests for navigation sagas and page unload actions. * Added unit tests for navigation menu components. * **Chores** * Refactored and centralized navigation logic for maintainability. * Improved type safety and selector usage in navigation and action execution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-02 13:10:44 +00:00
export function* navigateToAnyPageInApplication(
action: ReduxAction<NavigateToAnotherPagePayload>,
) {
yield call(pushToHistory, action.payload);
}
export function* pushToHistory(payload: NavigateToAnotherPagePayload | Path) {
yield put({
type: ReduxActionTypes.EXECUTE_PAGE_UNLOAD_ACTIONS,
});
yield take([
ReduxActionTypes.EXECUTE_PAGE_UNLOAD_ACTIONS_SUCCESS,
ReduxActionTypes.EXECUTE_PAGE_UNLOAD_ACTIONS_ERROR,
]);
if (typeof payload === "string") {
history.push(payload);
return;
}
const historyState: LocationDescriptor<AppsmithLocationState> = {
pathname: payload.pageURL,
search: payload.query,
state: payload.state,
};
history.push(historyState);
}