1
0
Fork 0
mirror of synced 2024-09-03 11:11:49 +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 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>