Use fancycheckboxgroup

This commit is contained in:
Adria Navarro 2023-06-07 11:44:32 +01:00
parent bb901d94d2
commit dd58aaf5cb
2 changed files with 6 additions and 9 deletions

View File

@ -5,6 +5,7 @@
Layout,
Link,
notifications,
FancyCheckboxGroup,
} from "@budibase/bbui"
import { IntegrationNames, IntegrationTypes } from "constants/backend"
import GoogleButton from "../_components/GoogleButton.svelte"
@ -17,7 +18,6 @@
import cloneDeep from "lodash/cloneDeepWith"
import IntegrationConfigForm from "../TableIntegrationMenu/IntegrationConfigForm.svelte"
import { goto } from "@roxi/routify"
import { API } from "api"
import { saveDatasource } from "builderStore/datasource"
import { DatasourceFeature } from "@budibase/types"
@ -48,10 +48,13 @@
let isValid = false
let allSheets
let selectedSheets
const saveDatasourceAndRedirect = async () => {
try {
const resp = await saveDatasource(datasource)
const resp = await saveDatasource(datasource, {
tablesFilter: selectedSheets,
})
$goto(`./datasource/${resp._id}`)
notifications.success(`Datasource created successfully.`)
} catch (err) {
@ -150,9 +153,7 @@
<Layout noPadding no>
<Body size="S">Select which spreadsheets you want to connect.</Body>
{#each allSheets as sheet}
{sheet}
{/each}
<FancyCheckboxGroup options={allSheets} bind:selected={selectedSheets} />
</Layout>
{/if}
</ModalContent>

View File

@ -274,10 +274,6 @@ class GoogleSheetsIntegration implements DatasourcePlus {
}
async buildSchema(datasourceId: string, entities: Record<string, Table>) {
// not fully configured yet
if (!this.config.auth) {
return
}
await this.connect()
const sheets = this.client.sheetsByIndex
const tables: Record<string, Table> = {}