Review everything related to Editors / Modules
This issue is more abstract.
A review of the all the stuff related to editors/modules is needed. It's not very well commented but I would be happy to help explaining what is going on.
A Module
displays basically information corresponding to a Django model.
The Editor
can be thought as Form Manager. It contains Fields
.
Each module should have a custom editor.
You also have groupModules
to handle cases where you can have multiple times the same module (for example several CountryScholarships).
Few improvements I see:
- Remove all the
formManager={this}
(and addfield
/removeField
: theEditor
should be able to detect its field by looking through itsprops.children
- Instead of giving a
value
to a field and afieldMapping
, maybe give itmodelData
andfieldMapping
(it would reduce redundancy). Or better create a new prop and give it an array of [modelData
,fieldMapping
]. You would need to add a propextractValue
, a function that takesprops.modelData[props.fieldMapping]
and make the potential necessary conversions (e.g. dates). - Review the stuff related to
invalidate...
Edited by Florent Chehab