Refactor InstanceLinkCell and floating IP form#3142
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| await Promise.all([ | ||
| queryClient.fetchQuery(floatingIpView(selector)), | ||
| queryClient.fetchQuery(instanceList(selector.project).optionsFn()), | ||
| ]) |
There was a problem hiding this comment.
I think we were using a list endpoint here so we could fetch it in parallel with the floating IP view instead of having to wait for the floating IP to come back and then use the ID to fetch the instance. However, we're already waiting for the IP pool to come in async. So I figure having both of these resolve out of band and pop in is perfectly fine. I changed these to actually prefetch. The API is fast and I hate pop-in.
803f76f to
9992cfd
Compare
app/table/cells/InstanceLinkCell.tsx
Outdated
| if (!result) return <SkeletonCell /> | ||
|
|
||
| return <LinkCell to={result.to}>{result.name}</LinkCell> | ||
| } |
There was a problem hiding this comment.
InstanceLinkCell works in real tables, But the hover styling doesn't work in properties tables. So this change splits out a non-cell instance link component that lets us load instance names in properties tables. Because I'm prefetching the instance on the side modal, we'll never actually see the loading state of this, but in the future we might use it in a place where we want it to pop in.
There was a problem hiding this comment.
I unsplit it because it was duplicative, but the idea is the same. It's now just a cell prop.
9992cfd to
0b0e583
Compare
0b0e583 to
8a3e4c4
Compare
Extracted from external subnets work coming in #3039 but not present yet in that PR.