department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
79 stars 59 forks source link

Discovery around parentheses in phone numbers in Vet Center Operating Status More Info #11901

Open dsinla opened 1 year ago

dsinla commented 1 year ago

Describe the defect

Phone numbers in the operating status "more info" field for Vet Centers, appearing on the locations page, may not recognize phone numbers using parentheses so they aren't being formatted correctly.

From @mmiddaugh, original https://dsva.slack.com/archives/C0FQSS30V/p1670535690302759

When a phone number is entered with hyphens, the number is correctly rendered as a link: image

When the phone number is entered with parentheses, the number is not rendered as a link: image

Engineering notes

See this regex that matches phone numbers. This will not match the (xxx) xxx-xxxx version anywhere this is used. So, what we need to find:

To Reproduce

  1. Go to a Vet Center - Outstation page, for instance: https://prod.cms.va.gov/la-crosse-vet-center/wausau-vet-center-outstation
  2. Enter a phone number with hypens
  3. See the number rendered correctly as a link on the Locations page
  4. Enter a phone number with parenthesis
  5. See the number rendered incorrectly - no link - on the Locations page

AC / Expected behavior

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here. Reach out to the Product Managers to determine if it should be escalated as critical (prevents users from accomplishing their work with no known workaround and needs to be addressed within 2 business days).

Desktop (please complete the following information if relevant, or delete)

Labels

(You can delete this section once it's complete)

CMS Team

Please check the team(s) that will do this work.

mmiddaugh commented 1 year ago

@dsinla adding these steps to reproduce for clarity

  1. Go to a Vet Center - Outstation or Community access point page Examples:
  2. Click "Edit"
  3. Find the operating status box and enter a phone number formatted as (123) 456-7890 into the "operating status more info" field image
  4. Enter a revision log message and save as draft
  5. Return to the dashboard by clicking on the Vet Center name in the breadcrumb (i.e., Home > La Crosse Vet Center)
  6. Click "View" in the Locations page block on the Dashboard.
  7. Click the blue "Preview" button in the top right corner
  8. Scroll down to the relevant location on the preview Locations page
  9. Open the expandable operating status display
  10. Observe the phone number is not wrapped to be actionable on mobile or with assistive tech image
  11. Return to the edit screen for the location and repeat the process, editing the number by replacing the parentheses with hyphens (i.e., 123-456-7890)
  12. Enter a revision log message and save as draft
  13. Return to the dashboard by clicking on the Vet Center name in the breadcrumb (i.e., Home > La Crosse Vet Center)
  14. Click " View" in the Locations page block on the Dashboard.
  15. Click the blue "Preview button in the top right corner"
  16. Scroll down to the relevant location
  17. Open the expandable operating status display
  18. Observe the phone number is now actionable image

Suggest testing with other versions, such as

maxx1128 commented 1 year ago

My estimate: 5

Regexes are tricky, and regexes for content made by users on the CMS can get even tougher. This includes getting a flexible enough regex that is still accurate and correctly formatting the phone numbers in the same way.

JayDarnell commented 1 year ago

I would also estimate this with a 5. I believe we have some existing scripts we have used to manipulate phone data in the past but a 5 is a nice safe estimate in case we have to script this from scratch.

kmariepat-cityfriends commented 1 year ago

Next steps: we need to define requirements for this

kmariepat-cityfriends commented 1 year ago

the scope would be to define the desired behavior for all phone numbers