Skip to content
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

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/client/src/ce/sagas/ApplicationSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ export function* forkApplicationSaga(
payload: {
applicationId: application.id,
pageId: defaultPage?.id,
mode: APP_MODE.EDIT,
},
});
}
Expand Down
2 changes: 2 additions & 0 deletions app/client/src/reducers/entityReducers/pageListReducer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const pageListReducer = createReducer(initialState, {
...action.payload,
defaultPageId: defaultPage?.pageId,
defaultBasePageId: defaultPage?.basePageId,
currentBasePageId: defaultPage?.basePageId,
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nidhi-nair

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.

Copy link
Contributor

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?

currentPageId: defaultPage?.basePageId,
};
},
[ReduxActionTypes.UPDATE_PAGE_LIST]: (
Expand Down
Loading