Skip to content

Conversation

@triozer
Copy link
Member

@triozer triozer commented Mar 15, 2025

Closes https://github.com/framer/company/issues/32023

Description

This pull request ensure we export the collection slug field name (when available) instead of Slug.

Testing

  • Add a sample Blog CMS
  • Change the name of the Slug field
  • Export the Collection
  • Ensure that the first field has the correct name

Signed-off-by: Cédric Boirard <[email protected]>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement

@triozer triozer merged commit fbe3e56 into main Mar 17, 2025
1 check passed
@triozer triozer deleted the fix/cms-export branch March 17, 2025 14:08

for (const field of supportedFields) {
const value = item.fieldData[field.id]
const fieldData = item.fieldData[field.id]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: fieldDataEntry 😛 (for some follow-up PR, if any)

const fieldData = item.fieldData[field.id]

switch (field.type) {
switch (fieldData.type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe? May it not be undefined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before it could have been but since 3.0 with strictly typed FieldData, it should never happen

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fieldData.value may be undefined though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants