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:
Rijk van Zanten
2020-05-11 17:05:11 -04:00
committed by GitHub
parent 3aec11c42a
commit 5c00ddddb1
11 changed files with 279 additions and 33 deletions

View File

@@ -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;
});