-
Notifications
You must be signed in to change notification settings - Fork 364
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
fix: [M3-8588] - Fix value
selection issue in ImageSelect
#11007
Conversation
Coverage Report: ✅ |
Co-authored-by: Hana Xu <115299789+hana-linode@users.noreply.github.com>
…into fix/M3-8588
@@ -518,6 +518,6 @@ export const UpdateLinodeDiskSchema = object({ | |||
|
|||
export const CreateLinodeDiskFromImageSchema = CreateLinodeDiskSchema.clone().shape( | |||
{ | |||
image: string().required('An image is required.'), | |||
image: string().required('An image is required.').nullable(), |
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.
Yup's .typeError might be more fitting here than nullable
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 wonder if we could use ImageSelectv2
here instead. This ImageSelect has some serious type safety issues and hackyness
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.
@bnussman-akamai I agree with your concerns about the type safety issues and the hackyness feeling. I gave ImageSelectv2
a try and it appears that with some minor changes it should work within the CreateDiskDrawer
.
The one issue I noticed is the way the options are grouped. In the current ImageSelect
, one the three categories is the recommended 64-bit distributions. In the ImageSelectv2
, they are grouped by vendor. Would require some conditional logic to determine with grouping function to use.
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.
Ah good point. That would require some UX / product consideration
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.
@bnussman-akamai To keep the work within the scope of this ticket, I'll create a separate ticket for UX to consider the grouping logic and see if it would make sense to further replace the original ImageSelect
with the ImageSelectv2
component. Could please review and approve this for now. Thanks.
@@ -518,6 +518,6 @@ export const UpdateLinodeDiskSchema = object({ | |||
|
|||
export const CreateLinodeDiskFromImageSchema = CreateLinodeDiskSchema.clone().shape( | |||
{ | |||
image: string().required('An image is required.'), | |||
image: string().required('An image is required.').nullable(), |
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.
Yup's .typeError might be more fitting here than nullable
Cloud Manager E2E Run #6583
Run Properties:
|
Project |
Cloud Manager E2E
|
Branch Review |
develop
|
Run status |
Passed #6583
|
Run duration | 23m 43s |
Commit |
744b26bc95: fix: [M3-8588] - Fix `value` selection issue in `ImageSelect` (#11007)
|
Committer | carrillo-erik |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
2
|
Skipped |
0
|
Passing |
408
|
View all changes introduced in this branch ↗︎ |
Description 📝
This PR fixes the bug in the
ImageSelect
component which resulted in the selectedvalue
getting cleared after the input lost focus.Changes 🔄
List any change relevant to the reviewer.
value
isundefined
initially.default export
declarations.Target release date 🗓️
10/16/2024
Preview 📷
BEFORE.mov
AFTER.mov
How to test 🧪
Prerequisites
(How to setup test environment)
Storage
tab for your chosen Linode.Disks
in order to enable theAdd A Disk
option.Add A Disk
button to open theCreate Disk
drawer.Create from Image
radio option.Verification steps
(How to verify changes)
Image
dropdown menu.Label
,Root Password
,Size
).Image
dropdown component remains after you have focused out of the component and focused into another field in the drawer.Add A Disk
feature works as expected.As an Author I have considered 🤔
Check all that apply