fix: DAH-4340 Apply button - #3053
Conversation
852e2f5 to
df24bc6
Compare
There was a problem hiding this comment.
🟡 Changes recommended
A newly added assertion hard-codes a non-localized apply URL even though production code uses localizedPath, which can make the test locale-sensitive/flaky.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes the “Apply Online” button behavior on the listing details page when Clerk auth is enabled by ensuring the button links to the correct destination (sign-in, add-profile, or the application flow) instead of rendering with an empty/invalid href.
Changes:
- Refactors Clerk-gated apply-link selection to use explicit early returns for loading/signed-out/profile-missing states.
- Adds/updates unit tests for Clerk-enabled apply button routing behavior, including auth-loading behavior.
- Minor import cleanup in the SignIn flow test.
File summaries
| File | Description |
|---|---|
| app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx | Fixes apply button href selection under Clerk auth by handling loading/signed-in/profile states explicitly. |
| app/javascript/tests/pages/SignInFlow.test.tsx | Consolidates constants import (no functional behavior change). |
| app/javascript/tests/modules/listingDetailsAside/ListingDetailsApply.test.tsx | Adds coverage for Clerk-enabled apply button redirect behavior and auth-loading non-render case. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
df24bc6 to
bb0a440
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, fixes a concrete bad-link state, and is backed by focused tests for the updated Clerk apply-button logic.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
Description
Fix the apply button on the listing details page.
Jira ticket
https://sfgovdt.jira.com/browse/DAH-4340
Before requesting eng review
Version Control
angularif it contains updates to Angular codetype: TICKET-NUMBER Descriptionformat, useDAH-000if it does not need a ticketurgent: Descriptionformat if it is urgent and does not need a ticketCode quality
Code conventions
.scssstylesheets andui-seedstokens, rather than inline styles or TailwindReview instructions
Request eng review
needs reviewlabelHousing Enggroup to automatically assign reviewers, and/or assign specific engineersBefore merging
Request product acceptance (PA) testing
needs product acceptancelabel)