-
Notifications
You must be signed in to change notification settings - Fork 1
feat(react): create useDispatchIntent hook #595
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
291e21c to
362d94d
Compare
362d94d to
8a8d13d
Compare
8a8d13d to
be466ab
Compare
colepeters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amaze! A few questions that are mostly minor and likely not blockers! 👏🏻
packages/react/src/hooks/dashboard/utils/getResourceIdFromDocumentHandle.ts
Show resolved
Hide resolved
Co-authored-by: Cole Peters <cole@colepeters.com>
Co-authored-by: Cole Peters <cole@colepeters.com>
colepeters
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.


Description
This PR introduces a preliminary beta version of
useDispatchIntent. It accepts either a typical projectId / dataset handle or a Media Library asset handle, and sends a dispatch message to the Dashboard.What to review
There's only one new hook being exported. PLEASE help me make sure I didn't forget to mark anything as
beta-- this hook can and probably will change!There's also a helper utility, please keep me accountable for any logic snags there. I'd like to extend it to other Dashboard hooks but wanted to keep this PR focused.
Testing
Tests were added. Full e2e tests will come but not prioritized at the moment because of cycle deadlines. To e2e test yourself, you can go to:
https://core-e3cbdlffn.sanity.build/@oblZgbTFj/application/wkyoigmzawwnnwx458zgoh46/intents
Click on the "Media Library" intent dispatch (not the doc one, I haven't deployed manifests in that org yet). It should take you to the Media Library.
Fun gif