From da7b24640e688dcdf55ba765653529d5e39a7b34 Mon Sep 17 00:00:00 2001 From: Edi Septriyanto Date: Wed, 16 Oct 2024 03:15:13 +0700 Subject: [PATCH] Bugfix v2.x/server and storage provider did not show up after successfully created (#318) * Fix issue #316 - Server Provider did not show up * Fix issue #317 - Storage Provider did not show up --- app/Web/Pages/Settings/ServerProviders/Index.php | 8 ++++++-- .../ServerProviders/Widgets/ServerProvidersList.php | 2 ++ .../StorageProviders/Widgets/StorageProvidersList.php | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Web/Pages/Settings/ServerProviders/Index.php b/app/Web/Pages/Settings/ServerProviders/Index.php index 0a347a1..66134cc 100644 --- a/app/Web/Pages/Settings/ServerProviders/Index.php +++ b/app/Web/Pages/Settings/ServerProviders/Index.php @@ -34,7 +34,7 @@ public function getWidgets(): array protected function getHeaderActions(): array { return [ - CreateAction::make() + CreateAction::make('create') ->label('Connect') ->icon('heroicon-o-wifi') ->modalHeading('Connect to a Server Provider') @@ -43,7 +43,11 @@ protected function getHeaderActions(): array ->form(Actions\Create::form()) ->authorize('create', ServerProvider::class) ->modalWidth(MaxWidth::Medium) - ->using(fn (array $data) => Actions\Create::action($data)), + ->using(function (array $data) { + Actions\Create::action($data); + + $this->dispatch('$refresh'); + }), ]; } } diff --git a/app/Web/Pages/Settings/ServerProviders/Widgets/ServerProvidersList.php b/app/Web/Pages/Settings/ServerProviders/Widgets/ServerProvidersList.php index ccb39b4..d8adec8 100644 --- a/app/Web/Pages/Settings/ServerProviders/Widgets/ServerProvidersList.php +++ b/app/Web/Pages/Settings/ServerProviders/Widgets/ServerProvidersList.php @@ -18,6 +18,8 @@ class ServerProvidersList extends Widget { + protected $listeners = ['$refresh']; + protected function getTableQuery(): Builder { return ServerProvider::getByProjectId(auth()->user()->current_project_id); diff --git a/app/Web/Pages/Settings/StorageProviders/Widgets/StorageProvidersList.php b/app/Web/Pages/Settings/StorageProviders/Widgets/StorageProvidersList.php index 4fe0b9c..3a4d7bf 100644 --- a/app/Web/Pages/Settings/StorageProviders/Widgets/StorageProvidersList.php +++ b/app/Web/Pages/Settings/StorageProviders/Widgets/StorageProvidersList.php @@ -17,6 +17,8 @@ class StorageProvidersList extends Widget { + protected $listeners = ['$refresh']; + protected function getTableQuery(): Builder { return StorageProvider::getByProjectId(auth()->user()->current_project_id);