Validate url
This commit is contained in:
parent
1e238ce693
commit
25c921e340
|
@ -88,7 +88,7 @@ export async function postAuth(
|
|||
}
|
||||
)
|
||||
|
||||
ctx.redirect(`${baseUrl}/new?action=google_continue&id=${id}`)
|
||||
ctx.redirect(`${baseUrl}/new?continue_google_setup=${id}`)
|
||||
}
|
||||
)(ctx, next)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<script>
|
||||
import { ModalContent, Body, Layout, Link } from "@budibase/bbui"
|
||||
import {
|
||||
ModalContent,
|
||||
Body,
|
||||
Layout,
|
||||
Link,
|
||||
notifications,
|
||||
} from "@budibase/bbui"
|
||||
import { IntegrationNames, IntegrationTypes } from "constants/backend"
|
||||
import GoogleButton from "../_components/GoogleButton.svelte"
|
||||
import { organisation } from "stores/portal"
|
||||
|
@ -9,9 +15,10 @@
|
|||
import IntegrationConfigForm from "../TableIntegrationMenu/IntegrationConfigForm.svelte"
|
||||
|
||||
export let integration
|
||||
export let continueSetup = false
|
||||
export let continueSetupId = false
|
||||
|
||||
let datasource = cloneDeep(integration)
|
||||
datasource.config.continueSetupId = continueSetupId
|
||||
|
||||
$: isGoogleConfigured = !!$organisation.googleDatasourceConfigured
|
||||
|
||||
|
@ -25,7 +32,7 @@
|
|||
SET_URL: "Set_url",
|
||||
}
|
||||
|
||||
let step = continueSetup
|
||||
let step = continueSetupId
|
||||
? GoogleDatasouceConfigStep.SET_URL
|
||||
: GoogleDatasouceConfigStep.AUTH
|
||||
|
||||
|
@ -38,7 +45,7 @@
|
|||
onConfirm: async () => {
|
||||
const resp = await validateDatasourceConfig(datasource)
|
||||
if (!resp.connected) {
|
||||
displayError(`Unable to connect - ${resp.error}`)
|
||||
notifications.error(`Unable to connect - ${resp.error}`)
|
||||
}
|
||||
|
||||
return false
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
let integration = null
|
||||
let disabled = false
|
||||
let promptUpload = false
|
||||
let continueGoogleSetup
|
||||
|
||||
$: hasData = $datasources.list.length > 1 || $tables.list.length > 1
|
||||
$: hasDefaultData =
|
||||
|
@ -131,12 +130,10 @@
|
|||
return integrationsArray
|
||||
}
|
||||
|
||||
let isGoogleContinueAction
|
||||
let continueGoogleSetup
|
||||
onMount(() => {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const action = urlParams.get("action")
|
||||
|
||||
isGoogleContinueAction = action === "google_continue"
|
||||
continueGoogleSetup = urlParams.get("continue_google_setup")
|
||||
})
|
||||
|
||||
const fetchIntegrations = async () => {
|
||||
|
@ -144,7 +141,7 @@
|
|||
integrations = sortIntegrations(unsortedIntegrations)
|
||||
console.log(integrations[IntegrationTypes.GOOGLE_SHEETS])
|
||||
|
||||
if (isGoogleContinueAction) {
|
||||
if (continueGoogleSetup) {
|
||||
handleIntegrationSelect(IntegrationTypes.GOOGLE_SHEETS)
|
||||
}
|
||||
}
|
||||
|
@ -159,12 +156,12 @@
|
|||
<Modal
|
||||
bind:this={externalDatasourceModal}
|
||||
on:hide={() => {
|
||||
continueGoogleSetup = false
|
||||
continueGoogleSetup = null
|
||||
}}
|
||||
>
|
||||
{#if integration?.auth?.type === "google"}
|
||||
<GoogleDatasourceConfigModal
|
||||
continueSetup={isGoogleContinueAction}
|
||||
continueSetupId={continueGoogleSetup}
|
||||
{integration}
|
||||
/>
|
||||
{:else}
|
||||
|
|
|
@ -11,7 +11,7 @@ import { BuildSchemaErrors, InvalidColumns } from "../../constants"
|
|||
import { getIntegration } from "../../integrations"
|
||||
import { getDatasourceAndQuery } from "./row/utils"
|
||||
import { invalidateDynamicVariables } from "../../threads/utils"
|
||||
import { db as dbCore, context, events } from "@budibase/backend-core"
|
||||
import { db as dbCore, context, events, cache } from "@budibase/backend-core"
|
||||
import {
|
||||
UserCtx,
|
||||
Datasource,
|
||||
|
@ -25,6 +25,7 @@ import {
|
|||
FetchDatasourceInfoResponse,
|
||||
IntegrationBase,
|
||||
DatasourcePlus,
|
||||
SourceName,
|
||||
} from "@budibase/types"
|
||||
import sdk from "../../sdk"
|
||||
import { builderSocket } from "../../websockets"
|
||||
|
|
Loading…
Reference in New Issue