## Summary - move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling - update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location - add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation` - integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404` ## Remaining Rollout Checks - validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout - confirm web, queue, and scheduler processes all start from the expected working directory in staging/production - verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #213
64 lines
2.5 KiB
PHP
64 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\FindingResource\Pages;
|
|
|
|
use App\Filament\Resources\FindingExceptionResource;
|
|
use App\Filament\Resources\FindingResource;
|
|
use App\Models\Finding;
|
|
use App\Support\Navigation\CrossResourceNavigationMatrix;
|
|
use App\Support\Navigation\RelatedNavigationResolver;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\ViewRecord;
|
|
use Illuminate\Contracts\Support\Htmlable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ViewFinding extends ViewRecord
|
|
{
|
|
protected static string $resource = FindingResource::class;
|
|
|
|
protected function resolveRecord(int|string $key): Model
|
|
{
|
|
return FindingResource::resolveScopedRecordOrFail($key);
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\Action::make('primary_related')
|
|
->label(fn (): string => app(RelatedNavigationResolver::class)
|
|
->primaryListAction(CrossResourceNavigationMatrix::SOURCE_FINDING, $this->getRecord())?->actionLabel ?? 'Open related record')
|
|
->url(fn (): ?string => app(RelatedNavigationResolver::class)
|
|
->primaryListAction(CrossResourceNavigationMatrix::SOURCE_FINDING, $this->getRecord())?->targetUrl)
|
|
->hidden(fn (): bool => ! (app(RelatedNavigationResolver::class)
|
|
->primaryListAction(CrossResourceNavigationMatrix::SOURCE_FINDING, $this->getRecord())?->isAvailable() ?? false))
|
|
->color('gray'),
|
|
Actions\Action::make('open_approval_queue')
|
|
->label('Open approval queue')
|
|
->icon('heroicon-o-arrow-top-right-on-square')
|
|
->color('gray')
|
|
->visible(function (): bool {
|
|
$record = $this->getRecord();
|
|
|
|
return $record instanceof Finding
|
|
&& FindingExceptionResource::canAccessApprovalQueueForTenant($record->tenant);
|
|
})
|
|
->url(function (): ?string {
|
|
$record = $this->getRecord();
|
|
|
|
return $record instanceof Finding
|
|
? FindingExceptionResource::approvalQueueUrl($record->tenant)
|
|
: null;
|
|
}),
|
|
Actions\ActionGroup::make(FindingResource::workflowActions())
|
|
->label('Actions')
|
|
->icon('heroicon-o-ellipsis-vertical')
|
|
->color('gray'),
|
|
];
|
|
}
|
|
|
|
public function getSubheading(): string|Htmlable|null
|
|
{
|
|
return FindingResource::findingSubheading($this->getRecord());
|
|
}
|
|
}
|