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:
Rijk van Zanten
2020-06-04 18:28:12 -04:00
committed by GitHub
parent 2e6d7392c6
commit df3f6edf83
15 changed files with 990 additions and 13 deletions

View File

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