use the presentable prop when displaying relations
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
{#if expanded.length}
|
||||
{#each expanded.slice(0, relLimit) as item, i (i + item)}
|
||||
<span class="label">
|
||||
<RecordInfo record={item} displayFields={field.options?.displayFields} />
|
||||
<RecordInfo record={item} />
|
||||
</span>
|
||||
{/each}
|
||||
{:else}
|
||||
|
||||
@@ -5,19 +5,14 @@
|
||||
import RecordFileThumb from "@/components/records/RecordFileThumb.svelte";
|
||||
|
||||
export let record;
|
||||
export let displayFields = [];
|
||||
|
||||
$: collection = $collections?.find((item) => item.id == record?.collectionId);
|
||||
|
||||
$: fileDisplayFields =
|
||||
displayFields?.filter((name) => {
|
||||
return !!collection?.schema?.find((field) => field.name == name && field.type == "file");
|
||||
}) || [];
|
||||
collection?.schema?.filter((f) => f.presentable && f.type == "file")?.map((f) => f.name) || [];
|
||||
|
||||
$: textDisplayFields =
|
||||
(!fileDisplayFields.length
|
||||
? displayFields
|
||||
: displayFields?.filter((name) => !fileDisplayFields.includes(name))) || [];
|
||||
collection?.schema?.filter((f) => f.presentable && f.type != "file")?.map((f) => f.name) || [];
|
||||
</script>
|
||||
|
||||
<div class="record-info">
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
$: collectionId = field?.options?.collectionId;
|
||||
|
||||
$: displayFields = field?.options?.displayFields;
|
||||
|
||||
$: collection = $collections.find((c) => c.id == collectionId) || null;
|
||||
|
||||
$: if (typeof filter !== "undefined" && pickerPanel?.isActive()) {
|
||||
@@ -252,7 +250,7 @@
|
||||
<i class="ri-checkbox-blank-circle-line txt-disabled" />
|
||||
{/if}
|
||||
<div class="content">
|
||||
<RecordInfo {record} {displayFields} />
|
||||
<RecordInfo {record} />
|
||||
</div>
|
||||
{#if !isView}
|
||||
<div class="actions nonintrusive">
|
||||
@@ -301,7 +299,7 @@
|
||||
{#each selected as record, i}
|
||||
<Draggable bind:list={selected} index={i} let:dragging let:dragover>
|
||||
<span class="label" class:label-danger={dragging} class:label-warning={dragover}>
|
||||
<RecordInfo {record} {displayFields} />
|
||||
<RecordInfo {record} />
|
||||
<button
|
||||
type="button"
|
||||
title="Remove"
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
>
|
||||
<div class="list-item" class:dragging class:dragover>
|
||||
<div class="content">
|
||||
<RecordInfo {record} displayFields={field.options?.displayFields} />
|
||||
<RecordInfo {record} />
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user