-
Notifications
You must be signed in to change notification settings - Fork 332
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-7926] - Linode Create Refactor - VLANs - Part 9 #10342
upcoming: [M3-7926] - Linode Create Refactor - VLANs - Part 9 #10342
Conversation
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.
I observed a bit of odd behavior in the Linode Create flow with a "ghost" VLAN appearing in the dropdown:
Screen.Recording.2024-04-03.at.9.53.53.AM.mov
Additionally, based on the API docs, VLANs can only be attached to Linodes within the same DC. Our functionality in prod currently filters the VLAN dropdown based on region, but we don't have that on this branch
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.
Looks good and well tested. Left some comments.
Also, maybe i am doing something wrong, but ran into this error when submitting
{
"reason": "metadata dict must contain key user_data",
"field": "metadata"
}
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.
Overall, LGTM I agree with the feedback from @abailly-akamai and @dwiley-akamai . Approving, pending the addressing of their feedback.
loading={isLoading} | ||
noOptionsText="You have no VLANs in this region. Type to create one." | ||
options={vlans} | ||
placeholder="Create or select a VLAN" |
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.
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.
I'm hoping that the changes from #10122 improves the loading state
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.
Looks great on my end, nice work! Thanks for addressing those changes as well β
Was there a response to this comment by @dwiley-akamai? I am not able to replicate it myself -- I think it might be different VLANs in different regions with the same name. |
const disabled = | ||
!imageId || | ||
isCreatingFromBackup || | ||
isLinodeCreateRestricted || | ||
!regionSupportsVLANs; |
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.
For parity with the current flow, the VLANs field should reset when disabled goes from false to true.
In the (admittedly contrived) case that the user selects a VLAN and then e.g., clears the image field, the form will still be submittable with the VLAN attached. This causes an API error and also breaks the form (this might be an unrelated), see attached video:
Screen.Recording.2024-04-03.at.5.18.14.PM.mov
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.
Yes, good catch. This will have to be addressed at some point. I was holding off on this for now because there will be significant work dedicated to "resetting" form fields under certain conditions like what you showed and even switching tabs.
I need to find a clean way to handle these "side-effect" state changes. There are many cases similar to this
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.
One idea might be with a useEffect
as so:
React.useEffect(() => {
if (disabled) {
// Reset input here
}
}, [disabled]);
I wasn't able to reproduce the "ghost" issue, but the component has undergone some significant changes and it now filters by region. I think we should be good now @hkhalil-akamai @dwiley-akamai |
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.
Thanks for addressing feedback @bnussman-akamai!
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.
Functionality LGTM now, no longer observing the ghost VLAN issue
|
||
const vlans = data?.pages.flatMap((page) => page.data) ?? []; | ||
|
||
const newVlanPlacehodler = { |
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.
const newVlanPlacehodler = { | |
const newVlanPlaceholder = { |
return payload; | ||
}; | ||
|
||
/** | ||
* Performans transformation and ordering on the Linode Create "interfaces" form data. |
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.
* Performans transformation and ordering on the Linode Create "interfaces" form data. | |
* Performs a transformation and ordering on the Linode Create "interfaces" form data. |
/** | ||
* Performans transformation and ordering on the Linode Create "interfaces" form data. | ||
* | ||
* We need this so we can put interfaces in the correct order and omit unused iterfaces. |
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.
* We need this so we can put interfaces in the correct order and omit unused iterfaces. | |
* We need this so we can put interfaces in the correct order and omit unused interfaces. |
Oops. I forgot to fix those spelling issues @dwiley-akamai. My fault π€¦ I'll make sure to fix them in the next Linode Create reactor PR |
Description π
Adds VLANs to the new Linode Create flow β¨
Changes π
VLANSelect
componentPreview π·
How to test π§ͺ
Prerequisites
Linode Create v2
feature flag using our local dev toolsVerification steps
VLAN
sectionVLANSelect
As an Author I have considered π€