Update refresh page

This commit is contained in:
philipp lang 2024-10-20 21:23:47 +02:00
parent 8fbd4cd2d1
commit 6f8240af80
4 changed files with 4 additions and 6 deletions

View File

@ -24,7 +24,7 @@ class Layout extends Component
public function render() public function render()
{ {
return <<<'HTML' 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"> <div class="grow bg-gray-900 flex flex-col duration-300 navbar:ml-60">
<x-page::header title="{{ session()->get('title') }}"> <x-page::header title="{{ session()->get('title') }}">
<x-slot:beforeTitle> <x-slot:beforeTitle>

View File

@ -90,7 +90,7 @@ class Form extends Component
Mailgateway::create($payload); Mailgateway::create($payload);
} }
$this->dispatch('closeModal'); $this->dispatch('closeModal');
$this->dispatch('refresh'); $this->dispatch('refresh-page');
$this->dispatch('success', 'Erfolgreich gespeichert.'); $this->dispatch('success', 'Erfolgreich gespeichert.');
} }

View File

@ -10,8 +10,6 @@ class SettingView extends Component
{ {
public string $settingClass = MailgatewaySettings::class; public string $settingClass = MailgatewaySettings::class;
public $listeners = ['refresh' => '$refresh'];
public function render() public function render()
{ {
return view('mailgateway::setting-view', [ return view('mailgateway::setting-view', [

View File

@ -22,7 +22,7 @@ it('test it saves a mail gateway', function () {
->set('cls', LocalType::class) ->set('cls', LocalType::class)
->call('onSave') ->call('onSave')
->assertDispatched('closeModal') ->assertDispatched('closeModal')
->assertDispatched('refresh') ->assertDispatched('refresh-page')
->assertDispatched('success'); ->assertDispatched('success');
$this->assertDatabaseHas('mailgateways', [ $this->assertDatabaseHas('mailgateways', [
@ -54,7 +54,7 @@ it('test it validates mail gateway', function (array $attributes, array $errors)
->call('onSave') ->call('onSave')
->assertHasErrors($errors) ->assertHasErrors($errors)
->assertNotDispatched('closeModal') ->assertNotDispatched('closeModal')
->assertNotDispatched('refresh') ->assertNotDispatched('refresh-page')
->assertNotDispatched('success'); ->assertNotDispatched('success');
})->with([ })->with([
[['name' => ''], ['name' => 'required']], [['name' => ''], ['name' => 'required']],