1
0
Fork 0
mirror of synced 2024-07-19 21:26:22 +12:00

Display sheets

This commit is contained in:
Adria Navarro 2023-06-06 13:55:30 +01:00
parent 39848eef07
commit b128bdece5

View file

@ -47,7 +47,7 @@
let isValid = false
let sheets
let allSheets
const saveDatasourceAndRedirect = async () => {
try {
@ -85,14 +85,14 @@
}
const info = await getDatasourceInfo(datasource)
sheets = info.tableNames
allSheets = info.tableNames
step = GoogleDatasouceConfigStep.SET_SHEETS
notifications.success(
checkConnection
? "Connection Successful"
: `Datasource created successfully.`
)
step = GoogleDatasouceConfigStep.SET_SHEETS
notifications.success(
checkConnection
? "Connection Successful"
: `Datasource created successfully.`
)
// prevent the modal from closing
return false
@ -101,7 +101,9 @@
[GoogleDatasouceConfigStep.SET_SHEETS]: {
title: `Choose your sheets`,
confirmButtonText: "Fetch sheets",
onConfirm: saveDatasourceAndRedirect,
onConfirm: async () => {
await saveDatasourceAndRedirect()
},
},
}
</script>
@ -147,6 +149,10 @@
{#if step === GoogleDatasouceConfigStep.SET_SHEETS}
<Layout noPadding no>
<Body size="S">Select which spreadsheets you want to connect.</Body>
{#each allSheets as sheet}
{sheet}
{/each}
</Layout>
{/if}
</ModalContent>