mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-28 02:06:37 -04:00
fix(ui): gate copy button on clipboard API support
Only show the copy control when isSecureContext and clipboard.writeText are available, and style the empty internal hostname state as a readonly input to match adjacent fields.
This commit is contained in:
@@ -14,6 +14,7 @@ it('shows internal Docker access details in application general settings', funct
|
||||
->toContain('Network aliases')
|
||||
->toContain('wire:init="loadCurrentInternalHostname"')
|
||||
->toContain('$currentInternalHostname')
|
||||
->toContain('class="input input-with-copy-button bg-white dark:bg-coolgray-100 dark:read-only:bg-coolgray-100 dark:read-only:text-white"')
|
||||
->not->toContain('Changes with each deployment')
|
||||
->toContain("window.scrollToSettingsSection?.('networking-section')")
|
||||
->and($generalComponent)
|
||||
|
||||
@@ -38,7 +38,9 @@ it('renders copy fields as visible readonly controls with an accessible copy act
|
||||
expect($html)
|
||||
->toContain('label class="flex gap-1 items-center mb-1 text-sm font-medium text-black dark:text-white"')
|
||||
->toContain('readonly')
|
||||
->toContain('input-with-copy-button')
|
||||
->toContain("canCopy: window.isSecureContext && typeof navigator.clipboard?.writeText === 'function'")
|
||||
->toContain("x-bind:class=\"{ 'input-with-copy-button': canCopy }\"")
|
||||
->toContain('x-show="canCopy"')
|
||||
->toContain('copy-button')
|
||||
->toContain('aria-label="Copy to clipboard"')
|
||||
->toContain('title="Copy to clipboard"')
|
||||
|
||||
Reference in New Issue
Block a user