Feature(s) impacted
Nested fields display in Forest Admin collections
Observed behavior
Since recent updates, the letter_params
field is no longer displayed as a structured object with individual subfields in the Forest Admin UI. Instead, it appears as a flat JSON block.
Expected behavior
letter_params
should be rendered in the UI as a structured and readable set of subfields, as it was prior to the updates. Each nested property (e.g. description
, postage_type
, etc.) should be visible and editable individually.
Failure Logs
No relevant failure logs or errors observed in the backend or browser console. The issue appears to be a UI rendering regression rather than a runtime error.
Context
- Project name: MySendingBox
- Environment name: Staging (reproducible in other environments as well)
- Database type: MongoDB
- Recent changes made on your end if any: * * Upgraded
- Mongoose** from version
5.13.22
to7.8.7
- Upgraded forest-express-mongoose from
9.3.25
to9.6.0
- Updated the
GroupedSentSchema
Mongoose model to replace aMixed
type:
- Mongoose** from version
export const GroupedSentSchema: Record<string, any> = {
...
letter_params: { type: Schema.Types.Mixed },
...
}
with a proper nested schema:
export const GroupedSentSchema: SchemaDefinition<IGroupedSentModel> = {
...
letter_params: LetterParamsSchema,
...
}
where LetterParamsSchema
is
export const LetterParamsSchema: SchemaDefinition<ILetterParams> = {
description: String,
expected_sending_date: Date,
...
postage_type: {
type: String,
enum: ['ecopli', 'verte', 'prioritaire', 'suivie', 'lr', 'lrar', 'email', ...],
default: 'ecopli',
},
...
}