sanity icon indicating copy to clipboard operation
sanity copied to clipboard

feat: added string/text to block converters

Open RostiMelk opened this issue 1 year ago • 3 comments

Description

Added converter for when a schema field changes type from string/text to portable text

To check if the field is of type block and not just array we need to check it in the MemberFieldError component. This is checked by seeing if any of the objects in the array is of type "block".

What to review

  • Create a field of type string/test
  • Add content to the field
  • Publish document
  • Change field type to array with of type 'block'
  • You should now see a "Convert to portableText" button
  • Click it
  • The data should be transformed into portable text spans

For text that is multiline, there should be multiple portable text spans.

Notes for release

tbd

RostiMelk avatar Nov 28 '23 14:11 RostiMelk

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

Name Status Preview Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Nov 28, 2023 2:22pm
test-studio ✅ Ready (Inspect) Visit Preview Nov 28, 2023 2:22pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Nov 28, 2023 2:22pm

vercel[bot] avatar Nov 28 '23 14:11 vercel[bot]

No changes to documentation

github-actions[bot] avatar Nov 28 '23 14:11 github-actions[bot]

Component Testing Report Updated Nov 28, 2023 2:27 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 17s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 2s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 6s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 16s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 8s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 39s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 6s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 3s 3 0 0

github-actions[bot] avatar Nov 28 '23 14:11 github-actions[bot]