diff --git a/docroot/modules/custom/va_gov_vamc/css/set_vamc_system_health_service.css b/docroot/modules/custom/va_gov_vamc/css/set_vamc_system_health_service.css new file mode 100644 index 00000000000..83c9900f120 --- /dev/null +++ b/docroot/modules/custom/va_gov_vamc/css/set_vamc_system_health_service.css @@ -0,0 +1,3 @@ +.field--name-field-clinical-health-services a.node--unpublished { + padding: unset; + } \ No newline at end of file diff --git a/docroot/modules/custom/va_gov_vamc/src/EventSubscriber/VAMCEntityEventSubscriber.php b/docroot/modules/custom/va_gov_vamc/src/EventSubscriber/VAMCEntityEventSubscriber.php index f3e94040a1c..d1b51c31a9c 100644 --- a/docroot/modules/custom/va_gov_vamc/src/EventSubscriber/VAMCEntityEventSubscriber.php +++ b/docroot/modules/custom/va_gov_vamc/src/EventSubscriber/VAMCEntityEventSubscriber.php @@ -171,17 +171,10 @@ public function alterAppendedSystemHealthServices(EntityViewAlterEvent $event):v unset($build['field_clinical_health_services'][$key]); $service_node = $services_copy[$key]['#options']['entity']; $moderationState = $service_node->get('moderation_state')->value; - // Remove archived from temp array. - if ($moderationState === 'archived') { - unset($services_copy[$key]); - } - // If draft, show as such on view. - $thisRevisionIsPublished = $service_node->isPublished(); - $defaultRevisionIsPublished = (isset($service_node->original) && ($service_node->original instanceof EntityInterface)) - ? (bool) $service_node->original->status->value - : (bool) $service_node->status->value; - if (!$defaultRevisionIsPublished && !$thisRevisionIsPublished) { + // Identify archive and draft in temp array. + if ($moderationState === 'archived' || $moderationState === 'draft') { $services_copy[$key]['#attributes'] = ['class' => 'node--unpublished']; + $services_copy[$key]['#title'] .= ' (' . ucfirst($moderationState) . ')'; } } }