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

Sort order for Vet Center Satellite locations #18229

Open mmiddaugh opened 3 months ago

mmiddaugh commented 3 months ago

Description

The Locations page for White River Junction Vet Center includes three Mobile Vet Center units: Hartford, Lewiston and White River Junction.

White River Junction MVC is a Satellite location affiliated with White River Junction Vet Center while the other two are listed as "Nearby" locations.

The sort order should prioritize those locations which are actually affiliated with the parent Vet Center.

I think this was a regression which may have occurred during the work for Improve sort order for satellite locations on Vet Center Locations pages #12096

Screenshot image.png
davidmpickett commented 3 months ago

Not technically a regression since the previous sort was fully alphabetical of all Satellite Locations, and didn't account for the any priority ranking. i.e. White River Junction MVC has always been listed last.

However, the desire to have a priority sort within Mobile Vet Centers was clearly articulated in the original ticket and that nuance did not make it into the implementation ticket.

The logic for distinguishing between the primary MVC and additional MVCs is going to be a little more complicated than the existing sort logic, because it will require identifying the one MVC that has a value for "Main Vet Center location" that matches the Main Vet Center on this Location page and then separating that from the other MVCs also associated with it. But all that information should be available via GraphQL, even if it's not a direct path.

mmiddaugh commented 3 months ago

Any MVCs not automatically affiliated with the location have been added by an editor as "additional" or "nearby" and should be identifiable.

davidmpickett commented 3 months ago

Just inspected the template and it looks like actually these are being queried as two separate groups of Mobile Vet Centers but then they are concatenated and sorted as a group. So that's great.

Should be a relatively easy fix to separate the sorting and concatenating. I think.