generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Point of Contact] Phone extension field (#961)
## Note Be sure the pull the latest from [_sbl-filing_](cfpb/sbl-filing-api#421) via `yarn update` closes #945 ## Changes - feat(Point of Contact): Added Phone Extension field to Point of Contact Field - chore(Point of Contact): Phone Extension breakpoint of 600px - feat(Sign and Submit): Added Phone Extension field to Verification field - chore(Sign and Submit): Matched order of fields to be the same as Point of Contact - feat(e2e): Added Phone Extension field to e2e test - style(DisplayField): added `work-break: break-all;` - content(Sign and Submit): added 'Extension' ## How to test this PR ### First Test 1. Upload a filing and navigate all the way to _Point of Contact_ 2. Verify the Phone Extension in both mobile and desktop (901 px and _above_) 3. Open the Network tab, submit and verify the request and response jsons contain the phone extension (i.e. `phone_ext`) ### Second Test 1. Navigate all the way to _Sign and Submit_ 2. Verify the `DisplayField` contains the submitted phone extension ### Third Test 1. Run `yarn run test:e2e` 2. Run the _sign-and-submit_ test to ensure it passes ## Screenshots | PoC (Desktop) | PoC (Mobile) | Sign and Submit | | -------- | ------- | ------- | |<img width="533" alt="Screenshot 2024-09-30 at 9 07 06 AM" src="https://github.com/user-attachments/assets/2210a4d8-e088-4cad-9d78-392aabc0de41">|<img width="516" alt="Screenshot 2024-09-30 at 9 07 20 AM" src="https://github.com/user-attachments/assets/cc203268-85bf-4826-8adc-d4740d1a91ea">|<img width="632" alt="Screenshot 2024-09-30 at 2 18 43 PM" src="https://github.com/user-attachments/assets/d18a1416-1cbc-494f-a561-d3cd44df22ba">|
- Loading branch information
1 parent
c6f68dc
commit 7368475
Showing
15 changed files
with
93 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,7 +231,7 @@ test('Form Alerts', async ({ | |
await test.step('Complete form', async () => { | ||
await page.getByLabel('First name').fill('Playwright'); | ||
await page.getByLabel('Last name').fill('Test'); | ||
await page.getByLabel('Work phone').fill('555-555-5555'); | ||
await page.getByLabel('Phone number').fill('555-555-5555'); | ||
await page.getByLabel('Email address').fill('[email protected]'); | ||
await page.getByLabel('Street address line 1').fill('555 Main St.'); | ||
await page.getByLabel('City').fill('Utah (U'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ | |
"hq_address_state": "CA", | ||
"hq_address_zip": "55555", | ||
"phone_number": "555-555-5555", | ||
"phone_ext": "8942", | ||
"email": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
function useWidthMatch(query: string): boolean { | ||
const [matches, setMatches] = useState<boolean>(false); | ||
|
||
useEffect(() => { | ||
const mediaQuery = window.matchMedia(query); | ||
setMatches(mediaQuery.matches); // Initial check | ||
|
||
const handleChange = (event: MediaQueryListEvent) => { | ||
setMatches(event.matches); | ||
}; | ||
|
||
mediaQuery.addEventListener('change', handleChange); | ||
|
||
return () => { | ||
mediaQuery.removeEventListener('change', handleChange); | ||
}; | ||
}, [query]); | ||
|
||
return matches; | ||
} | ||
|
||
export default useWidthMatch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters