## Summary - consolidate internal platform naming from `Tenant` to `Environment` / `ManagedEnvironment` across models, controllers, services, and Filament resources - rename environment-scoped UI surfaces such as dashboards, chooser flows, navigation, and related widgets to match the updated environment-first domain language - align middleware, onboarding/review lifecycle services, jobs, and route/context controllers with the new environment-scoped architecture ## Validation - not rerun as part of this commit/push/PR request ## Notes - branch is 1 commit ahead of `platform-dev` - main commit: `refactor: consolidate internal tenant model naming` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #355
48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Widgets\Dashboard;
|
|
|
|
use App\Models\ManagedEnvironment;
|
|
use App\Support\EnvironmentDashboard\EnvironmentDashboardSummaryBuilder;
|
|
use Filament\Facades\Filament;
|
|
use Filament\Widgets\Widget;
|
|
|
|
class EnvironmentDashboardContextChips extends Widget
|
|
{
|
|
protected static bool $isLazy = false;
|
|
|
|
protected int|string|array $columnSpan = 'full';
|
|
|
|
protected string $view = 'filament.widgets.dashboard.environment-dashboard-context-chips';
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
protected function getViewData(): array
|
|
{
|
|
$tenant = Filament::getTenant();
|
|
|
|
if (! $tenant instanceof ManagedEnvironment) {
|
|
return [
|
|
'context' => [
|
|
'workspace' => __('localization.dashboard.overview.context_workspace'),
|
|
'tenant' => __('localization.dashboard.overview.context_no_environment'),
|
|
'provider' => null,
|
|
'providerKey' => null,
|
|
'latestActivity' => null,
|
|
],
|
|
'pollingInterval' => null,
|
|
];
|
|
}
|
|
|
|
$summary = app(EnvironmentDashboardSummaryBuilder::class)->build($tenant, auth()->user());
|
|
|
|
return [
|
|
'context' => $summary->context,
|
|
'pollingInterval' => $summary->pollingInterval,
|
|
];
|
|
}
|
|
}
|