refactor(application): extract status and internal access components

Move internal hostname loading and breadcrumb status into dedicated
Livewire components with live refresh. Merge public/internal access
into one Access section, bind Enter to save on the unsaved bar, and
drop x-teleport wrappers from popup and global search.
This commit is contained in:
Andras Bacsai
2026-08-06 14:29:25 +02:00
parent a6ab360ac2
commit 0be13113d1
17 changed files with 259 additions and 211 deletions
@@ -3,11 +3,19 @@
it('shows internal Docker access details in application general settings', function () {
$generalSettings = file_get_contents(resource_path('views/livewire/project/application/general.blade.php'));
$generalComponent = file_get_contents(app_path('Livewire/Project/Application/General.php'));
$internalAccessSettings = file_get_contents(resource_path('views/livewire/project/application/internal-access.blade.php'));
$internalAccessComponent = file_get_contents(app_path('Livewire/Project/Application/InternalAccess.php'));
$configurationSidebar = file_get_contents(resource_path('views/components/application/configuration-sidebar.blade.php'));
expect($generalSettings)
->toContain('id="access-section" title="Access"')
->toContain('<h3 class="mb-4 text-sm font-semibold text-black dark:text-fg">Public access</h3>')
->toContain('<livewire:project.application.internal-access')
->not->toContain('wire:init="loadCurrentInternalHostname"')
->and($internalAccessSettings)
->toContain('id="internal-access-section"')
->toContain('title="Internal access"')
->toContain('<h3 class="mb-4 text-sm font-semibold text-black dark:text-fg">Internal access</h3>')
->not->toContain('<x-application.settings-section')
->toContain('Internal hostname')
->toContain('Docker network')
->toContain('Exposed ports')
@@ -18,12 +26,14 @@ it('shows internal Docker access details in application general settings', funct
->not->toContain('Changes with each deployment')
->toContain("window.scrollToSettingsSection?.('networking-section')")
->and($generalComponent)
->not->toContain('public function loadCurrentInternalHostname(): void')
->and($internalAccessComponent)
->toContain('public ?string $currentInternalHostname = null;')
->toContain('public function loadCurrentInternalHostname(): void')
->toContain('getCurrentApplicationContainerStatus(')
->toContain("data_get(\$currentContainer, 'Names')")
->and($configurationSidebar)
->toContain("['id' => 'internal-access-section', 'label' => 'Internal access']");
->toContain("['id' => 'access-section', 'label' => 'Access']");
});
it('does not show the internal access section for Docker Compose applications', function () {
@@ -33,5 +43,7 @@ it('does not show the internal access section for Docker Compose applications',
expect($generalSettings)
->toContain("@if (\$buildPack !== 'dockercompose')")
->and($configurationSidebar)
->toContain("\$isComposeApp ? null : ['id' => 'internal-access-section', 'label' => 'Internal access']");
->toContain("['id' => 'access-section', 'label' => 'Access']")
->not->toContain("['id' => 'public-access-section', 'label' => 'Public access']")
->not->toContain("['id' => 'internal-access-section', 'label' => 'Internal access']");
});