From 1e2701679ef61ef39298b623343e0484b793b428 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Tue, 14 Jul 2026 23:06:44 +0000 Subject: [PATCH] Hide Queue Pro upgrade banner from team members. Staff without billing access see Report Issue instead of plan upsells. Co-authored-by: Cursor --- .../views/partials/upgrade-banner.blade.php | 7 +++++-- tests/Feature/QmsProTest.php | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/resources/views/partials/upgrade-banner.blade.php b/resources/views/partials/upgrade-banner.blade.php index e3d1742..67cafb9 100644 --- a/resources/views/partials/upgrade-banner.blade.php +++ b/resources/views/partials/upgrade-banner.blade.php @@ -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))

{{ $banner['title'] }}

diff --git a/tests/Feature/QmsProTest.php b/tests/Feature/QmsProTest.php index d9ab77d..0215ee5 100644 --- a/tests/Feature/QmsProTest.php +++ b/tests/Feature/QmsProTest.php @@ -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')); }