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 _dataset for cross-dataset references in templates #5889

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Mar 2, 2024

Description

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 create a cross-dataset reference from an initial value template
  • Implementation looks acceptable

Testing

I added some surrounding tests not only for the _dataset case but also for other reference properties, as I could not find any tests for that code path.

Notes for release

  • Fixes an issue where initial value templates could not define a target dataset for cross-dataset references

@rexxars rexxars requested a review from a team as a code owner March 2, 2024 00:18
@rexxars rexxars requested review from cngonzalez and removed request for a team March 2, 2024 00:18
Copy link

vercel bot commented Mar 2, 2024

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

Name Status Preview Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Mar 2, 2024 0:18am
test-studio ✅ Ready (Inspect) Visit Preview Mar 2, 2024 0:18am
1 Ignored Deployment
Name Status Preview Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Mar 2, 2024 0:18am

Copy link
Contributor

github-actions bot commented Mar 2, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Mar 2, 2024

Component Testing Report Updated Mar 2, 2024 12:28 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 34s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 31s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 1s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 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 ❌ Failed (Inspect) 24s 8 0 1

Copy link
Member

@cngonzalez cngonzalez left a comment

Choose a reason for hiding this comment

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

LGTM!

@rexxars rexxars added this pull request to the merge queue Mar 4, 2024
Merged via the queue into next with commit 9fc34a2 Mar 4, 2024
40 checks passed
@rexxars rexxars deleted the fix/sdx-1147/allow-cdr-templates branch March 4, 2024 21:54
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.

2 participants