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
97 stars 69 forks source link

Detail page menu parent becomes unfixable - tiny edge case #17032

Open swirtSJW opened 8 months ago

swirtSJW commented 8 months ago

Describe the defect

This defect only shows up in one edge case that is very unlikely to occur in the wild. Here are the requirements to meet the edge case

  1. VAMC editor

  2. Editing an existing page that is already published and exists directly under "Work with us" (an intentionally un-selectable parent for non-admins) Example: /lebanon-health-care/work-with-us/jobs-and-careers

  3. Change the parent from "work with us" to "Select a value" (essentially making it empty)

  4. Attempt to save the node either as draft of published

  5. The save will get rejected because parent can not be empty.

  6. Try to set the parent back to "Work with us" and you will see that it is not a choose-able option (which most of the time is what we want). image

  7. The editor is left with two options.

    1. Refresh the page (losing anyother changes they might have made.
    2. Move it somewhere it doesn't belong and contact a content admin to move it back under the Work with us parent.

AC / Expected behavior

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Labels

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

Team

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

swirtSJW commented 8 months ago

The easiest place to resolve this, is probably here MenuReductionService::applyVamcMenuRulesForDetailPage()

Inside the big loop if a parent option == the existing parent from the default revision, then do not lock it.