Skip to content

Wizard: always enable Next, Review, and Create/Save buttons (HMS-10658)#4579

Draft
mgold1234 wants to merge 7 commits into
osbuild:mainfrom
mgold1234:next_button
Draft

Wizard: always enable Next, Review, and Create/Save buttons (HMS-10658)#4579
mgold1234 wants to merge 7 commits into
osbuild:mainfrom
mgold1234:next_button

Conversation

@mgold1234

@mgold1234 mgold1234 commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Instead of disabling Next/Review when validation fails, keep them
enabled and scroll to the first error on click. Create/Save buttons
on the Review step behave the same way — always clickable, but
navigate back to the first error step when validation fails.

A new ValidationContext forces pristine fields to reveal their
errors so the user sees exactly what needs fixing.
JIRA :HMS-10658

@mgold1234 mgold1234 force-pushed the next_button branch 8 times, most recently from 42b9556 to 16a1e92 Compare July 1, 2026 15:46
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.33121% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.19%. Comparing base (12b6034) to head (94c8288).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...reateImageWizard/components/ReviewWizardFooter.tsx 27.77% 13 Missing ⚠️
...Components/CreateImageWizard/CreateImageWizard.tsx 82.45% 10 Missing ⚠️
...reateImageWizard/components/CustomWizardFooter.tsx 33.33% 10 Missing ⚠️
.../CreateImageWizard/utilities/scrollToFirstError.ts 11.11% 8 Missing ⚠️
...ents/CreateImageWizard/utilities/useValidation.tsx 84.37% 4 Missing and 1 partial ⚠️
...ImageWizard/steps/Review/Footer/CreateDropdown.tsx 0.00% 4 Missing ⚠️
...teImageWizard/steps/Review/Footer/EditDropdown.tsx 25.00% 3 Missing ⚠️
.../CreateImageWizard/utilities/ValidationContext.tsx 77.77% 2 Missing ⚠️
...steps/ImageOutput/components/TargetEnvironment.tsx 66.66% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (12b6034) and HEAD (94c8288). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (12b6034) HEAD (94c8288)
vitest 2 1
playwright 1 0

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4579      +/-   ##
==========================================
- Coverage   77.38%   71.19%   -6.20%     
==========================================
  Files         258      257       -1     
  Lines        6866     6897      +31     
  Branches     2543     2566      +23     
==========================================
- Hits         5313     4910     -403     
- Misses       1442     1953     +511     
+ Partials      111       34      -77     
Flag Coverage Δ
playwright ?
vitest 71.19% <64.33%> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/Components/CreateImageWizard/ValidatedInput.tsx 96.66% <100.00%> (-1.67%) ⬇️
...steps/ImageOutput/components/TargetEnvironment.tsx 85.71% <66.66%> (-0.65%) ⬇️
.../CreateImageWizard/utilities/ValidationContext.tsx 77.77% <77.77%> (ø)
...teImageWizard/steps/Review/Footer/EditDropdown.tsx 29.54% <25.00%> (-12.96%) ⬇️
...ImageWizard/steps/Review/Footer/CreateDropdown.tsx 4.91% <0.00%> (-45.96%) ⬇️
...ents/CreateImageWizard/utilities/useValidation.tsx 82.63% <84.37%> (-7.43%) ⬇️
.../CreateImageWizard/utilities/scrollToFirstError.ts 11.11% <11.11%> (ø)
...Components/CreateImageWizard/CreateImageWizard.tsx 79.26% <82.45%> (-5.92%) ⬇️
...reateImageWizard/components/CustomWizardFooter.tsx 44.82% <33.33%> (-20.18%) ⬇️
...reateImageWizard/components/ReviewWizardFooter.tsx 47.72% <27.77%> (-34.42%) ⬇️

... and 78 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12b6034...94c8288. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mgold1234 mgold1234 force-pushed the next_button branch 3 times, most recently from 2973222 to a131bcd Compare July 8, 2026 10:56
@mgold1234 mgold1234 changed the title Wizard: always enable Next and Review buttons (HMS-10658) Wizard: always enable Next, Review, and Create/Save buttons (HMS-10658) Jul 8, 2026
@mgold1234 mgold1234 force-pushed the next_button branch 5 times, most recently from 24aeaa6 to 4732560 Compare July 9, 2026 11:12
mgold1234 and others added 6 commits July 9, 2026 14:14
Add a ValidationContext that exposes forceShowErrors to force pristine
fields to reveal their validation errors. ValidatedInput and
TargetEnvironment consume it so errors become visible before the user
has interacted with those fields.
Keep Next and Review buttons enabled instead of disabling them when
validation fails. On click, force errors visible and scroll to the
first error. Extract scrollToFirstError to a shared utility.
…658)

Remove isFetching from the registration validation condition so Next
is not disabled while the activation key query is in flight. Also
return no error when no activation key is selected in hosted mode,
since that is a valid initial state.
Add useBlueprintValidation hook that returns isValid and
firstErrorStepId, replacing duplicate validation hook calls in the
Review footers. Create/Save buttons are always enabled and navigate
to the first error step via onBeforeAction when validation fails.
Change toBeDisabled assertions to toBeEnabled for Next and Review
buttons across Import, Azure, Registration, and UsersAndGroups specs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Registration and image selection are both on the Base Settings step,
so select both before clicking Next.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the imageTypes.length === 0 check from useBlueprintValidation
that was not present in the original useIsBlueprintValid. This check
caused the Save button on the Review step to block in cases where the
original code allowed it, breaking 21 Playwright tests.

Also apply Prettier formatting to CreateImageWizard.tsx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant