From 34355d9b32043addc3677dfc62a813f3a21080b8 Mon Sep 17 00:00:00 2001 From: philipp lang <philipp@aweos.de> Date: Sun, 20 Oct 2024 21:23:47 +0200 Subject: [PATCH] Update refresh page --- app/View/Page/Layout.php | 2 +- modules/Mailgateway/Components/Form.php | 2 +- modules/Mailgateway/Components/SettingView.php | 2 -- modules/Mailgateway/StoreTest.php | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/View/Page/Layout.php b/app/View/Page/Layout.php index 1a4851a6..1d081eba 100644 --- a/app/View/Page/Layout.php +++ b/app/View/Page/Layout.php @@ -24,7 +24,7 @@ class Layout extends Component public function render() { return <<<'HTML' - <div class="grow flex flex-col"> + <div class="grow flex flex-col" @refresh-page.window="$wire.$refresh"> <div class="grow bg-gray-900 flex flex-col duration-300 navbar:ml-60"> <x-page::header title="{{ session()->get('title') }}"> <x-slot:beforeTitle> diff --git a/modules/Mailgateway/Components/Form.php b/modules/Mailgateway/Components/Form.php index 9eb57979..650da197 100644 --- a/modules/Mailgateway/Components/Form.php +++ b/modules/Mailgateway/Components/Form.php @@ -90,7 +90,7 @@ class Form extends Component Mailgateway::create($payload); } $this->dispatch('closeModal'); - $this->dispatch('refresh'); + $this->dispatch('refresh-page'); $this->dispatch('success', 'Erfolgreich gespeichert.'); } diff --git a/modules/Mailgateway/Components/SettingView.php b/modules/Mailgateway/Components/SettingView.php index 2ec0c789..b6d892ea 100644 --- a/modules/Mailgateway/Components/SettingView.php +++ b/modules/Mailgateway/Components/SettingView.php @@ -10,8 +10,6 @@ class SettingView extends Component { public string $settingClass = MailgatewaySettings::class; - public $listeners = ['refresh' => '$refresh']; - public function render() { return view('mailgateway::setting-view', [ diff --git a/modules/Mailgateway/StoreTest.php b/modules/Mailgateway/StoreTest.php index b2c2f7dd..0798225c 100644 --- a/modules/Mailgateway/StoreTest.php +++ b/modules/Mailgateway/StoreTest.php @@ -22,7 +22,7 @@ it('test it saves a mail gateway', function () { ->set('cls', LocalType::class) ->call('onSave') ->assertDispatched('closeModal') - ->assertDispatched('refresh') + ->assertDispatched('refresh-page') ->assertDispatched('success'); $this->assertDatabaseHas('mailgateways', [ @@ -54,7 +54,7 @@ it('test it validates mail gateway', function (array $attributes, array $errors) ->call('onSave') ->assertHasErrors($errors) ->assertNotDispatched('closeModal') - ->assertNotDispatched('refresh') + ->assertNotDispatched('refresh-page') ->assertNotDispatched('success'); })->with([ [['name' => ''], ['name' => 'required']],