Group dashboard activities under primary administration and tidy editorial overview
tests / ci (push) Waiting to run
tests / ci (push) Waiting to run
This commit is contained in:
@@ -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>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user