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(structure): allow search/list ignored types when explicitly requested #6771

Merged
merged 1 commit into from
May 29, 2024

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented May 24, 2024

Description

We previously allowed users to list assets in the structure tool by using a S.documentTypeList('sanity.imageAsset'), but during search refactoring this seems to no longer be possible.

This reintroduces the ability, by ensuring that the getSearchableTypes() does not remove explicitly declared types.

What to review

  • In the test studio, observe that in next, the document list under Custom panes > Images does not list images, and that the preview deploy of this does
  • Check that the "all document types" custom pane in test studio does not list image and file asset types, as well as the global search not including these types.

Testing

I attempted to test the actual listenSearchQuery() function, but it has a lot of dependencies and was not easy to mock out a client for. An alternative would be to do an e2e test, but I would prefer us to have a more stable environment we can test against, to ensure we have assets that can be listed. I'll make a note of it for future iterations of the E2E suite.

For now, I added some tests for the getSearchableTypes function, which at least increases test coverage of that part of the codebase.

Notes for release

  • Fixes an issue where structure lists would not list image/file assets if told to do so

@rexxars rexxars requested a review from a team May 24, 2024 22:44
@rexxars rexxars requested a review from a team as a code owner May 24, 2024 22:44
@rexxars rexxars requested review from sjelfull and binoy14 and removed request for a team May 24, 2024 22:44
Copy link

vercel bot commented May 24, 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 May 24, 2024 10:44pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 10:44pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 10:44pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 10:44pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) May 24, 2024 10:44pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated May 24, 2024 10:53 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) 25s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 17s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 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) 29s 12 0 0

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.

Makes sense to me, thanks!

@rexxars rexxars added this pull request to the merge queue May 29, 2024
Merged via the queue into next with commit 5b66664 May 29, 2024
43 checks passed
@rexxars rexxars deleted the fix/structure-explicit-allow-types branch May 29, 2024 22:22
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