Frontend: - Connect MetroMap to live Inertia props (replace hardcoded demo data) - Drill-down navigation via router.visit for project-level maps - Reactive breadcrumb based on map level - Empty state when no projects exist - Reusable Modal component with retro styling - ProjectForm and CommitmentForm with Inertia useForm - FormInput reusable component (text, date, textarea, select) - FloatingActions FAB button for creating projects/themes Backend: - CommitmentService + CommitmentController (CRUD, mark complete, overdue) - DocumentService + DocumentController (upload, download, delete) - MapController now passes users and speerpunten to frontend - 7 new routes (4 commitment, 3 document) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\MapDataService;
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Inertia;
|
|
|
|
class MapController extends Controller
|
|
{
|
|
public function __construct(
|
|
private MapDataService $mapDataService
|
|
) {}
|
|
|
|
public function index()
|
|
{
|
|
$mapData = $this->mapDataService->getStrategyMap();
|
|
|
|
return Inertia::render('Map/MetroMap', [
|
|
'mapData' => $mapData,
|
|
'users' => \App\Models\User::select('id', 'name')->get(),
|
|
'speerpunten' => \App\Models\Speerpunt::select('id', 'naam', 'thema_id')->with('thema:id,naam')->get(),
|
|
]);
|
|
}
|
|
|
|
public function project(int $projectId)
|
|
{
|
|
$mapData = $this->mapDataService->getProjectMap($projectId);
|
|
|
|
return Inertia::render('Map/MetroMap', [
|
|
'mapData' => $mapData,
|
|
'users' => \App\Models\User::select('id', 'name')->get(),
|
|
'speerpunten' => \App\Models\Speerpunt::select('id', 'naam', 'thema_id')->with('thema:id,naam')->get(),
|
|
]);
|
|
}
|
|
|
|
public function apiStrategy(Request $request)
|
|
{
|
|
return response()->json($this->mapDataService->getStrategyMap());
|
|
}
|
|
|
|
public function apiProject(int $projectId)
|
|
{
|
|
return response()->json($this->mapDataService->getProjectMap($projectId));
|
|
}
|
|
}
|