Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-17426: Requires VA facility location when the event is using a VA facility location type #17859

Conversation

dsasser
Copy link
Contributor

@dsasser dsasser commented Apr 16, 2024

Description

Forces an Event with a Facility location type to also specify the Facility location.

Relates to #17426

Testing done

Manual and cypress

Screenshots

Screenshot 2024-04-16 at 7 19 28 AM

QA steps

As a content admin

  1. Visit node/add/event
  2. Set the 'Location type' to "At a VA facility"
    • Validate that the 'Facility location' field is visible and required

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

@va-cms-bot va-cms-bot temporarily deployed to Tugboat April 16, 2024 03:11 Destroyed
@dsasser dsasser marked this pull request as ready for review April 16, 2024 14:22
@dsasser dsasser requested a review from a team as a code owner April 16, 2024 14:22
Copy link
Contributor

@omahane omahane left a comment

Choose a reason for hiding this comment

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

The fields seem to be required, having all the trappings of requirement, but I can save the page without filling in either VA location (when "At a VA facility" is chosen) or an address (when "At a non-VA location" is chosen).

I did this here: https://pr17859-vpvmby9elrebdlxtkz0lfeyzfggxlf4j.ci.cms.va.gov/node/67710/edit

Here's a video of me doing so.

https://www.loom.com/share/05c581e632e94fbf8786bb528fa6f9cf?sid=34adf16d-4c51-4c74-ae11-d071e7fdd5d4

@dsasser
Copy link
Contributor Author

dsasser commented Apr 16, 2024

The fields seem to be required, having all the trappings of requirement, but I can save the page without filling in either VA location (when "At a VA facility" is chosen) or an address (when "At a non-VA location" is chosen).

I did this here: https://pr17859-vpvmby9elrebdlxtkz0lfeyzfggxlf4j.ci.cms.va.gov/node/67710/edit

Here's a video of me doing so.

https://www.loom.com/share/05c581e632e94fbf8786bb528fa6f9cf?sid=34adf16d-4c51-4c74-ae11-d071e7fdd5d4

That's....not good at all. And I was able to replicate this prior to this change as well, so something very peculiar is going on that I'll need to look into.

…n-be-saved-with-facilty-type-va-empty-location
@dsasser
Copy link
Contributor Author

dsasser commented Apr 17, 2024

@edmund-dunn @omahane I verified that this is an existing bug, not introduced in this PR, and I think I have located the culprit: clientside validation (or so it seems).

Screenshot 2024-04-17 at 12 23 28 PM

If I disable clientside validation for all forms, then Events are validated client-side as expected. But re-enabling that setting, and I'm able to bypass client-side validation. To recreate on staging:

  1. Visit node/67744/edit
  2. Make no changes, and attempt to save (it shouldn't let you since a revision log is required).
  3. Notice how it let you submit the form unexpectedly (no browser/client-side error), but thankfully Drupal's backend field validation prevented saving.
  4. Visit /admin/config/user-interface/clientside-validation
  5. Uncheck the box to disable clientside validation for all forms, and save the form.
  6. Revisit node/67744/edit (make sure you load the page again if you have it open in a separate tab)
  7. Try to save.
  8. Notice you get the expected browser validation error

@jilladams
Copy link
Contributor

Noting: next steps for what we do about that bug are in discussion on the ticket; #17426 (comment)

@dsasser
Copy link
Contributor Author

dsasser commented Apr 18, 2024

@omahane given we know that the issue you found is pre-existing, how would you feel about reviewing this with Clientside Validation turned off?

…n-be-saved-with-facilty-type-va-empty-location
@va-cms-bot va-cms-bot temporarily deployed to Tugboat April 25, 2024 21:05 Destroyed
Copy link

Code Scanning Analysis Not Found

Your repository default branch has not been scanned with CodeQL in the last 7 days. Per VA policy your repository must use CodeQL to scan your source code for vulnerabilities at least once every 7 days against your default branch.

Once you have completed the scan against your default branch, follow this link to re-run the policy check and select Re-run all jobs at the top of the page: https://github.com/department-of-veterans-affairs/va.gov-cms/actions/runs/8839385387

@dsasser dsasser requested a review from omahane April 26, 2024 19:07
Copy link
Contributor

@omahane omahane left a comment

Choose a reason for hiding this comment

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

Code looks good. And the UI/UX is working. Let's hope that the subsequent work to get clientside_validation out of the way will make the browser validation work correctly.

@dsasser dsasser merged commit b8ec013 into main Apr 27, 2024
21 of 22 checks passed
@dsasser dsasser deleted the VACMS-17426-events-can-be-saved-with-facilty-type-va-empty-location branch April 27, 2024 15:04
timcosgrove pushed a commit that referenced this pull request May 6, 2024
…VA facility location type (#17859)

* VACMS-17426: Requires VA facility location when the event is using a VA facility location type.

* VACMS-17426: Conditionally sets the requirement for Event Location Type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants