mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-26 09:20:54 -04:00
fix(analytics): keep setup prompt dismissed after refresh
Give the traffic analytics prompt a stable Livewire key and label the server link “Set up on”. Add a browser test for the link and persistent dismissal.
This commit is contained in:
@@ -90,7 +90,7 @@ $appListboxOptions = array_merge(
|
||||
|
||||
{{-- Nudge: enabled-eligible servers that haven't turned traffic analytics on yet. --}}
|
||||
@if ($scopedServerUuid === null && ! empty($eligibleDisabledServers))
|
||||
<div x-data="{ dismissed: localStorage.getItem('traffic-nudge-{{ $nudgeKey }}') === '1' }" x-show="!dismissed" x-cloak
|
||||
<div wire:key="analytics-traffic-nudge" x-data="{ dismissed: localStorage.getItem('traffic-nudge-{{ $nudgeKey }}') === '1' }" x-show="!dismissed" x-cloak
|
||||
class="flex items-start gap-3 rounded-xl border border-neutral-200 bg-white px-4 py-3 shadow-sm dark:border-white/[0.08] dark:bg-white/[0.025]">
|
||||
<div class="min-w-0 flex-1">
|
||||
<p class="text-[12px] font-semibold text-black dark:text-fg">
|
||||
@@ -104,7 +104,7 @@ $appListboxOptions = array_merge(
|
||||
<div class="flex shrink-0 items-center gap-2">
|
||||
@if (count($eligibleDisabledServers) === 1)
|
||||
<a class="button" href="{{ route('server.analytics', ['server_uuid' => $eligibleDisabledServers[0]['uuid']]) }}" {{ wireNavigate() }}>
|
||||
Enable on {{ \Illuminate\Support\Str::limit($eligibleDisabledServers[0]['name'], 16) }}
|
||||
Set up on {{ \Illuminate\Support\Str::limit($eligibleDisabledServers[0]['name'], 16) }}
|
||||
</a>
|
||||
@else
|
||||
<a class="button" href="{{ route('server.index') }}" {{ wireNavigate() }}>
|
||||
|
||||
@@ -44,6 +44,25 @@ it('shows the disabled empty state on the global analytics page', function () {
|
||||
->screenshot(filename: 'global-analytics-disabled-empty-state');
|
||||
});
|
||||
|
||||
it('dismisses the global analytics enable prompt', function () {
|
||||
loginAndSkipBoarding();
|
||||
|
||||
$page = visit('/analytics');
|
||||
|
||||
$page->assertVisible('[title="Dismiss"]')
|
||||
->assertSee('Set up on localhost');
|
||||
|
||||
expect($page->attribute('Set up on localhost', 'href'))
|
||||
->toContain('/server/'.$this->stack['server']->uuid.'/analytics');
|
||||
|
||||
$page->click('[title="Dismiss"]')
|
||||
->assertMissing('[title="Dismiss"]')
|
||||
->refresh()
|
||||
->assertSee('Traffic analytics is not enabled')
|
||||
->assertMissing('[title="Dismiss"]')
|
||||
->screenshot(filename: 'global-analytics-prompt-dismissed');
|
||||
});
|
||||
|
||||
it('shows the disabled empty state on the dashboard traffic widget', function () {
|
||||
$page = loginAndSkipBoarding();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user