diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index 52051fe134..e9d23ff0c7 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -1,14 +1,7 @@ - - - - - datasourcePlus ? saveDatasource() : fetchTablesModal.show()} - confirmText={datasourcePlus ? "Connect" : "Save and continue to query"} - cancelText="Back" + {title} + onConfirm={() => nextStep()} + {confirmText} + cancelText={fetchTableStep ? "Cancel" : "Back"} showSecondaryButton={datasourcePlus} size="L" disabled={!isValid} > - - Connect your database to Budibase using the config below. - - - (isValid = e.detail)} - /> + {#if !fetchTableStep} + + Connect your database to Budibase using the config below. + + + (isValid = e.detail)} + /> + {:else} + Some stuff here + {/if} diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte deleted file mode 100644 index 41a1f2d2d0..0000000000 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte +++ /dev/null @@ -1,21 +0,0 @@ - - - prevModal.show()} - confirmText="Continue" - cancelText="Back" - size="L" - disabled={selected.length === 0} -> - SOME TABLES HERE - diff --git a/packages/frontend-core/src/api/datasources.js b/packages/frontend-core/src/api/datasources.js index 16d19c512f..f7554f64b0 100644 --- a/packages/frontend-core/src/api/datasources.js +++ b/packages/frontend-core/src/api/datasources.js @@ -69,4 +69,15 @@ export const buildDatasourceEndpoints = API => ({ body: { datasource }, }) }, + + /** + * Fetch table names available within the datasource, for filtering out undesired tables + * @param datasource the datasource configuration to use for fetching tables + */ + fetchTablesForDatasource: async datasource => { + return await API.post({ + url: `/api/datasources/tables`, + body: { datasource }, + }) + }, })