Closed nkulic closed 4 weeks ago
When using enumValues in a map property which is inside array (of) property, default enum value is not set.
Default enum value should be set.
I have created a repo with starter template and configured collection for reproduction of this issue:
Or manually create project with firecms template and modify collection config:
yarn create firecms-app or npx create-firecms-app
export const showcaseCollection = buildCollection({ path: "showcase", customId: false, icon: "ShowChart", name: "Showcase", hideIdFromForm: true, properties: { featuredProducts: buildProperty({ dataType: "array", name: "Featured products", of: { name: "Featured product", dataType: "map", properties: { size: buildProperty({ dataType: "string", name: "Size", defaultValue: "smallVertical", enumValues: { largeVertical: { id: "largeVertical", label: "Large vertical" }, smallVertical: { id: "smallVertical", label: "Small vertical" }, }, }), title: { name: "Product", dataType: "string", }, }, }, }), }, });
This should be fixed in the latest 3.0 versions :)
What is the current behavior?
When using enumValues in a map property which is inside array (of) property, default enum value is not set.
What is the expected behavior?
Default enum value should be set.
Reproduction steps
I have created a repo with starter template and configured collection for reproduction of this issue:
Or manually create project with firecms template and modify collection config:
Package versions used