Skip to content
Snippets Groups Projects
Commit 5fab90c0 authored by Michal Gow's avatar Michal Gow Committed by Mark Jones
Browse files

Issue #3492699 by seogow: Fix evaluations listing to show proper links to individual evaluations

parent 7b1d0794
No related branches found
No related tags found
1 merge request!8Created link from ID, added default operations.
......@@ -28,7 +28,13 @@ final class AIEvaluationListBuilder extends EntityListBuilder {
*/
public function buildRow(EntityInterface $entity): array {
/** @var \Drupal\ai_evaluations\AIEvaluationInterface $entity */
$row['id'] = $entity->id();
$row['id'] = [
'data' => [
'#type' => 'link',
'#title' => $entity->id(),
'#url' => $entity->toUrl(),
],
];
$username_options = [
'label' => 'hidden',
'settings' => ['link' => $entity->get('uid')->entity->isAuthenticated()],
......@@ -39,4 +45,21 @@ final class AIEvaluationListBuilder extends EntityListBuilder {
return $row + parent::buildRow($entity);
}
/**
* {@inheritdoc}
*/
protected function getDefaultOperations(EntityInterface $entity): array {
$operations = parent::getDefaultOperations($entity);
if ($entity->access('view')) {
$operations['view'] = [
'title' => $this->t('View'),
'weight' => 0,
'url' => $entity->toUrl(),
];
}
return $operations;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment