Group dashboard activities under primary administration and tidy editorial overview
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-14 11:43:56 +02:00
parent ce8b744d1f
commit 73e1d7b964
12 changed files with 314 additions and 102 deletions
+37
View File
@@ -51,6 +51,43 @@ final class ContentManagement
return $result;
}
/** @param array<array-key,mixed> $access
* @return list<array{label:string,href:string}>
*/
public function dashboardNavigation(?User $actor, array $access): array
{
$workflow = app(PortalEditorialWorkflow::class);
if (! $actor || ! $workflow->available() || ! $workflow->canEnter($actor)) {
return [];
}
$items = [['label' => 'Visão geral', 'href' => '/management/editorial']];
$documents = app(DocumentManagementAccess::class);
if ($documents->full($actor) || $documents->editorial($actor)) {
foreach (['article' => 'Artigos', 'legislation' => 'Legislação', 'document' => 'Documentos'] as $kind => $label) {
$items[] = ['label' => $label, 'href' => '/management/editorial?kind='.$kind];
}
}
foreach (['opportunities' => 'Oportunidades', 'clusters' => 'Competitividade', 'portfolio' => 'Carteira', 'demography' => 'Demografia'] as $key => $label) {
if (isset($access[$key]['index'])) {
$items[] = ['label' => $label, 'href' => $access[$key]['index']];
}
}
if (app(PortalEditorialSubjects::class)->available() && $actor->can('manage-portal')) {
$items[] = ['label' => 'Estruturas e relações', 'href' => '/management/editorial/subjects'];
}
$native = app(PortalEditorialNativeNotices::class);
if ($native->access($actor, 'territorial-editorial-v1')) {
$items[] = ['label' => 'Conteúdos territoriais', 'href' => '/management/territorial/editorial'];
}
if ($native->access($actor, 'investment-zones')) {
$items[] = ['label' => 'Zonas e indicadores', 'href' => '/management/investment/zones'];
}
$items[] = ['label' => 'Notificações', 'href' => '/management/editorial#notificacoes'];
return $items;
}
/**
* @return array<array-key, mixed>
*/