-
Notifications
You must be signed in to change notification settings - Fork 367
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
refactor: [M3-8720] - One ImageSelect
to rule them all
#11058
Conversation
e883123
to
4585ec3
Compare
68d5676
to
ba20dbb
Compare
ImageSelect
to rule them all
...rest | ||
} = props; | ||
export const Dialog = React.forwardRef( | ||
(props: DialogProps, ref: React.Ref<HTMLDivElement>) => { |
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.
The diff looks weird here cause it looks like we are modifying the whole component, but it is because ImageOptionV2
is being renamed to ImageOption
which was our legacy component (now deleted)
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.
Same comment about the diff size
<EnhancedSelect | ||
onChange={(selected: Item<MODES>) => { | ||
setMode(selected.value); | ||
<Autocomplete |
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.
Taking this opportunity to replace this old deprecated Select with our new Autocomplete. one more down!
const { data: regionsData, isLoading: isLoadingRegions } = useRegionsQuery(); | ||
const isLoading = isLoadingPreferences || isLoadingImages || isLoadingRegions; | ||
const isLoading = isLoadingPreferences || isLoadingRegions; |
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're not fetching images from the parent anymore
errorText={imageFieldError} | ||
onChange={onImageChange} | ||
value={selectedImage} | ||
variant="all" |
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 am requiring the variant property now, forces to make a decision since it affects API filtering
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.
Changes to the stackscript create is due to removing fetching from the class component, which in turns allows us to fully get rid of the withImages
HOC 🎉
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.
Looking solid on my initial pass!
I'm noticing that re-opening the ImageSelect does not scroll the currently selected Image into view like it use to
Screen.Recording.2024-10-22.at.4.50.43.PM.mov
12ec809
to
6d57cf6
Compare
@bnussman-akamai Yeah great catch, one has to be careful when overriding with |
Heads up: I think there is a crash on the multi-select. I was seeing it on the StackScript create page |
@bnussman-akamai yes thank you, rebase gone wrong - fixed (this will also fix the e2e) |
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!
Didn't spot any regressions on the flows I checked, only improvements! The consistancy across all of the flows is great
So glad to finally have only one ImageSelect 🎉 🙏
Nice work, no regressions noticed! 🧹 Looks like there's some merge conflicts to resolve |
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.
✅ confirmed tests pass
✅ confirmed flows listed in verification steps
this is awesome and so much nicer and consistent - thanks Alban!! 🚀 🎉
b8cdf6d
to
c96670c
Compare
Cloud Manager E2E Run #6754
Run Properties:
|
Project |
Cloud Manager E2E
|
Branch Review |
develop
|
Run status |
Passed #6754
|
Run duration | 25m 43s |
Commit |
0cbb976196: refactor: [M3-8720] - One `ImageSelect` to rule them all (#11058)
|
Committer | Alban Bailly |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
1
|
Pending |
2
|
Skipped |
0
|
Passing |
445
|
View all changes introduced in this branch ↗︎ |
Description 📝
This PR consolidates the three different ImageSelect we had in the codebase.
StackscriptCreate
for instance)It unifies the experience for every feature where an image picker is featured and cleans up the codebase accordingly from unnecessary utils.
Changes 🔄
created
property (latests release first)ImageSelect
Dialog
(unrelated but caught while testing)Target release date 🗓️
How to test 🧪
Prerequisites
Verification steps
Verify the behavior and content of the following UIs while comparing to their production equivalent:
/linode/create
(no changes)/linodes/create?type=Images
(no changes)/linodes
> Action menu > Rebuildlinode/{id}/storage
(linode must be powered down) > Add Disk > Create from Image (old grouping replaced)stackscripts/create
(old grouping replaced)As an Author I have considered 🤔
Check all that apply