-
Notifications
You must be signed in to change notification settings - Fork 357
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
upcoming: [M3-8187] - Add useRegionQuery and cleanup bucket landing page #10801
Conversation
const [isLoading, setIsLoading] = React.useState<boolean>(false); | ||
const [error, setError] = React.useState<APIError[] | undefined>(undefined); | ||
const [ | ||
bucketDetailDrawerOpen, | ||
setBucketDetailDrawerOpen, | ||
] = React.useState<boolean>(false); | ||
const [bucketForDetails, setBucketForDetails] = React.useState< | ||
const [selectedBucket, setSelectedBucket] = React.useState< | ||
ObjectStorageBucket | undefined | ||
>(undefined); |
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.
Combined setBucketToRemove
and setBucketForDetails
into a single useState setSelectedBucket
enabled: Boolean(regionId), | ||
}); | ||
}; | ||
|
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.
Surprised we never had a query like this yet!
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.
PR looks good 👍
onClose: () => void; | ||
open: boolean; | ||
size?: null | number; |
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.
Keeping props simple by passing the whole bucket down
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.
Not seeing the dividers on the Bucket Details drawer in comparison to prod/this pr.
Ty for the additional documentation + tests! 😄
})); | ||
|
||
// Mock the queries | ||
vi.mock('src/queries/profile/profile', async () => { |
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.
Just curious, what's the difference between mocking queries like this and using server.use
/http.get
? Are there dis/advantages to each?
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.
Using Vitest, you don't have to worry about loading states. You can test the component in all it's states and have more control over the data passed in. The downside it's a bit more fragile than the MSW approach where the that tests things in a more E2E type of way, however you have to account for loading states by using waitFor
in certain cases. Historically it has caused flakyness for us in CI when running multiple tests. Both approaches are valid and you can choose whichever makes sense.
packages/manager/src/features/ObjectStorage/BucketLanding/BucketDetailsDrawer.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/ObjectStorage/BucketLanding/BucketDetailsDrawer.tsx
Outdated
Show resolved
Hide resolved
…etDetailsDrawer.tsx Co-authored-by: Connie Liu <[email protected]>
…etDetailsDrawer.tsx Co-authored-by: Connie Liu <[email protected]>
Coverage Report: ✅ |
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.
retested flows, things look good + bucket details drawers matches prod now! ✅
packages/manager/src/features/ObjectStorage/BucketLanding/OMC_BucketLanding.tsx
Show resolved
Hide resolved
…age (linode#10801) Co-authored-by: Jaalah Ramos <[email protected]> Co-authored-by: Connie Liu <[email protected]> Co-authored-by: Banks Nussman <[email protected]>
…age (linode#10801) Co-authored-by: Jaalah Ramos <[email protected]> Co-authored-by: Connie Liu <[email protected]> Co-authored-by: Banks Nussman <[email protected]>
Dependency
Description 📝
We need to add a new
useRegionQuery
hook to allow querying for a single region in the details drawer. Additionally, we should clean up theBucketDetailsDrawer
props and deprecate some queries and functions related to OBJ Legacy and Multi-Cluster.Changes 🔄
useRegionQuery
hook to get a single region by idTarget release date 🗓️
N/A
Preview 📷
No visual changes
How to test 🧪
Prerequisites
Verification steps
As an Author I have considered 🤔
Check all that apply