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