mirror of
https://github.com/directus/directus.git
synced 2026-02-03 13:05:09 -05:00
Many to Many (#675)
* Start on files inteface * Return related m2m relation in store * Add useRelations to files * Fetch current items in files * Allow dot notation in table row * Render tableHeaders * Add file display * Register file display * Remove unused css * Rough in select modal * Start on saving selected items * Finish selecting existing item * Auto fix line width of file display * Rename var to be clearer * Rework to allow editing junctino row * Add support for junction fields in modal detail * Stage changes to existing items correctly * Show previously made edits in modal detail * Blammo bunch of changes, lets do m2m first * Stage newly created items * Stage newly created items * Add editing of newly added records * Stage new edits of existing items * Allow updating existing rows * Stage selection of newly selected items * Add fetching preview for related item * Allow for updating staged selected existing items * Fix nested m2o in m2m * Finish deep fetch of multi-related item * Finish deselecting of rows * Add a little note to future self
This commit is contained in:
@@ -14,6 +14,7 @@ export default function adjustFieldsForDisplays(fields: readonly string[], paren
|
||||
|
||||
const display = displays.find((d) => d.id === field.display);
|
||||
|
||||
if (!display) return fieldKey;
|
||||
if (!display?.fields) return fieldKey;
|
||||
|
||||
if (Array.isArray(display.fields)) {
|
||||
@@ -23,8 +24,8 @@ export default function adjustFieldsForDisplays(fields: readonly string[], paren
|
||||
if (typeof display.fields === 'function') {
|
||||
return display
|
||||
.fields(field.display_options, {
|
||||
collection: parentCollection,
|
||||
field: fieldKey,
|
||||
collection: field.collection,
|
||||
field: field.field,
|
||||
type: field.type,
|
||||
})
|
||||
.map((relatedFieldKey: string) => `${fieldKey}.${relatedFieldKey}`);
|
||||
|
||||
Reference in New Issue
Block a user