## 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
92 lines
3.3 KiB
PHP
92 lines
3.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\Ui\ActionSurface;
|
|
|
|
use App\Support\Ui\ActionSurface\Enums\ActionSurfaceProfile;
|
|
use App\Support\Ui\ActionSurface\Enums\ActionSurfaceSlot;
|
|
use App\Support\Ui\ActionSurface\Enums\ActionSurfaceType;
|
|
|
|
final class ActionSurfaceProfileDefinition
|
|
{
|
|
/**
|
|
* @return array<int, ActionSurfaceSlot>
|
|
*/
|
|
public function requiredSlots(ActionSurfaceProfile $profile): array
|
|
{
|
|
return match ($profile) {
|
|
ActionSurfaceProfile::CrudListAndEdit,
|
|
ActionSurfaceProfile::CrudListAndView => [
|
|
ActionSurfaceSlot::ListHeader,
|
|
ActionSurfaceSlot::InspectAffordance,
|
|
ActionSurfaceSlot::ListRowMoreMenu,
|
|
ActionSurfaceSlot::ListBulkMoreGroup,
|
|
ActionSurfaceSlot::ListEmptyState,
|
|
ActionSurfaceSlot::DetailHeader,
|
|
],
|
|
ActionSurfaceProfile::ListOnlyReadOnly => [
|
|
ActionSurfaceSlot::ListHeader,
|
|
ActionSurfaceSlot::InspectAffordance,
|
|
ActionSurfaceSlot::ListRowMoreMenu,
|
|
ActionSurfaceSlot::ListBulkMoreGroup,
|
|
ActionSurfaceSlot::ListEmptyState,
|
|
],
|
|
ActionSurfaceProfile::RunLog => [
|
|
ActionSurfaceSlot::ListHeader,
|
|
ActionSurfaceSlot::InspectAffordance,
|
|
ActionSurfaceSlot::ListBulkMoreGroup,
|
|
ActionSurfaceSlot::ListEmptyState,
|
|
ActionSurfaceSlot::DetailHeader,
|
|
],
|
|
ActionSurfaceProfile::RelationManager => [
|
|
ActionSurfaceSlot::ListHeader,
|
|
ActionSurfaceSlot::InspectAffordance,
|
|
ActionSurfaceSlot::ListRowMoreMenu,
|
|
ActionSurfaceSlot::ListBulkMoreGroup,
|
|
ActionSurfaceSlot::ListEmptyState,
|
|
],
|
|
};
|
|
}
|
|
|
|
public function requiresExportDefaultBulk(ActionSurfaceProfile $profile): bool
|
|
{
|
|
return in_array($profile, [
|
|
ActionSurfaceProfile::ListOnlyReadOnly,
|
|
ActionSurfaceProfile::RunLog,
|
|
], true);
|
|
}
|
|
|
|
/**
|
|
* @return array<int, ActionSurfaceType>
|
|
*/
|
|
public function allowedSurfaceTypes(ActionSurfaceProfile $profile): array
|
|
{
|
|
return match ($profile) {
|
|
ActionSurfaceProfile::CrudListAndEdit,
|
|
ActionSurfaceProfile::CrudListAndView => [
|
|
ActionSurfaceType::CrudListFirstResource,
|
|
ActionSurfaceType::ReadOnlyRegistryReport,
|
|
ActionSurfaceType::ConfigLite,
|
|
],
|
|
ActionSurfaceProfile::ListOnlyReadOnly => [
|
|
ActionSurfaceType::ReadOnlyRegistryReport,
|
|
],
|
|
ActionSurfaceProfile::RunLog => [
|
|
ActionSurfaceType::ReadOnlyRegistryReport,
|
|
ActionSurfaceType::QueueReview,
|
|
ActionSurfaceType::HistoryAudit,
|
|
],
|
|
ActionSurfaceProfile::RelationManager => [
|
|
ActionSurfaceType::CrudListFirstResource,
|
|
ActionSurfaceType::ReadOnlyRegistryReport,
|
|
],
|
|
};
|
|
}
|
|
|
|
public function allowsSurfaceType(ActionSurfaceProfile $profile, ActionSurfaceType $surfaceType): bool
|
|
{
|
|
return in_array($surfaceType, $this->allowedSurfaceTypes($profile), true);
|
|
}
|
|
}
|