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

Archived services should not result in node link report notices on system pages #13214

Closed swirtSJW closed 7 months ago

swirtSJW commented 1 year ago

Describe the defect

When a system health service is archived, the result is a notification from the node_link_report that there is a broken link image

The system services list is currently not filtering based on state

It should only:

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://prod.cms.va.gov/lovell-federal-health-care-tricare
  2. See alert at the top about links to unpublished content found.
  3. Scroll down and see links to unpublished system services.

AC / Expected behavior

changes

This field_clinical_health_services field is using Corresponding Entity Reference, the use and effect of which are not clear. Removing it may be key to changing which services are a part of the content of the node (or not). I can't seem to effect the output at present. In any case, it's not entirely clear what will happen on the front end if we do that, so it needs a little discovery.

Instead, this ticket will cover the editor-facing output. I have alphabetized and modified the output slightly, showing both Archived and Draft content in the meantime with clear indications of its moderation state.

jilladams commented 1 year ago

@swirtSJW Just to ask: this is CMS-wide, so could also get the CMS Team label? Or this is happening specific to Facilities?

Steve confirmed in refinement: this is Facilities specific.

swirtSJW commented 1 year ago

Details: This is coming from the field 'field_clinical_health_services'

which is linked not in the edit form but by corresponding entity reference /admin/config/content/cer/local_health_service_to_regions_health_service

We will need to alter the display of the field. Possibly with a View, or an alter if that is not an option.

swirtSJW commented 9 months ago

Either of these are options image

If we want unpublished but non-archived system services to show, so that editors are aware if they have something unpublished, we should go with the View filters.

If we want all unpublished system services to not show, then we could go with the "Default" but that may not remove things that were published and are now archived (it may only affect creation, not removal)

omahane commented 7 months ago

@xiongjaneg @mmiddaugh I went in a slightly different direction. This field_clinical_health_services field is using Corresponding Entity Reference, the use and effect of which are not clear. Removing it may be key to changing which services are a part of the content of the node (or not). I can't seem to effect the output at present. In any case, it's not entirely clear what will happen on the front end if we do that, so it needs a little discovery.

Instead, this ticket will cover the editor-facing output. I have alphabetized and modified the output slightly. After discussing this with @Becapa, it made sense to show both Archived and Draft content in the meantime with clear indications of its moderation state.

Archived VAMC system services (among the others)

Screenshot 2024-03-05 at 12 55 58 PM

A Draft VAMC system service (among the others)

Screenshot 2024-03-05 at 12 57 43 PM
omahane commented 7 months ago

After some more investigation, @Becapa and I figured out what CER does, which is actually very useful. When you create a VAMC System Health Service, CER updates the VACM System so that this service is now related to the system. That's how the service shows up there at all on the System node:view. Otherwise, it wouldn't. It also means that the field setting has nothing at all to do with what shows on the system node:view, which we suspected.

omahane commented 7 months ago

Either of these are options

If we want unpublished but non-archived system services to show, so that editors are aware if they have something unpublished, we should go with the View filters.

If we want all unpublished system services to not show, then we could go with the "Default" but that may not remove things that were published and are now archived (it may only affect creation, not removal)

To be super clear, neither of these are options, as the CER actually adds a reference to from the System to the Service. The field setting has no effect, as it would only be used on the form, anyway, and this field is hidden on the form display.

omahane commented 7 months ago

Details: This is coming from the field 'field_clinical_health_services'

which is linked not in the edit form but by corresponding entity reference /admin/config/content/cer/local_health_service_to_regions_health_service

We will need to alter the display of the field. Possibly with a View, or an alter if that is not an option.

In the PR associated with this ticket, we did alter the render array of the node, which allowed us to show the Archived and Draft services with labels and styles. We first tried removing the Archived services from the output, which can be done, but because the link report is loading up the load without running any of the alters, the report has no awareness of the changes we made to the render array or the links in the output. Thus, instead of hiding them, we are making them easy to distinguish.

omahane commented 7 months ago

TODO: Document this field: field_clinical_health_services

omahane commented 7 months ago

Documentation added here: https://prod.cms.va.gov/admin/structure/types/manage/health_care_region_page/fields/node.health_care_region_page.field_clinical_health_services/document

jilladams commented 7 months ago

Verified: https://prod.cms.va.gov/washington-dc-health-care - contains Draft services associated https://prod.cms.va.gov/lovell-federal-health-care-tricare - has archived services associated Now alpha sorted.

Screenshot 2024-03-08 at 7 01 20 PM

Screenshot 2024-03-08 at 7 01 24 PM