feat(helpdesk): add empty Dashboard page with sidebar nav item
Adds helpdesk/dashboard route, empty page/view, Overview nav group in the sidebar, and Dashboard i18n keys (de + en). No content yet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
"No tickets found": "Keine Tickets gefunden",
|
||||
"No tickets are linked to this debtor in Business Central.": "Diesem Kunden sind in Business Central keine Tickets zugeordnet.",
|
||||
"Ticket No.": "Ticket-Nr.",
|
||||
"Dashboard": "Dashboard",
|
||||
"Description": "Beschreibung",
|
||||
"Status": "Status",
|
||||
"Category": "Kategorie",
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"No tickets found": "No tickets found",
|
||||
"No tickets are linked to this debtor in Business Central.": "No tickets are linked to this debtor in Business Central.",
|
||||
"Ticket No.": "Ticket No.",
|
||||
"Dashboard": "Dashboard",
|
||||
"Description": "Description",
|
||||
"Status": "Status",
|
||||
"Category": "Category",
|
||||
|
||||
@@ -38,6 +38,7 @@ final class HelpdeskLayoutProvider implements LayoutContextProvider
|
||||
}
|
||||
|
||||
return ['helpdesk.nav' => [
|
||||
'can_view_dashboard' => true,
|
||||
'can_manage_settings' => $canManageSettings,
|
||||
'can_view_team' => $canViewTeam,
|
||||
'can_view_risk_radar' => $canViewRiskRadar,
|
||||
|
||||
@@ -14,6 +14,7 @@ return [
|
||||
'requires' => [],
|
||||
|
||||
'routes' => [
|
||||
['path' => 'helpdesk/dashboard', 'target' => 'helpdesk/dashboard'],
|
||||
['path' => 'helpdesk/search-data', 'target' => 'helpdesk/search-data'],
|
||||
['path' => 'helpdesk/domains', 'target' => 'helpdesk/domains'],
|
||||
['path' => 'helpdesk/domains-data', 'target' => 'helpdesk/domains-data'],
|
||||
|
||||
16
modules/helpdesk/pages/helpdesk/dashboard/index().php
Normal file
16
modules/helpdesk/pages/helpdesk/dashboard/index().php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use MintyPHP\Buffer;
|
||||
use MintyPHP\Module\Helpdesk\HelpdeskAuthorizationPolicy;
|
||||
use MintyPHP\Support\Guard;
|
||||
|
||||
Guard::requireLogin();
|
||||
Guard::requireAbilityOrForbidden(HelpdeskAuthorizationPolicy::ABILITY_ACCESS);
|
||||
|
||||
Buffer::set('title', t('Dashboard'));
|
||||
Buffer::set('style_groups', json_encode(['helpdesk']));
|
||||
$breadcrumbs = [
|
||||
['label' => t('Home'), 'path' => 'admin'],
|
||||
['label' => t('Helpdesk'), 'path' => 'helpdesk'],
|
||||
['label' => t('Dashboard')],
|
||||
];
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="app-details-container">
|
||||
<section>
|
||||
<?php
|
||||
$titlebar = ['title' => t('Dashboard')];
|
||||
require templatePath('partials/app-details-titlebar.phtml');
|
||||
?>
|
||||
</section>
|
||||
</div>
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
|
||||
$helpdeskNav = is_array($layoutNav['helpdesk.nav'] ?? null) ? $layoutNav['helpdesk.nav'] : [];
|
||||
$canViewDashboard = !empty($helpdeskNav['can_view_dashboard']);
|
||||
$canManageSettings = !empty($helpdeskNav['can_manage_settings']);
|
||||
$canViewTeam = !empty($helpdeskNav['can_view_team']);
|
||||
$canViewRiskRadar = !empty($helpdeskNav['can_view_risk_radar']);
|
||||
@@ -9,6 +10,7 @@ $canManageSoftwareProducts = !empty($helpdeskNav['can_manage_software_products']
|
||||
$canViewHandovers = !empty($helpdeskNav['can_view_handovers']);
|
||||
$canViewUpdates = !empty($helpdeskNav['can_view_updates']);
|
||||
|
||||
$dashboardActive = navActive('helpdesk/dashboard', true);
|
||||
$settingsActive = navActive('helpdesk/settings', true);
|
||||
$teamActive = navActive('helpdesk/team', true);
|
||||
$riskRadarActive = navActive('helpdesk/risk-radar', true);
|
||||
@@ -17,11 +19,24 @@ $softwareProductsActive = navActive('helpdesk/software-products', true);
|
||||
$handoversActive = navActive('helpdesk/handovers', true);
|
||||
$updatesActive = navActive('helpdesk/updates', true);
|
||||
$customersActive = navActive('helpdesk', true);
|
||||
if ($settingsActive['isActive'] || $teamActive['isActive'] || $riskRadarActive['isActive'] || $domainsActive['isActive'] || $softwareProductsActive['isActive'] || $handoversActive['isActive'] || $updatesActive['isActive']) {
|
||||
if ($dashboardActive['isActive'] || $settingsActive['isActive'] || $teamActive['isActive'] || $riskRadarActive['isActive'] || $domainsActive['isActive'] || $softwareProductsActive['isActive'] || $handoversActive['isActive'] || $updatesActive['isActive']) {
|
||||
$customersActive = ['class' => '', 'aria' => '', 'isActive' => false];
|
||||
}
|
||||
|
||||
$helpdeskNavGroups = [
|
||||
[
|
||||
'key' => 'helpdesk-overview',
|
||||
'label' => t('Overview'),
|
||||
'icon' => 'bi-speedometer2',
|
||||
'items' => [
|
||||
[
|
||||
'label' => t('Dashboard'),
|
||||
'path' => 'helpdesk/dashboard',
|
||||
'active' => $dashboardActive,
|
||||
'visible' => $canViewDashboard,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'key' => 'helpdesk-lookup',
|
||||
'label' => t('Lookup'),
|
||||
|
||||
Reference in New Issue
Block a user