[#7260] print nested presentable multiple relation fields

This commit is contained in:
Gani Georgiev
2025-10-17 14:43:36 +03:00
parent 52a53b5b91
commit 91b521595a
35 changed files with 316 additions and 277 deletions

View File

@@ -14,13 +14,13 @@
}
</script>
<div class="record-info">
<div class="record-info-excerpt">
<RecordInfoContent {record} />
<a
href="#/collections?collection={record.collectionId}&recordId={record.id}"
target="_blank"
class="inline-flex link-hint"
class="external-record-link link-hint"
rel="noopener noreferrer"
use:tooltip={{
text:
@@ -39,16 +39,3 @@
<i class="ri-external-link-line txt-sm"></i>
</a>
</div>
<style lang="scss">
.record-info {
display: inline-flex;
vertical-align: top;
align-items: center;
justify-content: center;
max-width: 100%;
min-width: 0;
gap: 5px;
padding-left: 1px; // for visual alignment with the new tab icon
}
</style>

View File

@@ -53,7 +53,14 @@
{#if i > 0},{/if}
{#if field.type == "relation" && record.expand?.[field.name]}
<RecordInfoContent bind:record={record.expand[field.name]} />
{@const isMultiple = Array.isArray(record.expand?.[field.name])}
{@const expands = CommonHelper.toArray(record.expand?.[field.name])}
{#if isMultiple}[{/if}
{#each expands as expandRecord, j}
{#if j > 0}&nbsp;&nbsp;&nbsp;{/if}
<RecordInfoContent record={expandRecord} />
{/each}
{#if isMultiple}]{/if}
{:else if field.type == "geoPoint"}
<GeoPointValue value={record[field.name]} />
{:else}