Merge pull request #2095 from appwrite/fix-broken-relationship-modal

This commit is contained in:
Darshan
2025-07-08 18:56:00 +05:30
committed by GitHub
2 changed files with 10 additions and 4 deletions
@@ -23,7 +23,11 @@
selectedRelationship = null;
}
$: tableColumns = [{ id: '$id', width: 200 }, ...args.map((id) => ({ id }))];
$: tableColumns = [
// take full width if no display names set
{ id: '$id', width: args.length ? 200 : undefined },
...args.map((id) => ({ id }))
];
</script>
<Modal bind:show title={selectedRelationship?.key} hideFooter>
@@ -33,7 +37,7 @@
<Table.Root let:root columns={tableColumns}>
<svelte:fragment slot="header" let:root>
<Table.Header.Cell column="$id" {root}>Document ID</Table.Header.Cell>
{#if args?.length}
{#if args.length}
{#each args as arg}
<Table.Header.Cell column={arg} {root}>{arg}</Table.Header.Cell>
{/each}
@@ -47,7 +51,7 @@
<Table.Cell column="$id" {root}>
<Id value={doc.$id}>{doc.$id}</Id>
</Table.Cell>
{#if args?.length}
{#if args.length}
{#each args as arg}
<Table.Cell column={arg} {root}>{doc[arg]}</Table.Cell>
{/each}
@@ -73,7 +73,9 @@
(names?.length && !last(names))
);
const hasExhaustedOptions = $derived(getValidAttributes().length === names?.length);
const hasExhaustedOptions = $derived(
getValidAttributes().length === names.filter(Boolean).length
);
</script>
<Form onSubmit={updateDisplayName}>