-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add mode property to forkApplicationSaga #35841
fix: Add mode property to forkApplicationSaga #35841
Conversation
This commit adds the `mode` property to the `forkApplicationSaga` function in the `ApplicationSagas.tsx` file. The `mode` property is set to `APP_MODE.EDIT`. This change allows for better control and customization of the application editing mode.
WalkthroughThe update introduces modifications to the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10505588490. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- app/client/src/ce/sagas/ApplicationSagas.tsx (1 hunks)
Additional context used
Learnings (2)
Common learnings
Learnt from: ankitakinger PR: appsmithorg/appsmith#29965 File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742 Timestamp: 2024-01-03T09:53:22.824Z Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.
app/client/src/ce/sagas/ApplicationSagas.tsx (1)
Learnt from: ankitakinger PR: appsmithorg/appsmith#29965 File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742 Timestamp: 2024-01-03T09:53:22.824Z Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.
Additional comments not posted (1)
app/client/src/ce/sagas/ApplicationSagas.tsx (1)
691-691
: Verify the impact of addingmode: APP_MODE.EDIT
.The addition of the
mode
property with the valueAPP_MODE.EDIT
in the payload aligns with the PR objectives. However, ensure that this change does not introduce any unintended side effects in the application logic.Run the following script to verify the usage and impact of the
APP_MODE.EDIT
constant in the codebase:Verification successful
Let's correct the script and search for
APP_MODE.EDIT
across the codebase to understand its usage and impact.
The addition of
mode: APP_MODE.EDIT
is consistent and safe.The
APP_MODE.EDIT
constant is widely used across the codebase in various contexts, such as sagas, selectors, and components. Its integration into theforkApplicationSaga
function aligns with existing patterns and should not introduce unintended side effects.
- The usage of
APP_MODE.EDIT
is consistent and aligns with the application's logic for handling edit modes.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `APP_MODE.EDIT` in the codebase. # Test: Search for the usage of `APP_MODE.EDIT`. Expect: Consistent usage across the codebase. rg --type tsx -A 5 $'APP_MODE.EDIT'Length of output: 62
Script:
#!/bin/bash # Description: Verify the usage of `APP_MODE.EDIT` in the codebase. # Test: Search for the usage of `APP_MODE.EDIT`. Expect: Consistent usage across the codebase. rg 'APP_MODE\.EDIT' -A 5Length of output: 25525
Deploy-Preview-URL: https://ce-35841.dp.appsmith.com |
@rahulbarwal Why is this change just added? There is an if check for this |
…educer This commit adds the currentBasePageId and currentPageId properties to the pageListReducer in the pageListReducer.tsx file. These properties are set to the basePageId of the defaultPage. This change allows for better tracking and management of the current base page and current page in the application.
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10507741119. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- app/client/src/reducers/entityReducers/pageListReducer.tsx (1 hunks)
Additional context used
Learnings (1)
Common learnings
Learnt from: ankitakinger PR: appsmithorg/appsmith#29965 File: app/client/src/ce/sagas/ApplicationSagas.tsx:736-742 Timestamp: 2024-01-03T09:53:22.824Z Learning: The use of `editorId` instead of `appId` is an intentional change in the PR and is part of reverting to a previous functionality.
Additional comments not posted (1)
app/client/src/reducers/entityReducers/pageListReducer.tsx (1)
64-65
: Verify the usage ofcurrentBasePageId
andcurrentPageId
.The addition of
currentBasePageId
andcurrentPageId
enhances state management. Make sure these properties are correctly utilized throughout the application to avoid inconsistencies.Run the following script to verify the usage of these properties:
Verification successful
Let's try again to verify the usage of
currentBasePageId
andcurrentPageId
in the codebase. I'll adjust the script to search without specifying the file type, which should resolve the issue.
Consistent Usage of
currentBasePageId
andcurrentPageId
VerifiedThe properties
currentBasePageId
andcurrentPageId
are consistently used across the codebase, including selectors, sagas, and components. This indicates that the changes made in the reducer are well-integrated into the application's logic.
- Files where these properties are used:
app/client/test/factories/AppIDEFactoryUtils.ts
app/client/src/selectors/appViewSelectors.tsx
app/client/src/sagas/ActionExecution/NavigateActionSaga.ts
app/client/src/sagas/selectors.tsx
app/client/src/pages/Editor/index.tsx
- ...and many more.
These findings confirm that the state management enhancements are correctly utilized throughout the application.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `currentBasePageId` and `currentPageId` in the codebase. # Test: Search for the usage of `currentBasePageId` and `currentPageId`. Expect: Consistent usage across the codebase. rg --type tsx -A 5 $'currentBasePageId|currentPageId'Length of output: 82
Script:
#!/bin/bash # Description: Verify the usage of `currentBasePageId` and `currentPageId` in the codebase. # Test: Search for the usage of `currentBasePageId` and `currentPageId`. Expect: Consistent usage across the codebase. rg 'currentBasePageId|currentPageId' -A 5Length of output: 78963
Deploy-Preview-URL: https://ce-35841.dp.appsmith.com |
@jacquesikot I ran a git bisect to find the answer to this very question. It points to default resources PR: #34765 |
@@ -61,6 +61,8 @@ export const pageListReducer = createReducer(initialState, { | |||
...action.payload, | |||
defaultPageId: defaultPage?.pageId, | |||
defaultBasePageId: defaultPage?.basePageId, | |||
currentBasePageId: defaultPage?.basePageId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these properties help with @rahulbarwal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These properties are used by editor header to show the current page at top.
Basically, after adding edit mode, the page name in the list was not updating correctly, and reason was that it used currentPageId
property.
When we forked an app form editor, it already has currentPageId
which was not getting updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks! I'm approving the PR as a quick fix, but is there a way to add tests to these flows as well?
## Description Reverts #35841 ## Automation /ok-to-test tags="@tag.All" ### 🔍 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/10555144301> > Commit: f01f27d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10555144301&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Mon, 26 Aug 2024 08:05:27 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
Description
This pull request adds the
mode
property to theforkApplicationSaga
function in theApplicationSagas.tsx
file.The
mode
property is set toAPP_MODE.EDIT
, allowing for better control and customization of the application editing mode.Fixes #35835
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.Fork"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10507731953
Commit: eba9176
Cypress dashboard.
Tags:
@tag.Fork
Spec:
Thu, 22 Aug 2024 12:33:03 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit