diff --git a/packages/bbui/src/ActionButton/ActionButton.svelte b/packages/bbui/src/ActionButton/ActionButton.svelte index b518ac3d92..5ab7a7f047 100644 --- a/packages/bbui/src/ActionButton/ActionButton.svelte +++ b/packages/bbui/src/ActionButton/ActionButton.svelte @@ -80,4 +80,8 @@ .active svg { color: var(--spectrum-global-color-blue-600); } + + .spectrum-ActionButton-label { + padding-bottom: 2px; + } diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte index 1b20091fbf..0f1e6335dd 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte @@ -1,6 +1,5 @@ @@ -118,15 +141,17 @@ Tables - - - Fetch tables from database - - + + Fetch tables from database + + + Create new table + @@ -142,18 +167,15 @@ onConfirm={datasources.removeSchemaError} /> {/if} - - {#each plusTables as table} - onClickTable(table)}> - {table.name} - Primary Key: {table.primary} - → - - {/each} - - Create new table - - + onClickTable(detail)} + schema={tableSchema} + data={Object.values(plusTables)} + allowEditColumns={false} + allowEditRows={false} + allowSelectRows={false} + customRenderers={[{ column: "primary", component: ArrayRenderer }]} +/> {#if plusTables?.length !== 0} @@ -170,20 +192,14 @@ Tell budibase how your tables are related to get even more smart features. {/if} - - {#each Object.values(relationships) as relationship} - openRelationshipModal(relationship.from, relationship.to)} - > - - {buildRelationshipDisplayString(relationship.from, relationship.to)} - - {relationship.from?.name} to {relationship.to?.name} - → - - {/each} - + openRelationshipModal(detail.from, detail.to)} + schema={relationshipSchema} + data={relationshipInfo} + allowEditColumns={false} + allowEditRows={false} + allowSelectRows={false} +/> diff --git a/packages/builder/src/components/common/ArrayRenderer.svelte b/packages/builder/src/components/common/ArrayRenderer.svelte new file mode 100644 index 0000000000..166a6ae180 --- /dev/null +++ b/packages/builder/src/components/common/ArrayRenderer.svelte @@ -0,0 +1,5 @@ + + +{Array.isArray(value) ? value.join(", ") : value} diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/VerbRenderer.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/VerbRenderer.svelte new file mode 100644 index 0000000000..ea065d217c --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/VerbRenderer.svelte @@ -0,0 +1,6 @@ + + +{capitalise(value)} diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte index fb5dd6224e..f7d20ff8ab 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte @@ -8,18 +8,23 @@ Layout, notifications, ActionButton, + Table, } from "@budibase/bbui" import { datasources, integrations, queries, tables } from "stores/backend" import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte" import RestExtraConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/RestExtraConfigForm.svelte" import PlusConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/PlusConfigForm.svelte" import ICONS from "components/backend/DatasourceNavigator/icons" + import VerbRenderer from "./_components/VerbRenderer.svelte" import { IntegrationTypes } from "constants" - import { capitalise } from "helpers" import { isEqual } from "lodash" import { cloneDeep } from "lodash/fp" let baseDatasource, changed + const querySchema = { + name: {}, + queryVerb: { displayName: "Method" }, + } $: datasource = $datasources.list.find(ds => ds._id === $datasources.selected) $: integration = datasource && $integrations[datasource.source] @@ -31,12 +36,14 @@ baseDatasource = cloneDeep(datasource) } } + $: queryList = $queries.list.filter( + query => query.datasourceId === datasource?._id + ) $: hasChanged(baseDatasource, datasource) function hasChanged(base, ds) { if (base && ds) { changed = !isEqual(base, ds) - console.log(ds) } } @@ -103,15 +110,19 @@ query is a request for data or information from a datasource, for example a database table.
{table.name}
Primary Key: {table.primary}
→
- {buildRelationshipDisplayString(relationship.from, relationship.to)} -
{relationship.from?.name} to {relationship.to?.name}