diff --git a/packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte b/packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte new file mode 100644 index 0000000000..7a1ebbed78 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte @@ -0,0 +1,32 @@ + + +{#if record && record._id === recordId} + +{/if} diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 3e5905c17a..0852a64097 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -1,5 +1,5 @@ @@ -46,66 +50,68 @@

{title}

- +
- - {#if allowEditing} - - {/if} - {#each columns as header} - - {/each} - + + {#if allowEditing} + + {/if} + {#each columns as header} + + {/each} + - {#if paginatedData.length === 0} + {#if paginatedData.length === 0} + {#if allowEditing} + + {/if} + {#each columns as header, idx} + + {/each} + {/if} + {#each paginatedData as row} + {#if allowEditing} - + {/if} - {#each columns as header, idx} - {/each} - {/if} - {#each paginatedData as row} - - {#if allowEditing} - - {/if} - {#each columns as header} - - {/each} - - {/each} + + {/each}
-
Edit
-
- {#if allowEditing} - - {:else}{header}{/if} -
+
Edit
+
+ {#if allowEditing} + + {:else} +
{header}
+ {/if} +
No data. + {#if idx === 0}No data.{/if} +
No data. + + - {#if idx === 0}No data.{/if} + {#each columns as header} + + {#if schema[header].type === 'link'} +
selectRelationship(row, header)}> + {row[header] ? row[header].length : 0} linked row(s) +
+ {:else if schema[header].type === 'attachment'} + + {:else}{getOr('', header, row)}{/if}
- - - {#if schema[header].type === 'link'} - - {:else if schema[header].type === 'attachment'} - - {:else}{getOr('', header, row)}{/if} -
+ {data} + bind:currentPage + pageItemCount={paginatedData.length} + {ITEMS_PER_PAGE}/>