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(core): allow _projectId and _strengthOnPublish in templates #5942

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

ricokahler
Copy link
Contributor

Description

A simple follow up to #5889 and adds _projectId and _strengthOnPublish.

This is the PR description from #5889:

It is currently not possible to create a cross-dataset reference from an initial value template, as the template validation runs and disallows unknown properties on references, where _dataset was not an allowed prop.

Perhaps we should recurse down the type chain to look for a field that extends from crossDatasetReference, but this is beyond what we do for other types - eg we do not check for a reference type when encountering _ref. Leaving this for a future iteration to improve on if we feel it is worth it.

What to review

  • Can actually create a cross-dataset reference from an initial value template

Testing

I actually tested this one manually and added fields for initial templates in our test studio.

Notes for release

@ricokahler ricokahler requested a review from a team as a code owner March 10, 2024 16:31
@ricokahler ricokahler requested review from binoy14 and removed request for a team March 10, 2024 16:31
Copy link

vercel bot commented Mar 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Mar 11, 2024 3:22pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 11, 2024 3:22pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Mar 11, 2024 3:22pm

@ricokahler ricokahler changed the title fix(core): allow _projectId in initial value templates fix(core): allow _projectId and _strengthOnPublish in initial value templates Mar 10, 2024
@ricokahler ricokahler changed the title fix(core): allow _projectId and _strengthOnPublish in initial value templates fix(core): allow _projectId and _strengthOnPublish in templates Mar 10, 2024
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Mar 10, 2024

Component Testing Report Updated Mar 11, 2024 3:26 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 30s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 5s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 58s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 59s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 19s 9 0 0

Copy link
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

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

🙏

@rexxars
Copy link
Member

rexxars commented Mar 11, 2024

If time, it would be nice to extend these tests to also check for allowed _projectId etc.

@ricokahler ricokahler added this pull request to the merge queue Mar 11, 2024
Merged via the queue into next with commit 5adca88 Mar 11, 2024
36 checks passed
@ricokahler ricokahler deleted the fix/sdx-1147/allow-project-id branch March 11, 2024 15:34
ninaandal pushed a commit that referenced this pull request Mar 12, 2024
…5942)

* fix(core): allow `_projectId` and `_strengthOnPublish` in templates

* test(core): add _projectId and _strengthOnPublish to templates test
juice49 pushed a commit that referenced this pull request Mar 13, 2024
…5942)

* fix(core): allow `_projectId` and `_strengthOnPublish` in templates

* test(core): add _projectId and _strengthOnPublish to templates test
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.

None yet

2 participants