From 832ccc6aa3adb97f5b9c275a7ed9dc2989352937 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 12 Nov 2024 15:35:09 -0800 Subject: [PATCH 1/3] updated deprecated trigger for ms teams --- app/Livewire/SlackSettingsForm.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Livewire/SlackSettingsForm.php b/app/Livewire/SlackSettingsForm.php index 64196b5dd9..725bffa249 100644 --- a/app/Livewire/SlackSettingsForm.php +++ b/app/Livewire/SlackSettingsForm.php @@ -113,6 +113,10 @@ class SlackSettingsForm extends Component if($this->webhook_selected == 'microsoft' || $this->webhook_selected == 'google'){ $this->webhook_channel = '#NA'; } + + } + public function updatedwebhookEndpoint() { + $this->teams_webhook_deprecated = !Str::contains($this->webhook_endpoint, 'workflows'); } private function isButtonDisabled() { From 4e0d70e0b843d29115f2cd833bcc39e59ff42452 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 12 Nov 2024 15:44:14 -0800 Subject: [PATCH 2/3] checkin notif was missing --- app/Listeners/CheckoutableListener.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 8fa96acb6a..79a4774776 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -175,8 +175,14 @@ class CheckoutableListener // Send Webhook notification try { if ($this->shouldSendWebhookNotification()) { - Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckinNotification($event)); + if (Setting::getSettings()->webhook_selected === 'microsoft') { + $message = $this->getCheckinNotification($event)->toMicrosoftTeams(); + $notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint); + $notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams + } else { + Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint) + ->notify($this->getCheckinNotification($event, $acceptance)); + } } } catch (ClientException $e) { Log::warning("Exception caught during checkin notification: " . $e->getMessage()); From 947351af6716965849ba1b35cacf5d2f667930bd Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 12 Nov 2024 16:49:02 -0800 Subject: [PATCH 3/3] removed unused variabl --- app/Listeners/CheckoutableListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 79a4774776..0651df197b 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -181,7 +181,7 @@ class CheckoutableListener $notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams } else { Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckinNotification($event, $acceptance)); + ->notify($this->getCheckinNotification($event)); } } } catch (ClientException $e) {