Fix display of thumbnail with tabular layout in File Library (#19483)

* Fix display of thumbnail with tabular layout in File Library

* Add changeset

* Update comment

Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>

---------

Co-authored-by: Daniel Biegler <DanielBiegler@users.noreply.github.com>
This commit is contained in:
Pascal Jufer
2023-08-21 16:00:10 +02:00
committed by GitHub
parent 0414fd87ff
commit dbd56a40ed
2 changed files with 12 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
---
"@directus/app": patch
---
Fixed display of thumbnail using tabular layout in File Library

View File

@@ -111,11 +111,13 @@ export function useAliasFields(
function getFromAliasedItem<K, T extends Record<string, K>>(item: T, key: string): K | undefined {
const aliasInfo = Object.values(aliasedFields.value).find((field) => field.key === key);
// Skip any fields prefixed with $ as they dont exist. ($thumbnail as an example)
key = key
.split('.')
.filter((k) => !k.startsWith('$'))
.join('.');
// Skip any nested fields prefixed with $ as they dont exist. ($thumbnail as an example)
key = key.includes('.')
? key
.split('.')
.filter((k) => !k.startsWith('$'))
.join('.')
: key;
if (!aliasInfo || !aliasInfo.aliased) return get(item, key);