From c76e8bb0def1c12a100a2814614dbf799c0352b2 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 31 Jan 2024 16:14:12 +0100 Subject: [PATCH] fix: migrate to new modal --- app/Livewire/Team/Storage/Create.php | 3 +- app/Livewire/Team/Storage/Form.php | 4 +- app/Models/EnvironmentVariable.php | 2 +- .../views/components/new-modal.blade.php | 14 +-- resources/views/components/toast.blade.php | 8 +- .../views/livewire/destination/form.blade.php | 11 +-- .../livewire/destination/new/docker.blade.php | 2 +- .../livewire/project/shared/danger.blade.php | 11 +-- .../environment-variable/show.blade.php | 27 +++--- .../project/shared/get-logs.blade.php | 6 +- .../shared/scheduled-task/show.blade.php | 15 +--- .../project/shared/storages/show.blade.php | 17 ++-- .../security/private-key/show.blade.php | 11 +-- .../views/livewire/server/delete.blade.php | 21 ++--- .../views/livewire/server/form.blade.php | 12 ++- .../livewire/source/github/change.blade.php | 17 ++-- resources/views/livewire/team/index.blade.php | 11 +-- .../livewire/team/storage/form.blade.php | 12 +-- resources/views/vendor/toaster/hub.blade.php | 90 ------------------- 19 files changed, 75 insertions(+), 219 deletions(-) delete mode 100644 resources/views/vendor/toaster/hub.blade.php diff --git a/app/Livewire/Team/Storage/Create.php b/app/Livewire/Team/Storage/Create.php index 82f93320b..a25fc9821 100644 --- a/app/Livewire/Team/Storage/Create.php +++ b/app/Livewire/Team/Storage/Create.php @@ -67,7 +67,8 @@ public function submit() $this->storage->save(); return redirect()->route('team.storage.show', $this->storage->uuid); } catch (\Throwable $e) { - return handleError($e, $this); + $this->dispatch('error', 'Failed to create storage.', $e->getMessage()); + // return handleError($e, $this); } } } diff --git a/app/Livewire/Team/Storage/Form.php b/app/Livewire/Team/Storage/Form.php index 8a26a3471..1fd0d470b 100644 --- a/app/Livewire/Team/Storage/Form.php +++ b/app/Livewire/Team/Storage/Form.php @@ -33,9 +33,9 @@ public function test_s3_connection() { try { $this->storage->testConnection(shouldSave: true); - return $this->dispatch('success', 'Connection is working. Tested with "ListObjectsV2" action.'); + return $this->dispatch('success', 'Connection is working.', 'Tested with "ListObjectsV2" action.'); } catch (\Throwable $e) { - return handleError($e, $this); + $this->dispatch('error', 'Failed to create storage.', $e->getMessage()); } } diff --git a/app/Models/EnvironmentVariable.php b/app/Models/EnvironmentVariable.php index fafa6f30c..a3611a0c6 100644 --- a/app/Models/EnvironmentVariable.php +++ b/app/Models/EnvironmentVariable.php @@ -91,7 +91,7 @@ protected function isShared(): Attribute } private function get_real_environment_variables(?string $environment_variable = null, $resource = null): string|null { - if (!$environment_variable) { + if (!$environment_variable || !$resource) { return null; } $environment_variable = trim($environment_variable); diff --git a/resources/views/components/new-modal.blade.php b/resources/views/components/new-modal.blade.php index b542d77ac..6c6dcc3e3 100644 --- a/resources/views/components/new-modal.blade.php +++ b/resources/views/components/new-modal.blade.php @@ -17,19 +17,19 @@ class="relative w-auto h-auto">