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

Service Location: throw error if time zone entered into office hours comment on save #8861

Open JayDarnell opened 2 years ago

JayDarnell commented 2 years ago

Problem Statement

We recently migrated our service location office hours data from the old table field format to the new office hours format. The new office hours field stores three items for each day: start time, end time, and a comment. As part of that migration we cleaned up some key items that could end up in the comments field but they can still contain time zones: (ET, EST, CT, CST, MT, MST, PT, PST) We do not want time zones in the comments field so we need to throw an error if this occurs.

User Stories

1) As a Veteran or caregiver, I want to see only the times my chosen facility without time zones so that I have a clear understanding of the office hours for a specific facility without potentially conflicting information.

2) As an author in the CMS, I want to be told if I put in copy into the Office Hours 'Comment' field that contains time zone information, so that I don't accidentally provide conflicting information with automatically pulled office hours.

Implementation steps

Add a field validation function to the field_office_hours field on the service_location paragraph type. If the editor enters a time zone throw an error.

Design principles

Veteran-centered

Editor-centered

CMS Team

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

kevwalsh commented 2 years ago

COVID status pre-empted this during 57

kevwalsh commented 2 years ago

This needs further consideration within some broader Opening Hours issues, including help text guidance, error message writing, etc.

JQuaggles commented 1 year ago

@JayDarnell @swirtSJW Is this still relevant or has this been fixed / what's up with it?

JayDarnell commented 1 year ago

@JQuaggles this is still relevant. Two related issues were closed which audited these comment fields and then subsequently cleaned up the data.

Audit: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/9358 Cleanup: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/8935

We still need to add a validator to these fields to prevent time zones from being entered on save moving forward. This issue wasn't prioritized when it was created due to other more pressing matters at the time.

Note: The audit script created in 9358 needs to be updated. Line 91 references a field that is no longer present. Until this line is changed that script is effectively broken.

swirtSJW commented 1 year ago

This is related. #8883 When we bring in time zones, we will want to make sure we are not also getting timezones entered as comments.