Skip to content

fix: DAH-4340 Apply button - #3053

Open
jimlin-sfgov wants to merge 1 commit into
mainfrom
DAH-4340-fix-apply-button
Open

fix: DAH-4340 Apply button#3053
jimlin-sfgov wants to merge 1 commit into
mainfrom
DAH-4340-fix-apply-button

Conversation

@jimlin-sfgov

@jimlin-sfgov jimlin-sfgov commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

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

  • branch name begins with angular if it contains updates to Angular code
  • branch name contains the Jira ticket number
  • PR name follows type: TICKET-NUMBER Description format, use DAH-000 if it does not need a ticket
  • PR name follows urgent: Description format if it is urgent and does not need a ticket

Code quality

  • the set of changes is small
  • all automated code checks pass (linting, tests, coverage, etc.)
  • if the PR is a bugfix, there are tests and logs around the bug

Code conventions

  • web pages are formatted with .scss stylesheets and ui-seeds tokens, rather than inline styles or Tailwind

Review instructions

  • instructions specify which environment(s) it applies to
  • instructions work for PA testers
  • instructions have already been performed at least once

Request eng review

  • PR has needs review label
  • Use Housing Eng group to automatically assign reviewers, and/or assign specific engineers
  • If time sensitive, notify engineers in Slack

Before merging

Request product acceptance (PA) testing

  • PA tested in the review environment (use needs product acceptance label)
  • if PA testing cannot be done, changes are behind a feature flag

@alulabeshue-sfgov
alulabeshue-sfgov temporarily deployed to dahlia-webap-dah-4340-f-2xvnic September 2, 2026 00:00 Inactive
@jimlin-sfgov
jimlin-sfgov force-pushed the DAH-4340-fix-apply-button branch from 852e2f5 to df24bc6 Compare September 2, 2026 00:00
@jimlin-sfgov
jimlin-sfgov temporarily deployed to dahlia-webap-dah-4340-f-2xvnic September 2, 2026 00:00 Inactive
@jimlin-sfgov
jimlin-sfgov marked this pull request as ready for review September 2, 2026 00:02
Copilot AI lite review requested due to automatic review settings September 2, 2026 00:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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

@jimlin-sfgov
jimlin-sfgov requested review from a team, amyc-sfds, jtcaovan and kramduckner and removed request for a team and amyc-sfds September 2, 2026 16:29
@jimlin-sfgov jimlin-sfgov added the needs review Pull request needs review label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Pull request needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants