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(desk): fixes type for canHandleIntent in documentList #4969

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Conversation

binoy14
Copy link
Contributor

@binoy14 binoy14 commented Oct 3, 2023

Description

getCanHandleIntent can return undefined, but canHandleIntent cannot received undefined.
In all of our examples, we pass the result of getCanHandleIntent directly into canHandleIntent.

What to review

This fixes the types for canHandleIntent to take undefined as everywhere else the params are optional so this changes matches the other interfaces. Adding the below structure still works and does not show TS error

S.listItem()
  .title('Custom books list')
  .child(
    S.documentList()
      .title('Unspecified books list')
      .filter('_type == $type')
      .params({type: 'book'})
      .menuItems(S.documentTypeList('book').getMenuItems())
      .canHandleIntent(S.documentTypeList('book').getCanHandleIntent()),
  )

Notes for release

  • Fixes type for canHandleIntent to allow passing undefined

@vercel
Copy link

vercel bot commented Oct 3, 2023

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

Name Status Preview Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Oct 3, 2023 4:13pm
test-studio ✅ Ready (Inspect) Visit Preview Oct 3, 2023 4:13pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Oct 3, 2023 4:13pm

@binoy14 binoy14 requested a review from a team October 3, 2023 16:13
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

No changes to documentation

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

Component Testing Report Updated Oct 3, 2023 4:19 PM (UTC)

File Status Duration Passed Skipped Failed
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 9s 6 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 12s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 45s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 10s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 5s 3 0 0

@binoy14 binoy14 added this pull request to the merge queue Oct 6, 2023
Merged via the queue into next with commit ad3cf4f Oct 6, 2023
14 checks passed
@binoy14 binoy14 deleted the sdx-506 branch October 6, 2023 18:34
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