Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow asset links in entry types #1711

Merged
merged 1 commit into from Feb 23, 2023
Merged

fix: allow asset links in entry types #1711

merged 1 commit into from Feb 23, 2023

Conversation

veu
Copy link
Contributor

@veu veu commented Feb 22, 2023

Summary

Before this PR the entry types resolved all asset links to entries and entry links. Let’s fix that.

Description

  • Introduce EntryFields.EntryLink and EntryFields.AssetLink to distinguish between the different link types
  • Allow resolved assets and asset links in NewEntry type
  • Remove FieldType from generic entry types to indicate that the fields property can have different shapes
  • Allow JSON data in EntryFields.Object
  • Extract type tests mocks to separate file

}
const metadataValue = { tags: [] }
// @ts-ignore
import * as mocks from './mocks'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error is that we’re only allowed to import from lib where we definitely don’t want the mocks. I’m doing a * import to make sure I’m not hiding other errors like mock data not being exported.

@veu veu marked this pull request as ready for review February 22, 2023 13:53
Copy link
Contributor

@Cyberxon Cyberxon left a comment

Choose a reason for hiding this comment

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

Thank you for adding mocks and for the retyping effort! 💯 👍

@veu veu merged commit ef0dd0c into beta-v10 Feb 23, 2023
@veu veu deleted the fix-asset-link-types branch February 23, 2023 08:26
@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 10.0.0-beta-v10.16 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants