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

feat: add resource link support and validation #1124

Merged
merged 10 commits into from
Oct 7, 2022
Merged

Conversation

veu
Copy link
Contributor

@veu veu commented Oct 4, 2022

Summary

Add support for resource links.

Description

  • Add ResourceLink field type
  • Add allowedResources field property
  • Validate resource link and allowed resource count
  • Validate allowedResources structure

@veu veu requested a review from a team as a code owner October 4, 2022 11:08
src/lib/interfaces/content-type.ts Outdated Show resolved Hide resolved
src/lib/offline-api/validator/schema/schema-validation.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Silhoue Silhoue left a comment

Choose a reason for hiding this comment

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

Some nits, looks good otherwise

docs/validation.md Show resolved Hide resolved
src/lib/offline-api/validator/errors.ts Outdated Show resolved Hide resolved
src/lib/offline-api/validator/errors.ts Show resolved Hide resolved
src/lib/offline-api/validator/errors.ts Outdated Show resolved Hide resolved
src/lib/offline-api/validator/errors.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ruderngespra ruderngespra left a comment

Choose a reason for hiding this comment

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

This is awesome! 🎉
I have a few questions / confusions, other than that very happy about this addition, I learned a lot about resourceLinks reading this PR.

In general, I understand correctly that this PR mainly "just" introduces one a new field type and its related additional validations which are encapsulated in the ResourceLinksValidator, correct?

docs/validation.md Outdated Show resolved Hide resolved
docs/validation.md Show resolved Hide resolved
examples/47-create-resource-link-fields.js Show resolved Hide resolved
src/lib/intent-validator/field-update.ts Outdated Show resolved Hide resolved
src/lib/offline-api/validator/errors.ts Outdated Show resolved Hide resolved
src/lib/utils/resource-links.ts Show resolved Hide resolved
test/end-to-end/content-type.spec.js Outdated Show resolved Hide resolved
@veu veu merged commit e5a5ea1 into master Oct 7, 2022
@veu veu deleted the feat/resource-links branch October 7, 2022 06:53
@contentful-automation
Copy link

🎉 This PR is included in version 4.12.0 🎉

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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants