From 1b6b46ab9a5b4c461ea6e3ed20284e6edaa693fb Mon Sep 17 00:00:00 2001 From: Paul Weidner Date: Fri, 25 Aug 2023 11:37:32 -0700 Subject: [PATCH] Render entity labels using h6 tag --- .../src/Plugin/Block/FarmMetricsBlock.php | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/core/ui/metrics/src/Plugin/Block/FarmMetricsBlock.php b/modules/core/ui/metrics/src/Plugin/Block/FarmMetricsBlock.php index ce858d451..538d9ce0f 100644 --- a/modules/core/ui/metrics/src/Plugin/Block/FarmMetricsBlock.php +++ b/modules/core/ui/metrics/src/Plugin/Block/FarmMetricsBlock.php @@ -74,13 +74,15 @@ class FarmMetricsBlock extends BlockBase implements ContainerFactoryPluginInterf // Create a container for asset metrics. $assets_label = $this->entityTypeManager->getStorage('asset')->getEntityType()->getCollectionLabel(); - $output['asset'] = [ - '#markup' => '' . Link::createFromRoute($assets_label, 'view.farm_asset.page')->toString() . ' (' . $this->t('active') . ')', - 'metrics' => [ - '#type' => 'container', - '#attributes' => [ - 'class' => 'assets metrics-container', - ], + $output['asset']['label'] = [ + '#type' => 'html_tag', + '#tag' => 'h6', + '#value' => Link::createFromRoute($assets_label, 'view.farm_asset.page')->toString() . ' (' . $this->t('active') . ')', + ]; + $output['asset']['metrics'] = [ + '#type' => 'container', + '#attributes' => [ + 'class' => 'assets metrics-container', ], ]; $metrics = $this->getEntityMetrics('asset'); @@ -97,13 +99,15 @@ class FarmMetricsBlock extends BlockBase implements ContainerFactoryPluginInterf // Create a section for log metrics. $logs_label = $this->entityTypeManager->getStorage('log')->getEntityType()->getCollectionLabel(); - $output['log'] = [ - '#markup' => '' . Link::createFromRoute($logs_label, 'view.farm_log.page')->toString() . '', - 'metrics' => [ - '#type' => 'container', - '#attributes' => [ - 'class' => 'logs metrics-container', - ], + $output['log']['label'] = [ + '#type' => 'html_tag', + '#tag' => 'h6', + '#value' => Link::createFromRoute($logs_label, 'view.farm_log.page')->toString(), + ]; + $output['log']['metrics'] = [ + '#type' => 'container', + '#attributes' => [ + 'class' => 'logs metrics-container', ], ]; $metrics = $this->getEntityMetrics('log');