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
This commit is contained in:
Edi Septriyanto 2024-10-16 03:15:13 +07:00 committed by GitHub
parent a11f221619
commit da7b24640e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public function getWidgets(): array
protected function getHeaderActions(): array protected function getHeaderActions(): array
{ {
return [ return [
CreateAction::make() CreateAction::make('create')
->label('Connect') ->label('Connect')
->icon('heroicon-o-wifi') ->icon('heroicon-o-wifi')
->modalHeading('Connect to a Server Provider') ->modalHeading('Connect to a Server Provider')
@ -43,7 +43,11 @@ protected function getHeaderActions(): array
->form(Actions\Create::form()) ->form(Actions\Create::form())
->authorize('create', ServerProvider::class) ->authorize('create', ServerProvider::class)
->modalWidth(MaxWidth::Medium) ->modalWidth(MaxWidth::Medium)
->using(fn (array $data) => Actions\Create::action($data)), ->using(function (array $data) {
Actions\Create::action($data);
$this->dispatch('$refresh');
}),
]; ];
} }
} }

View File

@ -18,6 +18,8 @@
class ServerProvidersList extends Widget class ServerProvidersList extends Widget
{ {
protected $listeners = ['$refresh'];
protected function getTableQuery(): Builder protected function getTableQuery(): Builder
{ {
return ServerProvider::getByProjectId(auth()->user()->current_project_id); return ServerProvider::getByProjectId(auth()->user()->current_project_id);

View File

@ -17,6 +17,8 @@
class StorageProvidersList extends Widget class StorageProvidersList extends Widget
{ {
protected $listeners = ['$refresh'];
protected function getTableQuery(): Builder protected function getTableQuery(): Builder
{ {
return StorageProvider::getByProjectId(auth()->user()->current_project_id); return StorageProvider::getByProjectId(auth()->user()->current_project_id);