Clear timezone and locale for unsupported image types (HMS-10456)#4482
Clear timezone and locale for unsupported image types (HMS-10456)#4482kingsleyzissou wants to merge 1 commit into
Conversation
|
#4311 got closed, I cherry-picked the changes from that and made some changes |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #4482 +/- ##
==========================================
+ Coverage 76.05% 76.20% +0.15%
==========================================
Files 225 225
Lines 7196 7204 +8
Branches 2662 2663 +1
==========================================
+ Hits 5473 5490 +17
+ Misses 1482 1473 -9
Partials 241 241
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
81e2337 to
a82fe4e
Compare
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The implementation still lists
localeundernetwork-installersupported_blueprint_options (and updates tests accordingly), which conflicts with the PR summary that sayslocaleshould be removed for this image type—please reconcile the intended behavior vs. the current constants/test expectations. - In the
useEffectthat clears timezone whenrestrictions.timezone.shouldHideis true, the guardif (timezone)only checks the timezone string and could leaventpserversuncleared if they are set whiletimezoneis already empty; consider basing the condition on both fields or always dispatchingclearTimezonewhen hidden.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The implementation still lists `locale` under `network-installer` supported_blueprint_options (and updates tests accordingly), which conflicts with the PR summary that says `locale` should be removed for this image type—please reconcile the intended behavior vs. the current constants/test expectations.
- In the `useEffect` that clears timezone when `restrictions.timezone.shouldHide` is true, the guard `if (timezone)` only checks the timezone string and could leave `ntpservers` uncleared if they are set while `timezone` is already empty; consider basing the condition on both fields or always dispatching `clearTimezone` when hidden.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
078bc14 to
b070333
Compare
regexowl
left a comment
There was a problem hiding this comment.
Looks good! One minor nitpick, but not blocking on that
Looking at the test failures, those seem to be relevant.
I had a suspicion but I haven't had the chance to look into it properly yet |
Network-installer already excluded timezone from its supported blueprint options, but the wizard wasn't acting on that restriction. Add clearTimezone and clearLocale reducers and wire them into both wizard versions so state is reset when restrictions indicate a customization should be hidden. Co-authored-by: Gianluca Zuccarelli <gzuccare@redhat.com>
b070333 to
91a3e6a
Compare
Summary
Use the existing restrictions system to clear wizard state for timezone
and locale when the selected image type doesn't support them (e.g.,
network-installer), preventing stale customization data from leaking
into blueprint requests.
Changes
clearTimezoneandclearLocalereducers to atomically reset related state (timezone + NTP servers, languages + keyboard)useEffecthooks in both wizard versions to dispatch clearing actions whenrestrictions.*.shouldHideis true, with guards to skip edit mode and avoid redundant dispatchestimezone.shouldHideassertion for network-installer in the restrictions hook testscustomizations