PromucFlow_constructor/app/client/src
ashit-rath 59d0f999ad
chore: route builder refactor (#27905)
## Description
This PR aims to achieve 2 things
1. Make route building independent of explicitly passing `pageId` as
param when the route is generated against the current page navigation.
2. Add extensible points to extend basePath generation in EE.

THIS PR DOES NOT CHANGE ROUTE GENERATION. 

Changes: 
In `app/client/src/ce/entities/URLRedirect/URLAssembly.ts`
1. Moves the logic of `generateBasePath` way to specific method called
`generateBasePathForApps` and the generateBasePath is available to
extend and switch between a different base path generation logic in EE.
2. Adds a new member variable called `currentPageId`. This
`currentPageId` would help generating basePath without explicitly
passing `pageId` to the build method. If a `pageId` is passed it would
be overridden in the `resolveEntityId` logic.
3. Added `resolveEntityId` method to resolve the entity (pageId) based
on the params passed and the `currentPageId`. This method also acts as
an extension point for extending the logic to any other resolution logic
similar to `generateBasePath`

In `app/client/src/pages/AppViewer/index.tsx` and
`app/client/src/pages/Editor/index.tsx`
The `currentPageId` is set using the `urlBuilder.setCurrentPageId` when
the component mounts or page changes and unset when the component
unmounts.


#### PR fixes following issue(s)
Fixes #27840 

#### 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
- Chore (housekeeping or task changes that don't impact user perception)

## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [x] Manual
- [ ] JUnit
- [x] Jest
- [ ] Cypress
>
>
#### 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
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [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:
- [ ] [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-10-12 11:01:22 +05:30
..
actions chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
api chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
assets chore: add color validation + native color picker (#25355) 2023-08-07 11:55:10 +03:00
ce chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
components chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
constants chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
ee chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
enterprise
entities chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
globalStyles feat: assistive binding (#27070) 2023-09-15 21:23:51 +05:30
icons chore:add eslint rules (#27878) 2023-10-09 16:54:06 +03:00
layoutSystems chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
mockComponentProps
mockResponses
mocks chore: Create layout system structure for Anvil and AnvilFlexComponent. (#27178) 2023-10-02 15:41:05 -04:00
navigation chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
pages chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
plugins/Linting chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
polyfills
reducers feat: make features call a blocking API call for page load (#27974) 2023-10-11 23:19:19 +05:30
reflow chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
sagas chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
selectors chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
templates
theme
transformers chore: code split for EE PR 2169 (#26669) 2023-09-11 14:09:41 +07:00
usagePulse changes in evaluation for EE - split (#27144) 2023-09-12 17:21:39 +05:30
utils chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
WidgetProvider chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
WidgetQueryGenerators chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
widgets chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
workers chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
App.css
AppErrorBoundry.tsx
config.d.ts
Globals.d.ts chore: Add support for 3D Custom ECharts (#26657) 2023-09-27 16:54:27 +05:30
index.css fix: design-system-old fixes (#24421) 2023-06-20 14:34:13 +05:30
index.tsx perf: prioritize the main bundle over preloads (v2) (#24374) 2023-06-22 10:58:10 +05:30
LandingScreen.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
preload-route-chunks.ts fix: bump storybook version and move stories to storybook package (#25821) 2023-07-31 19:15:50 +03:00
react-app-env.d.ts
RouteChangeListener.tsx chore: added route listener on non-trackable URLs (#25671) 2023-08-11 17:04:42 +05:30
RouteParamsMiddleware.ts chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
serviceWorker.js
store.ts
wdyr.ts chore: improve eslint rules (#26056) 2023-08-07 15:38:48 +03:00