PromucFlow_constructor/app/client/src/constants
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
..
ApiEditorConstants chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
AppsmithActionConstants chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
defs chore: Format files to match prettier rules and exclude third-party files (#21586) 2023-03-20 19:04:31 +05:30
routes chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
AppConstants.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
BindingsConstants.ts revert: Reverting PR 23245 as regex is using lookbehind which is not … (#24306) 2023-06-12 13:01:29 +05:30
CanvasEditorConstants.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
collectionsConstants.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
Colors.tsx feat: Add widget responsiveness and conversion algorithm (#21386) 2023-04-07 09:51:35 -04:00
componentClassNameConstants.ts chore: code changes for widget position observer and widget name on canvas (#27367) 2023-10-06 15:37:43 +05:30
Currency.tsx
Datasource.ts feat: Datasource preview page in view mode (#26381) 2023-08-30 08:14:14 +01:00
DatasourceEditorConstants.ts fix: table selection in schema preview data broken (#27823) 2023-10-06 17:35:19 +05:30
DefaultTheme.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
DocumentationLinks.ts chore: Sunset Omnibar Documentation and Snippets (#24787) 2023-06-30 15:51:08 +05:30
Explorer.ts
FieldExpectedValue.ts
Fonts.tsx fix: Visual changes to code inside appsmith (#22652) 2023-05-11 23:08:10 +05:30
GitErrorCodes.ts feat: Error handling phase 1 (#20629) 2023-02-18 18:25:46 +05:30
HelpConstants.ts feat: [epic] appsmith design system version 2 deduplication (#22030) 2023-05-20 00:07:06 +05:30
IconConstants.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
ImagesURL.ts feat: util to serve images locally or via remote url (#22080) 2023-04-10 12:32:31 +05:30
ISDCodes_v2.tsx
ISDCodes.tsx
KeyboardShortcuts.ts
Layers.tsx fix: Added an Indice.Layer to the Border and Indicator of the Guided … (#25585) 2023-07-24 15:43:55 +05:30
minWidthConstants.ts feat: Auto layout appsmith editor and mobile responsiveness (#21151) 2023-03-04 12:55:54 +05:30
ProductUpdate.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
PropertyControlConstants.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
providerConstants.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
QueryEditorConstants.ts feat: Datasource preview page in view mode (#26381) 2023-08-30 08:14:14 +01:00
Regex.ts fix: display name validation (client) (#22938) 2023-05-04 18:29:57 +05:30
routes.test.ts chore: route builder refactor (#27905) 2023-10-12 11:01:22 +05:30
serverAssets.ts fix: oracle icon path (#22986) 2023-05-08 12:53:55 +05:30
StyleConstants.tsx
ThemeConstants.tsx chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
ThirdPartyConstants.tsx chore: Improve code splitting of FE components (#26659) 2023-08-28 21:07:32 +05:30
typography.ts
userConstants.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00
WalkthroughConstants.ts fix: remove redundant code for ab_ds_binding_enabled and ab_ds_schema_enabled ab test flags (#26356) 2023-08-31 19:49:36 +05:30
WebsocketConstants.tsx
WidgetConstants.tsx chore: Remove server side filtering flag (#27663) 2023-10-04 13:48:41 +05:30
WidgetValidation.ts chore: add consistent-type-definitions rule (#27907) 2023-10-11 10:35:24 +03:00