Restructure UX and seed a fully simulated organisation
Rework the dashboard, environment topology view, header navigation, and status rendering, and standardise selects on a shadcn-vue component. Replace the thin database seeder with a SimulatedEnvironmentSeeder that builds a fully wired, mostly-running organisation (ACTIVE server fleet, managed + GHCR registries, Gitea source provider, ClipBin app with production/staging environments, services, slices, endpoints, managed variables, build artifacts, and a completed/in-progress/failed operations history) so the new UI renders against realistic data.
This commit is contained in:
@@ -30,11 +30,7 @@ class HandleInertiaRequests extends Middleware
|
||||
return [
|
||||
...parent::share($request),
|
||||
'name' => config('app.name'),
|
||||
'organisation' => $request->route('organisation')
|
||||
? Organisation::with('applications.environments')
|
||||
->withCount(['providers', 'sourceProviders', 'registries', 'servers', 'applications'])
|
||||
->findOrFail($this->routeKey($request->route('organisation')))
|
||||
: null,
|
||||
'organisation' => $this->resolveOrganisation($request),
|
||||
'application' => $request->route('application')
|
||||
? Application::with('environments')->findOrFail($this->routeKey($request->route('application')))
|
||||
: null,
|
||||
@@ -53,6 +49,20 @@ class HandleInertiaRequests extends Middleware
|
||||
];
|
||||
}
|
||||
|
||||
private function resolveOrganisation(Request $request): ?Organisation
|
||||
{
|
||||
$query = Organisation::with('applications.environments')
|
||||
->withCount(['providers', 'sourceProviders', 'registries', 'servers', 'applications']);
|
||||
|
||||
if ($request->route('organisation')) {
|
||||
return $query->findOrFail($this->routeKey($request->route('organisation')));
|
||||
}
|
||||
|
||||
$organisationId = $request->user()?->organisations()->value('organisations.id');
|
||||
|
||||
return $organisationId ? $query->find($organisationId) : null;
|
||||
}
|
||||
|
||||
private function routeKey(mixed $routeValue): mixed
|
||||
{
|
||||
return $routeValue instanceof Model ? $routeValue->getKey() : $routeValue;
|
||||
|
||||
Reference in New Issue
Block a user