From ec051eba3894974ad3b780756911646a4e239077 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 22 Mar 2024 13:25:43 +0100 Subject: [PATCH] Delete unused notification components and update notification navbar --- .../{DiscordSettings.php => Discord.php} | 6 ++++- .../{EmailSettings.php => Email.php} | 9 ++++--- .../{TelegramSettings.php => Telegram.php} | 7 +++++- app/Livewire/Team/Notification/Index.php | 13 ---------- resources/views/components/navbar.blade.php | 4 ++-- .../components/notification/navbar.blade.php | 18 ++++++++++++++ .../components/notifications/navbar.blade.php | 4 ---- .../components/security/navbar.blade.php | 2 +- .../views/livewire/layout-popups.blade.php | 2 +- ...d-settings.blade.php => discord.blade.php} | 5 ++-- ...ail-settings.blade.php => email.blade.php} | 5 ++-- ...-settings.blade.php => telegram.blade.php} | 5 ++-- .../team/notification/index.blade.php | 24 ------------------- routes/web.php | 9 +++++-- 14 files changed, 55 insertions(+), 58 deletions(-) rename app/Livewire/Notifications/{DiscordSettings.php => Discord.php} (91%) rename app/Livewire/Notifications/{EmailSettings.php => Email.php} (98%) rename app/Livewire/Notifications/{TelegramSettings.php => Telegram.php} (93%) delete mode 100644 app/Livewire/Team/Notification/Index.php create mode 100644 resources/views/components/notification/navbar.blade.php delete mode 100644 resources/views/components/notifications/navbar.blade.php rename resources/views/livewire/notifications/{discord-settings.blade.php => discord.blade.php} (93%) rename resources/views/livewire/notifications/{email-settings.blade.php => email.blade.php} (97%) rename resources/views/livewire/notifications/{telegram-settings.blade.php => telegram.blade.php} (96%) delete mode 100644 resources/views/livewire/team/notification/index.blade.php diff --git a/app/Livewire/Notifications/DiscordSettings.php b/app/Livewire/Notifications/Discord.php similarity index 91% rename from app/Livewire/Notifications/DiscordSettings.php rename to app/Livewire/Notifications/Discord.php index f5f0d5591..8aad8ccf0 100644 --- a/app/Livewire/Notifications/DiscordSettings.php +++ b/app/Livewire/Notifications/Discord.php @@ -6,7 +6,7 @@ use App\Notifications\Test; use Livewire\Component; -class DiscordSettings extends Component +class Discord extends Component { public Team $team; protected $rules = [ @@ -55,4 +55,8 @@ public function sendTestNotification() $this->team?->notify(new Test()); $this->dispatch('success', 'Test notification sent.'); } + public function render() + { + return view('livewire.notifications.discord'); + } } diff --git a/app/Livewire/Notifications/EmailSettings.php b/app/Livewire/Notifications/Email.php similarity index 98% rename from app/Livewire/Notifications/EmailSettings.php rename to app/Livewire/Notifications/Email.php index a45381b84..343cbda3e 100644 --- a/app/Livewire/Notifications/EmailSettings.php +++ b/app/Livewire/Notifications/Email.php @@ -2,13 +2,12 @@ namespace App\Livewire\Notifications; +use Livewire\Component; use App\Models\InstanceSettings; use App\Models\Team; use App\Notifications\Test; -use Livewire\Component; -use Log; -class EmailSettings extends Component +class Email extends Component { public Team $team; public string $emails; @@ -191,4 +190,8 @@ public function copyFromInstanceSettings() } $this->dispatch('error', 'Instance SMTP/Resend settings are not enabled.'); } + public function render() + { + return view('livewire.notifications.email'); + } } diff --git a/app/Livewire/Notifications/TelegramSettings.php b/app/Livewire/Notifications/Telegram.php similarity index 93% rename from app/Livewire/Notifications/TelegramSettings.php rename to app/Livewire/Notifications/Telegram.php index 0f581a515..35b868527 100644 --- a/app/Livewire/Notifications/TelegramSettings.php +++ b/app/Livewire/Notifications/Telegram.php @@ -6,8 +6,9 @@ use App\Notifications\Test; use Livewire\Component; -class TelegramSettings extends Component +class Telegram extends Component { + public Team $team; protected $rules = [ 'team.telegram_enabled' => 'nullable|boolean', @@ -61,4 +62,8 @@ public function sendTestNotification() $this->team?->notify(new Test()); $this->dispatch('success', 'Test notification sent.'); } + public function render() + { + return view('livewire.notifications.telegram'); + } } diff --git a/app/Livewire/Team/Notification/Index.php b/app/Livewire/Team/Notification/Index.php deleted file mode 100644 index 86754d619..000000000 --- a/app/Livewire/Team/Notification/Index.php +++ /dev/null @@ -1,13 +0,0 @@ - {{-- --}} -
+
diff --git a/resources/views/components/notifications/navbar.blade.php b/resources/views/components/notifications/navbar.blade.php deleted file mode 100644 index a5b3f3337..000000000 --- a/resources/views/components/notifications/navbar.blade.php +++ /dev/null @@ -1,4 +0,0 @@ -
-

Notifications

-
Get notified about your infrastructure.
-
diff --git a/resources/views/components/security/navbar.blade.php b/resources/views/components/security/navbar.blade.php index ab2af7cf0..26d8372da 100644 --- a/resources/views/components/security/navbar.blade.php +++ b/resources/views/components/security/navbar.blade.php @@ -2,7 +2,7 @@

Security

Security related settings.
-