fix: forking reconnect modal issue fixed (#24752)

This PR fixes forking related issues introduced in plugins like Google
Sheets, Amazon S3, DynamoDB, MongoDB etc.

Fixes #24566
> if no issue exists, please create an issue and ask the maintainers
about this first
>
>

> 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
>
>

- Bug fix (non-breaking change which fixes an issue)
>
>
>

>

> 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
- [ ] Jest
- [ ] Cypress
>
>

> Add Testsmith test cases links that relate to this PR
>
>

> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>

- [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
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag

- [ ] [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

---------

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
This commit is contained in:
“sneha122” 2023-06-23 10:35:51 +05:30
parent 4b547eeb1a
commit 67be8daa42
2 changed files with 7 additions and 5 deletions

View File

@ -102,7 +102,7 @@ import { GUIDED_TOUR_STEPS } from "pages/Editor/GuidedTour/constants";
import { builderURL, viewerURL } from "RouteBuilder";
import { getDefaultPageId as selectDefaultPageId } from "sagas/selectors";
import PageApi from "api/PageApi";
import { identity, merge, pickBy } from "lodash";
import { identity, isEmpty, merge, pickBy } from "lodash";
import { checkAndGetPluginFormConfigsSaga } from "sagas/PluginSagas";
import { getPageList, getPluginForm } from "selectors/entitiesSelector";
import { getConfigInitialValues } from "components/formControls/utils";
@ -851,7 +851,9 @@ export function* fetchUnconfiguredDatasourceList(
}
export function* initializeDatasourceWithDefaultValues(datasource: Datasource) {
if (!datasource.datasourceConfiguration) {
// Added isEmpty instead of ! condition as ! does not account for
// datasourceConfiguration being empty
if (isEmpty(datasource.datasourceConfiguration)) {
yield call(checkAndGetPluginFormConfigsSaga, datasource.pluginId);
const formConfig: Record<string, unknown>[] = yield select(
getPluginForm,

View File

@ -416,9 +416,9 @@ function* updateDatasourceSaga(
// We do not want to set isConfigured to true immediately on save
// instead we want to wait for authorisation as well as file selection to be complete
if (isGoogleSheetPluginDS(pluginPackageName)) {
const scopeString: string = (
datasourcePayload?.datasourceConfiguration?.authentication as any
)?.scopeString;
const scopeString: string =
(datasourcePayload?.datasourceConfiguration?.authentication as any)
?.scopeString || "";
if (scopeString.includes(GOOGLE_SHEET_SPECIFIC_SHEETS_SCOPE)) {
datasourcePayload.isConfigured = false;
}