-
Notifications
You must be signed in to change notification settings - Fork 432
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
chore(core): refactor usePerspective hook #8029
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Dec 13, 2024 3:17 PM (UTC) ❌ Failed Tests (5) -- expand for details
|
⚡️ Editor Performance ReportUpdated Fri, 13 Dec 2024 15:18:46 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
43f065d
to
736d1ab
Compare
736d1ab
to
9175b4d
Compare
packages/sanity/src/core/releases/hooks/__tests__/useDocumentVersions.test.tsx
Outdated
Show resolved
Hide resolved
@@ -3,6 +3,7 @@ | |||
|
|||
import {Box, Card, Flex, Text} from '@sanity/ui' | |||
import {AnimatePresence, motion} from 'framer-motion' | |||
import {getReleaseIdFromReleaseDocumentId} from 'sanity' |
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.
use '../../util/getReleaseIdFromReleaseDocumentId'
instead of sanity
alias
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.
Ohh man, this is so easy to miss, fixed a bunch in a passed commit and it kicks again.
Will do a stab on enabling the eslint to warn us against that
packages/sanity/src/core/releases/tool/overview/__tests__/ReleasesOverview.test.tsx
Outdated
Show resolved
Hide resolved
packages/sanity/src/core/releases/tool/overview/ReleasesOverviewColumnDefs.tsx
Outdated
Show resolved
Hide resolved
packages/sanity/src/core/releases/tool/overview/ReleasesOverviewColumnDefs.tsx
Outdated
Show resolved
Hide resolved
(bundleId: string) => () => { | ||
setPerspective(bundleId) | ||
const handlePerspectiveChange = useCallback( | ||
(perspective: Parameters<typeof setPerspective>[0]) => () => { |
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.
Parameters
is cool!
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.
Great to add this consistency
Description
Refactors
usePerspective
hook by removing some ""almost"" duplicated values, which could be derived from the existing values.Updates the
ReleaseDocument
interface to match the apiRemove
name
fromReleaseDocument
given it is confusing and we want to enforce internally the use of thegetReleaseIdFromReleaseDocumentId
function.What to review
Is something missing?
Could we make something more clear?
Testing
Existing tests have been update to match the new hook
Notes for release