Skip to content

fix(GAT-9237): bug in the onboarding form for tools - #1579

Merged
calmacx merged 6 commits into
devfrom
fix/GAT-9237
Jul 20, 2026
Merged

fix(GAT-9237): bug in the onboarding form for tools#1579
calmacx merged 6 commits into
devfrom
fix/GAT-9237

Conversation

@calmacx

@calmacx calmacx commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Screenshots (if relevant)

image

Describe your changes

  • Fixes a bug ingenerateValidationRules (now in src/utils/formHydration.tsx) was silently dropping the of sub-schema (e.g. { type: "string", format: "url" }) from every scalar-array validation entry before handing it to buildYup() (schema-to-yup). schema-to-yup's array builder already fully supports this shape and recursively validates each item — it just never received it.
  • The fix is two lines: re-attach of in both branches of the transform. This is generic, not "Tools"-specific — any scalar-array field the backend's validation array marks with of (Investigations, publicationAboutDataset, syntheticDataWebLink, etc.) is now validated the same way.
  • Extracted generateValidationRules out of CreateDataset.tsx into src/utils/formHydration.tsx (alongside its sibling pure helpers) so it has a real unit test instead of being untested inline logic — which is what let this bug ship unnoticed in the first place.

Why it works: schema-to-yup's YupArray.itemsOf() (node_modules/schema-to-yup/src/types/array/array.js) reads this.constraints.of and recursively builds a per-item Yup validator from it — including format: "url".url(). The transform function just needed to stop deleting that key before yup ever saw it.

Issue ticket link

https://hdruk.atlassian.net/browse/GAT-9237

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added appropriate unit tests
  • I have created mocks for unit tests (where appropriate) — n/a, no new HTTP/data mocking needed
  • The interface is responsive (where appropriate) — n/a, no UI change (reverts to the existing standard form error display)
  • The interface is at least AA (where appropriate) — n/a, no UI change

@gh-actions-pipelines-app

Copy link
Copy Markdown

🎉 Great job! Your PR title follows the correct format. 🚀

calmacx and others added 3 commits July 20, 2026 13:03
Drops the console.log statements and incidental whitespace-only
formatting added while tracing the Autocomplete format-validation bug;
not part of the actual fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread src/utils/formHydration.tsx
Comment thread src/utils/formHydration.tsx
@calmacx calmacx changed the title fix(GAT-9237): Fix for onboarding form fix(GAT-9237): bug in the onboarding form for tools Jul 20, 2026
@calmacx
calmacx merged commit 2071ecb into dev Jul 20, 2026
6 checks passed
@calmacx
calmacx deleted the fix/GAT-9237 branch July 20, 2026 14:33
gh-actions-pipelines-app Bot pushed a commit that referenced this pull request Jul 24, 2026
## [2.40.0](v2.39.0...v2.40.0) (2026-07-24)

### ✨ Features

* **GAT-7563:** Data Custodian Network = Split owned/associated content (#1569) ([7e462ff](7e462ff)), closes [GAT-7563](undefinedGAT-7563)
* **GAT-7564:** Data custodian associated resources (#1567) ([45e9c1d](45e9c1d)), closes [GAT-7564](undefinedGAT-7564)
* **GAT-7604:** Data custodian display tweaks (#1562) ([82b222c](82b222c)), closes [GAT-7604](undefinedGAT-7604)
* **GAT-8094:** Display dataset aliases (#1566) ([65e819a](65e819a)), closes [GAT-8094](undefinedGAT-8094)
* **GAT-8131:** Widget test harness (#1573) ([ac6fda3](ac6fda3)), closes [GAT-8131](undefinedGAT-8131)
* **GAT-8478:** Add support link (#1571) ([c51fa80](c51fa80)), closes [GAT-8478](undefinedGAT-8478)
* **GAT-8709:** Fix confusing naming for running a fedaration test. ([6aedd84](6aedd84))
* **GAT-8724:** Update dataset filter order (#1576) ([71843f9](71843f9)), closes [GAT-8724](undefinedGAT-8724)
* **GAT-8798:** Added run now button for integrations ([f944277](f944277)), closes [GAT-8798](undefinedGAT-8798)
* **GAT-8821:** Correct DAR dialog & save draft logic (#1578) ([04eace6](04eace6)), closes [GAT-8821](undefinedGAT-8821)
* **GAT-9193:** Update sign-in modal design (#1581) ([ee76b95](ee76b95)), closes [GAT-9193](undefinedGAT-9193)
* **GAT-9193:** Update wording (#1582) ([68ae7bb](68ae7bb)), closes [GAT-9193](undefinedGAT-9193)

### 🐛 Bug Fixes

* **GAT-8754:** Fix empty widget preview state (#1577) ([a827c08](a827c08))
* **GAT-9237:** bug in the onboarding form for tools (#1579) ([2071ecb](2071ecb)), closes [GAT-9237](undefinedGAT-9237)
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.

2 participants