mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-26 01:10:30 -04:00
fix(ui): keep settings subnav in-page and persist sidebar collapse
Scroll active application settings sections with buttons instead of Livewire navigation, persist sidebar collapse even with auto-collapse, drop the unused modal id, and right-align destination status.
This commit is contained in:
@@ -5,7 +5,7 @@ it('uses the shared status summary in the primary application server card', func
|
||||
$applicationSection = str($view)->before('@else')->value();
|
||||
|
||||
expect($applicationSection)
|
||||
->toContain('<x-status-summary :status="$resource->status" />')
|
||||
->toContain('<x-status-summary :status="$resource->status" align="right" />')
|
||||
->not->toContain('<x-status :resource="$resource"');
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
|
||||
test('input modal renders without requiring a modal id', function () {
|
||||
$html = Blade::render('<x-modal-input>Modal content</x-modal-input>');
|
||||
|
||||
expect($html)->toContain('Modal content');
|
||||
});
|
||||
|
||||
test('confirmation modal closes before dispatching an event that can open another modal', function () {
|
||||
$modal = file_get_contents(resource_path('views/components/modal-confirmation.blade.php'));
|
||||
|
||||
|
||||
@@ -45,6 +45,18 @@ test('configuration sidebar subitems trigger section highlight on scroll', funct
|
||||
->toContain('stableFrames');
|
||||
});
|
||||
|
||||
test('application configuration subitems scroll without navigating the active page', function () {
|
||||
$sidebar = file_get_contents(resource_path('views/components/application/configuration-sidebar.blade.php'));
|
||||
|
||||
expect($sidebar)
|
||||
->toContain("@if (\$menuItem['active'])")
|
||||
->toContain('<button type="button" class="menu-subitem"')
|
||||
->toContain("window.scrollToSettingsSection?.('{{ \$section['id'] }}')")
|
||||
->toContain('@else')
|
||||
->toContain("href=\"{{ route(\$menuItem['route'], \$applicationRouteParameters) }}#{{ \$section['id'] }}\"")
|
||||
->not->toContain("if (document.getElementById('{{ \$section['id'] }}'))");
|
||||
});
|
||||
|
||||
test('postgresql general navigation lists each in-page settings section', function () {
|
||||
$sidebar = file_get_contents(resource_path('views/components/database/configuration-sidebar.blade.php'));
|
||||
$general = file_get_contents(resource_path('views/livewire/project/database/postgresql/general.blade.php'));
|
||||
|
||||
@@ -27,7 +27,10 @@ it('initializes persisted sidebar state before enabling layout transitions', fun
|
||||
$layout = file_get_contents(resource_path('views/layouts/app.blade.php'));
|
||||
|
||||
expect($layout)
|
||||
->toContain("collapsed: localStorage.getItem('sidebarCollapsed') === 'true'")
|
||||
->toContain("userCollapsed: localStorage.getItem('sidebarCollapsed') === 'true'")
|
||||
->toContain('return this.userCollapsed || (this.autoCollapse && this.hasSecondBar);')
|
||||
->toContain('this.userCollapsed = this.collapsed;')
|
||||
->toContain("localStorage.setItem('sidebarCollapsed', this.userCollapsed);")
|
||||
->toContain('sidebarReady: false')
|
||||
->toContain(":class=\"[collapsed ? 'lg:w-16' : 'lg:w-56', sidebarReady ? 'transition-[width] duration-200' : '']\"")
|
||||
->toContain(":class=\"[collapsed ? 'lg:ml-16' : 'lg:ml-56', sidebarReady ? 'transition-[margin] duration-200' : '']\"");
|
||||
|
||||
Reference in New Issue
Block a user