fixed issue of redirecting with one oauth authentication
This commit is contained in:
parent
b265ac2fd5
commit
8ded371162
|
|
@ -47,7 +47,7 @@ import {
|
||||||
setIsReconnectingDatasourcesModalOpen,
|
setIsReconnectingDatasourcesModalOpen,
|
||||||
setOrgIdForImport,
|
setOrgIdForImport,
|
||||||
} from "actions/applicationActions";
|
} from "actions/applicationActions";
|
||||||
import { Datasource } from "entities/Datasource";
|
import { AuthType, Datasource } from "entities/Datasource";
|
||||||
import { DATASOURCE_DB_FORM } from "constants/forms";
|
import { DATASOURCE_DB_FORM } from "constants/forms";
|
||||||
import { initialize } from "redux-form";
|
import { initialize } from "redux-form";
|
||||||
import TooltipComponent from "components/ads/Tooltip";
|
import TooltipComponent from "components/ads/Tooltip";
|
||||||
|
|
@ -452,6 +452,18 @@ function ReconnectDatasourceModal() {
|
||||||
// checking of full configured
|
// checking of full configured
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isModalOpen && !isTesting) {
|
if (isModalOpen && !isTesting) {
|
||||||
|
// if there is only one gsheet datasource, it shouldn't be redirected to app immediately
|
||||||
|
if (
|
||||||
|
!queryIsImport &&
|
||||||
|
datasources.length === 1 &&
|
||||||
|
datasources[0].isConfigured
|
||||||
|
) {
|
||||||
|
const authType =
|
||||||
|
datasources[0].datasourceConfiguration?.authentication
|
||||||
|
?.authenticationType;
|
||||||
|
|
||||||
|
if (authType === AuthType.OAUTH2) return;
|
||||||
|
}
|
||||||
const id = selectedDatasourceId;
|
const id = selectedDatasourceId;
|
||||||
const pending = datasources.filter((ds: Datasource) => !ds.isConfigured);
|
const pending = datasources.filter((ds: Datasource) => !ds.isConfigured);
|
||||||
if (pending.length > 0) {
|
if (pending.length > 0) {
|
||||||
|
|
@ -469,7 +481,7 @@ function ReconnectDatasourceModal() {
|
||||||
window.open(appURL, "_self");
|
window.open(appURL, "_self");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [datasources, appURL, isModalOpen, isTesting]);
|
}, [datasources, appURL, isModalOpen, isTesting, queryIsImport]);
|
||||||
|
|
||||||
const mappedDataSources = datasources.map((ds: Datasource) => {
|
const mappedDataSources = datasources.map((ds: Datasource) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user