diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte new file mode 100644 index 0000000000..cbab467e40 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte @@ -0,0 +1,156 @@ + + + + + +
+ + + {#each tables as table} + (relationship.from = table)}> + {table.name} + {#if relationship.from?._id === table._id} + + {/if} + + {/each} + + + + + {#each tables as table} + (relationship.to = table)}> + {table.name} + {#if relationship.to?._id === table._id} + + {/if} + + {/each} + + +
+ + {#if relationship.from && relationship.to} +
+ option.name} + getOptionValue={option => option.value} + /> +
+ {/if} + + {#if relationship?.relationshipType === RelationshipTypes.MANY_TO_MANY} + + + {#each tables as table} + (relationship.through = table)}> + {table.name} + {#if relationship.through?._id === table._id} + + {/if} + + {/each} + + + + {#if relationship.through} +
+ + + {#each Object.keys(relationship.through) as column} + (relationship.through.from = column)}> + {column} + {#if relationship.through.from?._id === column._id} + + {/if} + + {/each} + + + + + {#each Object.keys(relationship.through) as column} + (relationship.through.to = column)}> + {column} + {#if relationship.through.to?._id === column._id} + + {/if} + + {/each} + + +
+ {/if} + {/if} +
+ + \ No newline at end of file diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/TableSelect.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/TableSelect.svelte new file mode 100644 index 0000000000..8d4613e0b5 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/TableSelect.svelte @@ -0,0 +1,21 @@ + + + + + {#each tables as table} + select(table)}> + {table.name} + {#if selected} + + {/if} + + {/each} + + \ No newline at end of file