From e6f3a04b4f532749a0f0517cd23f3b7e611576a2 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 23 Jun 2021 14:29:40 +0100 Subject: [PATCH] started on opinionated relationships --- .../CreateEditRelationship.svelte | 79 +++++++++++++++++++ .../[selectedDatasource]/index.svelte | 61 +++++++++++--- 2 files changed, 127 insertions(+), 13 deletions(-) create mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship.svelte new file mode 100644 index 0000000000..b9f6dbf092 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship.svelte @@ -0,0 +1,79 @@ + + + + {#if step === 0} + Select your table + {:else if step === 1} + + Step 2 + {:else if step === 2} + Step 3 + {/if} + + + \ No newline at end of file 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 f805a5724f..b5a084120e 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 @@ -1,16 +1,19 @@ + + + + {#if datasource && integration}
@@ -100,19 +111,43 @@ having to write any queries at all.
- {#if datasource.entities} - {#each Object.keys(datasource.entities) as entity} -
onClickTable(datasource.entities[entity])} - > -

{entity}

-

Primary Key: {datasource.entities[entity].primary}

-

-
- {/each} - {/if} + {#each plusTables as table} +
onClickTable(table)} + > +

{table.name}

+

Primary Key: {table.primary}

+

+
+ {/each}
+ + +
+ Relationships + +
+ + Tell budibase how your tables are related to get even more smart features. + +
+ {#each plusTables as table} + {#each Object.keys(table) as column} + {#if table[column].type === "link"} +
onClickTable(table[column])} + > +

{table[column].name}

+

Primary Key: {table[column].primary}

+

+
+ {/if} + {/each} + {/each} +
+ {/if}