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(schema): use base type title if no subtype title or name is given #6947

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Jun 14, 2024

Description

In certain UI locations, especially for array members, image and files would be listed without a title, or using the type name (image) when the member declaration is simply: {type: 'image'}.

This PR ensures that we fall back to the base types' title.

I also modified the object to use the same approach, but I think this one is more theoretical, since we require a name for objects.

What to review

  • Code looks good
  • "Add item" menus lists images and files correctly (there's a "Array of multiple types" field that has this in the test studio)

Testing

Added new tests to ensure no regressions.
Also did some manual testing.

Notes for release

  • Fixes a case where image and file types might be listed in their lowercase variant in array insert menus

Copy link

vercel bot commented Jun 14, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 6:35pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 6:35pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 6:35pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 6:35pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 6:35pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Jun 14, 2024 6:35pm

@rexxars rexxars marked this pull request as ready for review June 14, 2024 18:36
@rexxars rexxars requested a review from a team as a code owner June 14, 2024 18:36
@rexxars rexxars requested review from binoy14 and removed request for a team June 14, 2024 18:36
Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Jun 14, 2024 6:45 PM (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) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 44s 2 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 34s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 15s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 4s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 20s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 28s 12 0 0

@rexxars rexxars requested review from bjoerge June 14, 2024 18:53
Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

Compared in next vs preview test studio and this looks good. Thanks!

@rexxars rexxars added this pull request to the merge queue Jun 14, 2024
Merged via the queue into next with commit bbe7ac0 Jun 14, 2024
44 checks passed
@rexxars rexxars deleted the fix/schema-extension-missing-title branch June 14, 2024 19:03
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