fix: from QA relation in table and redirect link

This commit is contained in:
Arman committed 2023-04-04 14:08:07 +02:00
1 parent 21807dc2b8
commit 8131fce59b
2 files changed
+6 -4

No files matched your search

@@ -30,7 +30,7 @@
<ClickableList>
{#each paginatedItems as doc}
<ClickableListItem
href={`${base}/console/project-${projectId}/databases/database-${databaseId}/collection-${selectedRelationship.relatedCollection}`}
href={`${base}/console/project-${projectId}/databases/database-${databaseId}/collection-${selectedRelationship.relatedCollection}/document-${doc.$id}`}
on:click={() => (show = false)}>
{#if args?.length}
{#each args as arg, i}
@@ -19,7 +19,7 @@
import type { Models } from '@appwrite.io/console';
import { onMount } from 'svelte';
import type { PageData } from './$types';
import { isRelationship } from './document-[document]/attributes/store';
import { isRelationship, isRelationshipToMany } from './document-[document]/attributes/store';
import RelationshipsModal from './relationshipsModal.svelte';
import { attributes, collection, columns } from './store';
@@ -114,14 +114,16 @@
{@const args = $teamPrefs?.displayNames?.[attr.relatedCollection] ?? [
'$id'
]}
{#if attr?.relationType === 'oneToOne' || attr?.relationType === 'manyToOne'}
{#if !isRelationshipToMany(attr)}
<TableCell title={column.title}>
<button
class="link u-flex u-gap-4 u-padding-block-8"
type="button"
on:click|preventDefault|stopPropagation={() =>
goto(
`${base}/console/project-${projectId}/databases/database-${databaseId}/collection-${attr.relatedCollection}`
`${base}/console/project-${projectId}/databases/database-${databaseId}/collection-${
attr.relatedCollection
}/document-${document[column.id].$id}`
)}>
{#each args as arg, i}
{#if arg !== undefined}