mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 12:14:07 +00:00
fix(ui): scope resource card keys and env count hide
Limit enter/space deploy handlers to the card root with .self so nested focusable content no longer triggers deploy. Hide the environments table resource count on mobile via a stable class instead of nth-child.
This commit is contained in:
1 parent
1f550e8fcf
commit
37ed725dc1
5 files changed
+34
-11
No files matched your search
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
it('only deploys from keyboard events on the resource card itself', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/project/new/select.blade.php'));
|
||||
|
||||
expect(substr_count($view, '@keydown.enter.self.prevent='))->toBe(4)
|
||||
->and(substr_count($view, '@keydown.space.self.prevent='))->toBe(4)
|
||||
->and($view)->not->toContain('@keydown.enter.prevent=')
|
||||
->and($view)->not->toContain('@keydown.space.prevent=');
|
||||
});
|
||||
@@ -50,3 +50,16 @@ it('does not repeat the resources action outside the resources page', function (
|
||||
expect(file_get_contents(resource_path('views/livewire/project/resource/index.blade.php')))
|
||||
->toContain('New resource');
|
||||
});
|
||||
|
||||
it('uses a stable class for the environment resource count on mobile', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/project/show.blade.php'));
|
||||
$css = file_get_contents(resource_path('css/app.css'));
|
||||
|
||||
expect($view)
|
||||
->toContain('class="environment-resource-count">Resources</div>')
|
||||
->toContain('class="environment-resource-count text-[12px]');
|
||||
|
||||
expect($css)
|
||||
->toContain('.environments-table-grid .environment-resource-count')
|
||||
->not->toContain('.environments-table-grid > :nth-child(2)');
|
||||
});
|
||||
Reference in new issue
Block a user