From c93fcede2399f4d7a04f5df71fc896944aa709c2 Mon Sep 17 00:00:00 2001 From: Dzianis Kotau Date: Sat, 23 Dec 2023 02:23:32 +0400 Subject: [PATCH] Buttons updates --- CHANGELOG.md | 6 ++++++ src/Actions/EnterAction.php | 2 +- src/UI/ActionButtons/EnterImpersonationActionButton.php | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bb3d5b..93766c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release Notes for 2.x +## [2.0.1 (2023-12-23)](https://github.com/Jampire/moonshine-impersonate/compare/v2.0.0...v2.0.1) + +### Fixes + +- Enter Action updates ([#28](https://github.com/Jampire/moonshine-impersonate/pull/28)) + ## [2.0.0 (2023-12-17)](https://github.com/Jampire/moonshine-impersonate/compare/v1.4.1...v2.0.0) ### Adds diff --git a/src/Actions/EnterAction.php b/src/Actions/EnterAction.php index 629adf3..7bf352f 100644 --- a/src/Actions/EnterAction.php +++ b/src/Actions/EnterAction.php @@ -15,7 +15,7 @@ final class EnterAction { public function __construct( - public readonly ImpersonateManager $manager + private readonly ImpersonateManager $manager ) { // } diff --git a/src/UI/ActionButtons/EnterImpersonationActionButton.php b/src/UI/ActionButtons/EnterImpersonationActionButton.php index 70da780..e826a72 100644 --- a/src/UI/ActionButtons/EnterImpersonationActionButton.php +++ b/src/UI/ActionButtons/EnterImpersonationActionButton.php @@ -5,7 +5,7 @@ namespace Jampire\MoonshineImpersonate\UI\ActionButtons; use Illuminate\Contracts\Auth\Authenticatable; -use Jampire\MoonshineImpersonate\Actions\EnterAction; +use Jampire\MoonshineImpersonate\Services\ImpersonateManager; use MoonShine\ActionButtons\ActionButton; /** @@ -24,7 +24,7 @@ public static function resolve(): ActionButton ]), ) ->canSee( - callback: fn (Authenticatable $item): bool => app(EnterAction::class)->manager->canEnter($item), + callback: fn (Authenticatable $item): bool => app(ImpersonateManager::class)->canEnter($item), ) ->icon(config_impersonate('buttons.enter.icon')); }