feat: DAH-4006 I2I Next steps page and refactor with I2A#2862
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
There was a problem hiding this comment.
PII
More Details
| Attribute | Value |
|---|---|
| Data Classifier | PII/Name |
| Data Classifier ID | BUILTIN-125 |
Sampled Examples
| Key | Value |
|---|---|
| assistance.contact.helpLine.title1 | Frc*o |
| assistance.contact.questionsAboutListings.title1 | D****A |
Rule ID: BUILTIN-125
To ignore this finding as an exception, reply to this conversation with #wiz_ignore reason
If you'd like to ignore this finding in all future scans, add an exception in the .wiz file (learn more) or create an Ignore Rule (learn more).
To get more details on how to remediate this issue using AI, reply to this conversation with #wiz remediate
There was a problem hiding this comment.
Pull request overview
This PR introduces a unified “Invite To” (Next Steps) experience that consolidates Invite-to-Apply (I2A) and adds Invite-to-Interview (I2I) pages, along with backend/API changes to record invite responses and send messages through the updated messaging endpoint.
Changes:
- Add new
/next-stepsReact page(s) for I2A + I2I and update Rails routes/views to render the new page. - Replace the legacy invite-to-apply response API controller with a new
InviteToResponseControllerand update the JS API client accordingly. - Refactor
DahliaBackend::MessageServiceto support sending messages via/api/v1/messagesand update specs/tests/translations.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/services/dahlia_backend/message_service_spec.rb | Updates service specs for new argument shape and /api/v1/messages endpoint. |
| spec/controllers/invite_to_controller_spec.rb | Renames controller spec target and updates expected props/params (currently inconsistent with implementation). |
| spec/controllers/api/v1/invite_to_response_controller_spec.rb | Adds specs for the new response-recording API controller. |
| config/routes.rb | Adds /next-steps routes, re-points record-response routes to the new controller, keeps deprecated I2A paths. |
| app/views/invite_to_apply_page/invite_to_apply.html.slim | Removes old I2A Slim view. |
| app/views/invite_to/invite_to.html.slim | Adds new Slim view mounting InviteToPage. |
| app/services/dahlia_backend/message_service.rb | Updates invite response sending to support new action-based endpoint selection and payload prep. |
| app/javascript/util/routeUtil.ts | Adds generateSubmitLink and renames AppPages.InviteToApply to InviteTo. |
| app/javascript/pages/inviteToApply/invite-to-apply.tsx | Removes legacy InviteToApplyPage React entry. |
| app/javascript/pages/inviteTo/inviteToInterview/InviteToInterviewNextSteps.tsx | Adds I2I next steps page content. |
| app/javascript/pages/inviteTo/inviteToInterview/InviteToInterviewDocuments.tsx | Adds I2I document checklist page content. |
| app/javascript/pages/inviteTo/inviteToApply/InviteToApplyWithdrawn.tsx | Refactors I2A withdrawn page to shared module styles/imports. |
| app/javascript/pages/inviteTo/inviteToApply/InviteToApplySubmitYourInfo.tsx | Refactors I2A submit page; updates response recording payload to new API. |
| app/javascript/pages/inviteTo/inviteToApply/InviteToApplyDocuments.tsx | Refactors I2A documents page to shared module styles/imports. |
| app/javascript/pages/inviteTo/inviteToApply/InviteToApplyContactMeLater.tsx | Refactors I2A contact-me-later page to shared module styles/imports. |
| app/javascript/pages/inviteTo/invite-to.tsx | Adds unified InviteToPage routing logic for I2A/I2I. |
| app/javascript/pages/inviteTo/invite-to.module.scss | Updates shared styles used across new InviteTo pages. |
| app/javascript/pages/inviteTo/InviteToLeasingAgentInfo.tsx | Updates shared leasing agent component to use new shared styles. |
| app/javascript/pages/inviteTo/InviteToHeader.tsx | Updates shared header component to use new shared styles. |
| app/javascript/pages/inviteTo/InviteToGetHelp.tsx | Updates shared “Get help” component to use new shared styles. |
| app/javascript/pages/inviteTo/InviteToDeadlinePassed.tsx | Renames/refactors deadline-passed component to shared InviteTo naming/styles. |
| app/javascript/packs/react_application.tsx | Switches pack entry from InviteToApplyPage to InviteToPage. |
| app/javascript/api/inviteToApplyApiService.ts | Updates response-recording API path and payload fields. |
| app/javascript/tests/pages/invite-to-interview.test.tsx | Adds initial test coverage for I2I documents rendering. |
| app/javascript/tests/pages/invite-to-apply.test.tsx | Updates I2A tests to use InviteToPage (currently inconsistent with component prop names). |
| app/javascript/tests/api/inviteToApplyApiService.test.ts | Updates API service test for new payload fields. |
| app/controllers/invite_to_controller.rb | Replaces old controller with unified InviteTo controller (token decode currently disabled). |
| app/controllers/api/v1/invite_to_response_controller.rb | Adds new API controller for recording responses. |
| app/controllers/api/v1/invite_to_apply_controller.rb | Removes legacy invite-to-apply API controller. |
| app/assets/json/translations/react/en.json | Adds new translation strings for I2I pages. |
Comments suppressed due to low confidence (6)
app/controllers/invite_to_controller.rb:17
- The upload URL is merged into
@invite_to_propsas a top-levelurl, but the React page readsurlParams.url(and older code/tests expectfileUploadUrl). As-is, the upload URL likely won’t reach the component. Please normalize where this value lives (either insideurlParamsor consumed as a top-level prop).
app/controllers/invite_to_controller.rb:8 - Token decoding is currently commented out, so
params[:t]is ignored and token-based links can’t populatedeadline/appId/inviteAction(and won’t record a response). Re-enabledecode_token(at least whentis present) so emailed JWT links work.
spec/controllers/api/v1/invite_to_response_controller_spec.rb:20 - The controller expects a
typekey (params.expect(record: %i[type ...])), but this spec’s request payload omits it. Ifparams.expectenforces presence, this will raise. Includetypein the test request (or maketypeoptional in the controller).
app/controllers/invite_to_controller.rb:43 propsandrecord_responseonly look atinviteAction/response, but the token/test data usesaction. To avoid silently dropping responses, acceptactionas an alias (e.g.,decoded_params['inviteAction'] || decoded_params['action']).
spec/controllers/invite_to_controller_spec.rb:78- The spec expects
urlParamsto containaction, but the React component/controller useinviteAction. Align the spec with the actual contract (or update the controller/component) so the prop naming is consistent.
spec/controllers/invite_to_controller_spec.rb:81 - The spec expects a top-level
fileUploadUrl, but the controller currently merges a top-levelurl(and the React page readsurlParams.url). Update the spec and implementation to agree on a single prop name/location so the upload URL is actually usable.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return [] | ||
| } | ||
| })() | ||
| : [] |
There was a problem hiding this comment.
suggestion: can we pull this out into a small function with a clear name for readability?
| const isI2IEnabled = isI2IEnabledFlag && listing?.Id && enabledListingIds.includes(listing.Id) | ||
|
|
||
| /* I2I - Invite to Interview pages */ | ||
| if (type === "I2I") { |
There was a problem hiding this comment.
question/suggestion: Would it make sense to create separate component files for rendering the I2I type and the I2A type?
There is a decent amount of branching render logic that is a little tricky to track.
for example:
if (type === "I2I"){
...
return <I2I {props} />
}
if (type === "I2A") {
...
return <I2A {props} />
}
Description
Continued I2I/I2A refactoring and next steps page frontend.
Note: this PR builds on #2855
New strings need an engineer with Phrase access to push.
Jira ticket
https://sfgovdt.jira.com/browse/DAH-4006
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)