Hide Queue Pro upgrade banner from team members.
Deploy Ladill Queue / deploy (push) Successful in 29s
Deploy Ladill Queue / deploy (push) Successful in 29s
Staff without billing access see Report Issue instead of plan upsells. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
@php $banner = config('qms.upgrade_banner'); @endphp
|
||||
@if (empty($hasPaidPlan) && ! empty($banner))
|
||||
@php
|
||||
$banner = config('qms.upgrade_banner');
|
||||
$canSeeBilling = \App\Support\StaffUx::showBilling(auth()->user());
|
||||
@endphp
|
||||
@if ($canSeeBilling && empty($hasPaidPlan) && ! empty($banner))
|
||||
<div class="mb-6 flex flex-col gap-3 rounded-2xl border border-indigo-200 bg-gradient-to-r from-indigo-50 to-emerald-50 px-5 py-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<p class="font-semibold text-slate-900">{{ $banner['title'] }}</p>
|
||||
|
||||
@@ -64,7 +64,7 @@ class QmsProTest extends TestCase
|
||||
->assertSee('View plans');
|
||||
}
|
||||
|
||||
public function test_sidebar_shows_upgrade_for_operator_without_settings_access(): void
|
||||
public function test_sidebar_hides_upgrade_for_operator_without_billing_access(): void
|
||||
{
|
||||
$operator = User::create([
|
||||
'public_id' => 'queue-operator-001',
|
||||
@@ -80,10 +80,20 @@ class QmsProTest extends TestCase
|
||||
'role' => 'queue_operator',
|
||||
]);
|
||||
|
||||
$this->actingAs($operator)
|
||||
->get(route('qms.dashboard'))
|
||||
$this->actingAs($operator);
|
||||
\App\Support\StaffUx::remember([
|
||||
'full_access' => false,
|
||||
'apps' => ['queue'],
|
||||
'show_hub' => false,
|
||||
'show_billing' => false,
|
||||
]);
|
||||
|
||||
$this->get(route('qms.dashboard'))
|
||||
->assertOk()
|
||||
->assertSee('Upgrade to Pro')
|
||||
->assertDontSee('Upgrade to Pro')
|
||||
->assertDontSee('Unlock Queue Pro or Enterprise')
|
||||
->assertDontSee('View plans')
|
||||
->assertSee('Report Issue')
|
||||
->assertDontSee(route('qms.settings.edit'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user