From b128bdece5f24fb28f6e744a8f8850719210f18e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 6 Jun 2023 13:55:30 +0100 Subject: [PATCH] Display sheets --- .../modals/GoogleDatasourceConfigModal.svelte | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte index d01ae3de05..a98b76483d 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/GoogleDatasourceConfigModal.svelte @@ -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() + }, }, } @@ -147,6 +149,10 @@ {#if step === GoogleDatasouceConfigStep.SET_SHEETS} Select which spreadsheets you want to connect. + + {#each allSheets as sheet} + {sheet} + {/each} {/if}