Skip to content

Add form validation to AccountBanner for account selection#461

Merged
JulienVannier66 merged 4 commits into
feature/multi-currencyfrom
jv/vel-7480/handle-account-selection-from-payment-apps-side-panel-form-validation
Apr 10, 2026
Merged

Add form validation to AccountBanner for account selection#461
JulienVannier66 merged 4 commits into
feature/multi-currencyfrom
jv/vel-7480/handle-account-selection-from-payment-apps-side-panel-form-validation

Conversation

@JulienVannier66
Copy link
Copy Markdown
Contributor

What does this PR do?

Add form validation logic to the Utils::AccountBanner component to handle account selection from the side panel.

  • Integrate OSS::Form in the subtitle area to register a required form field (account.select)
  • Conditionally display the required marker (*) and validation modifiers based on @selectedAccount presence
  • Expose an @onFormSetup callback so consumers can access the form instance
  • Handle error state (red border + message) via a getter derived from @selectedAccount and form errors

What are the observable changes?

Screencast.from.2026-04-02.17-31-05.webm

🧑‍💻 Developer Heads Up

⚡ Since we are using Ember Octane now:

  • Feel free to migrate existing components to Glimmer Components.
  • Write new ones exclusively in it.

Useful Resource : Ember Octane vs Classic Cheat Sheet

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Migrated touched components to Glimmer Components
  • Properly labeled

@JulienVannier66 JulienVannier66 requested review from a team and phndiaye as code owners April 2, 2026 15:37
@JulienVannier66 JulienVannier66 requested review from Elodie-DeMatteis-Upf and OwenCoogan and removed request for a team April 2, 2026 15:37
@linear
Copy link
Copy Markdown

linear Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

@olxmpe olxmpe left a comment

Choose a reason for hiding this comment

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

You showed me how it works (and it works perfectly), but I still think it's really weird to put an OSS::Form here. Couldn't we just pass a “required” flag and and a feedback message as arguments and handle the form logic in the parent component, where register-form-field would be used on the account-banner component instead ?

@JulienVannier66 JulienVannier66 self-assigned this Apr 10, 2026
Base automatically changed from ol/vel-7472 to feature/multi-currency April 10, 2026 12:49
@JulienVannier66 JulienVannier66 merged commit 14d9305 into feature/multi-currency Apr 10, 2026
2 checks passed
@JulienVannier66 JulienVannier66 deleted the jv/vel-7480/handle-account-selection-from-payment-apps-side-panel-form-validation branch April 10, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants