From f4dc39ba6b3a2db9d0276720f5ba766f75f45a56 Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Wed, 9 Aug 2023 14:24:03 +0530 Subject: [PATCH] fix: Updating the pageId in the reconnect modal for Gsheets authorization (#26125) ## Description Updating `pageId` in the reconnect modal for Gsheets authorization. It was taking the `pageId` of the old delete page for authorization from the query params. This has been fixed by using props instead if its inside reconnect modal. #### PR fixes following issue(s) Fixes [#26024](https://github.com/appsmithorg/appsmith/issues/26024) #### Type of change - Bug fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [x] Manual - [ ] Jest - [ ] Cypress ## 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 - [ ] 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 --- app/client/src/pages/common/datasourceAuth/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/client/src/pages/common/datasourceAuth/index.tsx b/app/client/src/pages/common/datasourceAuth/index.tsx index 3f3d3edea3..2bd12dc239 100644 --- a/app/client/src/pages/common/datasourceAuth/index.tsx +++ b/app/client/src/pages/common/datasourceAuth/index.tsx @@ -136,7 +136,7 @@ function DatasourceAuth({ formData, getSanitizedFormData, isInvalid, - pageId: pageIdProp, + pageId: pageIdProp = "", pluginType, pluginName, pluginPackageName, @@ -174,7 +174,9 @@ function DatasourceAuth({ const { pageId: pageIdQuery } = useParams(); const history = useHistory(); - const pageId = (pageIdQuery || pageIdProp) as string; + const pageId = isInsideReconnectModal + ? pageIdProp + : ((pageIdQuery || pageIdProp) as string); useEffect(() => { if (authType === AuthType.OAUTH2) {