address comment.

This commit is contained in:
Darshan committed 2025-09-11 15:47:42 +05:30
1 parent df5f5d65d2
commit 153df8193e
2 files changed
+11 -7

No files matched your search

@@ -41,9 +41,7 @@
tables: []
});
const sortedTables = $derived.by(() =>
tables?.tables?.slice().sort((a, b) => a.name.localeCompare(b.name))
);
const sortedTables = $derived.by(() => tables?.tables);
const selectedTable = $derived.by(() =>
sortedTables?.find((table: Models.Table) => table.$id === tableId)
@@ -342,10 +342,16 @@
<Skeleton variant="line" height={40} width="auto" />
</div>
{:else if relatedTable?.columns?.length && fetchedRows.length}
{@const twoWayColumnKey = relatedTable.columns.find(
(col: Models.ColumnRelationship) => col.twoWay
)?.key}
{@const columnsToRender = relatedTable.columns.filter((col) => col.key !== twoWayColumnKey)}
<!-- we should not show current table column items in this view -->
{@const twoWayKeys = new Set(
relatedTable
.columns
.filter((column: Models.ColumnRelationship) => column.twoWay)
.map((c) => c.key)
)}
<!-- render the filtered ones -->
{@const columnsToRender = relatedTable.columns.filter((c) => !twoWayKeys.has(c.key))}
<div bind:this={columnFormWrapper}>
{#if fetchedRows.length === 1}