feat(analytics): add site analytics with grouped navigation sections
- Add Analytics container: models, tasks, jobs, controllers, routes, services - Add analytics config with section groups (structure, institute, content, services) - Add database tables: analytics_sessions, analytics_hits, analytics_daily_stats - Add frontend: Analytics page, section detail, chart, overview, navigation components - Add consent banner and JS tracking service (sendBeacon + Inertia listener) - Add permission sync for view_analytics, view_any_analytic - Fix trailing slash URL matching in GetNavigationSectionsTask - Fix event propagation on expand arrows in navigation sections - Fix RecordVisitJob to not depend on dropped analytics_geo_cache table - Replace plain text views/visitors with badge-style icons - Group navigation sections by category with separate blocks - Add config-driven non-CMS sections (faculties, divisions, DPO, journals) - Remove Events, TV, Sveden from analytics sections
This commit is contained in:
@@ -21,6 +21,11 @@ class SyncDashboardPermissions extends AbstractConsoleCommand
|
||||
'educational_group', 'division',
|
||||
];
|
||||
|
||||
private const EXTRA_PERMISSIONS = [
|
||||
'view_analytics',
|
||||
'view_any_analytic',
|
||||
];
|
||||
|
||||
private const PREFIXES = [
|
||||
'view_any', 'create', 'update', 'delete', 'restore', 'force_delete',
|
||||
];
|
||||
@@ -46,6 +51,13 @@ class SyncDashboardPermissions extends AbstractConsoleCommand
|
||||
['name' => 'view_any_contact_widget', 'guard_name' => 'web'],
|
||||
);
|
||||
|
||||
foreach (self::EXTRA_PERMISSIONS as $name) {
|
||||
Permission::firstOrCreate(
|
||||
['name' => $name, 'guard_name' => 'web'],
|
||||
);
|
||||
$created++;
|
||||
}
|
||||
|
||||
$roleNames = explode(',', $this->option('role'));
|
||||
$allPerms = Permission::where('guard_name', 'web')->get();
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ class HandleInertiaRequests extends Middleware
|
||||
}
|
||||
return 'empty';
|
||||
},
|
||||
'yandex_metrika_id' => config('services.yandex_metrika.id'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user