Skip to content

WEBDEV-9051: Migrate the donation form models, currency validator and form section into elements - #98

Open
jbuckner wants to merge 1 commit into
mainfrom
WEBDEV-9051-migrate-donation-form-models
Open

jbuckner wants to merge 1 commit into
mainfrom
WEBDEV-9051-migrate-donation-form-models

Conversation

@jbuckner

@jbuckner jbuckner commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

WEBDEV-9051. Bottom rung of the donation form stack in WEBDEV-8602. Based on main.

The data-models, currency-validator and form-section packages from iaux-donation-form land in src/elements/ia-donation-form/ as models/, currency-validator.ts and form-elements/ia-donation-section.ts. Everything else in the form depends on these three, which is why they go first.

What changed beyond the move:

  • 14 model files became 6. Same 21 exports, grouped by what they are: contact info, payment info, request, response, plus the two enums. The classes stay classes, since offshoot, the monthly giving portal and the petabox banner all new them.
  • The enums are as const objects plus a type, same as PlaybackMode in the playback controls. erasableSyntaxOnly rules out enum. Old-enum to new-union assigns fine, the reverse doesn't, so a consumer has to switch both sides of an API at once.
  • donation-form-section is ia-donation-section. It sizes off a 10px base font size variable like the item navigator does, so the badge and headline render at the same size under offshoot's 10px root and the demo's 16px root. CSS variables move to --ia-donation-section-*, text color follows --ia-theme-primary-text-color.
  • CurrencyValidator tests the regex instead of matching with a global flag, which drops the stateful lastIndex. Same behavior.
  • story-template gets an importPath property. It derived the import snippet from the tag, which gave ia-donation-section/ia-donation-section for an element that actually lives under ia-donation-form/form-elements/. First nested element in the repo, so first time it mattered.

Verified locally: build, full suite 672 passing, eslint and prettier clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf

… form section into elements

Bottom rung of the donation form stack. The data-models, currency-validator
and form-section packages from iaux-donation-form land in
src/elements/ia-donation-form/ as models/, currency-validator.ts and
form-elements/ia-donation-section.ts.

The 14 model files fold into six. The enums become as-const objects plus a
type, since erasableSyntaxOnly rules out enum. The classes stay classes:
offshoot, the monthly giving portal and the petabox banner all construct
them. The section is ia-donation-section, sized off a 10px base font size
variable like the item navigator so it renders the same under any root font
size, with its CSS variables renamed to --ia-donation-section-*.

story-template gets an importPath property so an element nested inside
another component's directory shows the right import snippet.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-98/

Built to branch ghpages at 2026-09-14 23:33 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.58%. Comparing base (f0c9a36) to head (799d264).

Files with missing lines Patch % Lines
...rc/elements/ia-donation-form/currency-validator.ts 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   86.09%   86.58%   +0.48%     
==========================================
  Files          67       76       +9     
  Lines        2244     2340      +96     
  Branches      486      501      +15     
==========================================
+ Hits         1932     2026      +94     
  Misses        168      168              
- Partials      144      146       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@jbuckner
jbuckner added this pull request to stack #101 September 15, 2026 00:02

@bfalling bfalling left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants