Repository navigation
upcoming: [M3-7924] - Linode Create Refactor - VPC - Part 10 - #10354
bnussman-akamai merged 22 commits into
Conversation
| export const VPCSelect = (props: Props) => { | ||
| const { filter, value, ...rest } = props; | ||
|
|
||
| const { data, isFetching } = useVPCsQuery({}, filter ?? {}); |
There was a problem hiding this comment.
I will come back and update this to use useAllVPCsQuery or an infinite query after #10322 gets merged
| }; | ||
|
|
||
| const formik = useFormik({ | ||
| enableReinitialize: true, |
There was a problem hiding this comment.
Had to add this so that region updates when the region is changed on the Linode Create flow. This was not an issue with the existing create flow because the drawer was re-mounted when it was opened (causing the VPC create drawer to not animate)
abailly-akamai
left a comment
There was a problem hiding this comment.
I'll spend more time with it in the UI once we get more reviews from folks more familiar than me with the feature.
All together this looks great, concise, well thought & put together
Left some initial comments to look at a couple areas that could be improved
| ))} | ||
| </Stack> | ||
| <Box> | ||
| <LinkButton onClick={() => append('')}>Add IPv4 Range</LinkButton> |
There was a problem hiding this comment.
Same here. I guess I have to get form familiar with these hooks but this just looks weird
There was a problem hiding this comment.
This adds an empty string to the ip_ranges array on the VPC interface. Appending an empty string item to the array will cause a new empty TextField to render so that the user can add a new IP range.
There was a problem hiding this comment.
Yeah, i am getting to understand that part. i think even doing
// Adding an empty string to the array will render to new empty field
const newRangeField = ''
=> append(newRangeField)or something like that could help with readability
|
Coverage Report: ✅ |
There was a problem hiding this comment.
I'm still testing and combing through the code, but it's looking good overall so far. A few comments:
Points with screenshots
-
Can we keep the "X" vertically centered in relation to the input field when there's an error? I think this has come up as an issue in other contexts, maybe there's a related/similar ticket in the backlog somewhere

-
Can we make some width adjustments so if you click far away from the Auto-assign & Assign checkboxes, they don't get toggled?
Screen.Recording.2024-04-09.at.5.02.46.PM.mov
- There were some concerns during the initial IPv4 range work a couple of months ago about large header text like this (doesn't make the section hierarchy as clear) instead of the more understated one currently used in prod
hkhalil-akamai
left a comment
There was a problem hiding this comment.
Tested and verified parity with existing VPC flow, code review looks clean too -- excellent work as always!
Also, thanks for including comprehensive unit tests!
| <TextField | ||
| errorText={fieldState.error?.message} | ||
| hideLabel | ||
| label={`IP Range ${index}`} | ||
| onChange={field.onChange} | ||
| placeholder="10.0.0.0/24" | ||
| value={field.value} | ||
| /> |
There was a problem hiding this comment.
The width of this textfield is shorter (166.5px vs 362.41px) than the original. Personally I prefer the shorter width since it more closely matches the expected length of the subnet value but just wanted to point it out.
There was a problem hiding this comment.
Yeah, it does look slightly odd. I wasn't able to easily fix it without writing one-off styles, so I'd prefer to leave it be
|
I fixed point 1, 3, and 4. @dwiley-akamai I personally don't agree with 4. I was thinking an I'm declaring point 2 out of scope because I told myself I wouldn't write one-off styling in this project 😖 I think the issue would have to be fixed at the Autocomplete component level if we want it to work that way globally. |
abailly-akamai
left a comment
There was a problem hiding this comment.
Took a second pass at the UI and found regressions/improvements to be made to the UX. See comments for details
| <Stack spacing={2}> | ||
| <Typography variant="h2">VPC</Typography> | ||
| <Typography> | ||
| Assign this Linode to an existing VPC.{' '} |
There was a problem hiding this comment.
Production has "Allow Linode to communicate in an isolated environment." is this intentional?
There was a problem hiding this comment.
Agreed. I'll make an effort to circle back around to all of the weird UX things after this refactor happens
| loading={isFetching} | ||
| options={data?.data ?? []} | ||
| value={selectedVPC} | ||
| {...rest} |
There was a problem hiding this comment.
There was a problem hiding this comment.
This is expected for now. I am saving "side effect" state updates for later in this project.
There was a problem hiding this comment.
This is a local side effect, not a global one tho. You gotta point those out in your PR description
There was a problem hiding this comment.
What I mean is that I haven't determined the best way to handle side-effect state changes using react-hook-form so I'm deferring the work till later.
There needs to be some investigation on my part to find the best way to handle these "side-effect" changes because there are a ton in the Linode Create flow.
There was a problem hiding this comment.
Got it. Would still be helpful for reviewers to know what's not supposed to work. I remembered default values being one, not those (tho they are clearly related).
There was a problem hiding this comment.
I have a running list so I assure you these will be fixed! I will do my best to call these out in the future
abailly-akamai
left a comment
There was a problem hiding this comment.
Amazing work! this is coming alive 🎉
There was a problem hiding this comment.
The core functionality LGTM, nice work as the code patterns are pretty clean 🧽
I do think the remaining visual inconsistencies and regressions have to be addressed, but that can be in a follow-up or at least a circle-back before the Linode Create refactor is wrapped up.
Other quirks with IPv4 ranges
When there's an error, the field it belongs to gets horizontally widened, which makes me favor retaining the wider field width that we currently have in prod.
The vertical distance between the fields is now greatly compressed compared to prod. I think that should be adjusted.
This isn't an issue per se, but I noticed that compared to prod, you now have to input something into the most recent field before clicking "Add IPv4 Range" adds a new input field.
Also, were you going to address the leftover changes from #10342 (comment) in this PR?
| const copy = | ||
| data?.results === 0 | ||
| ? 'Allow Linode to communicate in an isolated environment.' | ||
| : 'Assign this Linode to an existing VPC.'; |
There was a problem hiding this comment.
minor: We lost some parity here -- a fresh form in prod shows Allow Linode to communicate in an isolated environment. but this branch shows Assign this Linode to an existing VPC.
There was a problem hiding this comment.
Good catch. I believe the logic should now match the prod flow. (1934915)





Description 📝
Changes 🔄
Create a Linodeto the document title to match the existing flowPreview 📷
How to test 🧪
Prerequisites
Linode Create v2feature flag 🎏Verification steps
As an Author I have considered 🤔