First PR, happy to receive any additional pushes, and sorry for any inconsistencies.
This allows a user to see the default fields for a new or existing document, choose to "override" the defaults, and revert back to the default at any time. The way I accomplished this in general was by removing the StaticMetaFields component, and instead allowing MetaFields to display both default and additional fields. By checking the redux store (specifically the metadata: { metadata:{} } object), the MetaFields component will render each field as either a Static or regular MetaField, and by passing in props, each subcomponent is able to tell whether it is a default field, and whether it is currently in "default mode".
Choosing to "override" a default simply adds that key/value to the metadata redux object, allowing it to be rendered as a regular MetaField. "Reverting" it simply removes it, and it goes back to being rendered as a StaticMetaField.
Note: I updated snapshot testing and added action/reducer tests, but added no unit tests. I'd appreciate any help or direction on that, if you feel we need them. Thanks again.
Resolves #596
First PR, happy to receive any additional pushes, and sorry for any inconsistencies.
This allows a user to see the default fields for a new or existing document, choose to "override" the defaults, and revert back to the default at any time. The way I accomplished this in general was by removing the
StaticMetaFields
component, and instead allowingMetaFields
to display both default and additional fields. By checking the redux store (specifically themetadata: { metadata:{} }
object), theMetaFields
component will render each field as either aStatic
or regularMetaField
, and by passing in props, each subcomponent is able to tell whether it is a default field, and whether it is currently in "default mode".Choosing to "override" a default simply adds that key/value to the metadata redux object, allowing it to be rendered as a regular
MetaField
. "Reverting" it simply removes it, and it goes back to being rendered as aStaticMetaField
.Note: I updated snapshot testing and added action/reducer tests, but added no unit tests. I'd appreciate any help or direction on that, if you feel we need them. Thanks again.