mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
Display template display template display (#551)
* Add util to find related collection * Allow display.fields to be function * Return fixed relation for user types * Pass type / collection / field to displays * Add template display * Finish display template display template display
This commit is contained in:
@@ -47,6 +47,18 @@ export const useRelationsStore = createStore({
|
||||
] as Relation[];
|
||||
}
|
||||
|
||||
if (['user', 'user_created', 'user_updated', 'owner'].includes(fieldInfo.type)) {
|
||||
return [
|
||||
{
|
||||
collection_many: collection,
|
||||
field_many: field,
|
||||
collection_one: 'directus_users',
|
||||
field_one: null,
|
||||
junction_field: null,
|
||||
},
|
||||
] as Relation[];
|
||||
}
|
||||
|
||||
return this.getRelationsForCollection(collection).filter((relation: Relation) => {
|
||||
return relation.field_many === field || relation.field_one === field;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user