From 3c71bb474e4db2387428ed9718223b162a821fea Mon Sep 17 00:00:00 2001 From: Adrian Hopek Date: Tue, 17 May 2022 14:06:06 +0200 Subject: [PATCH] wip --- .../Notifications/VacationRequestsSummaryNotification.php | 4 +++- .../Slack/Elements/VacationRequestsAttachment.php | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Domain/Notifications/VacationRequestsSummaryNotification.php b/app/Domain/Notifications/VacationRequestsSummaryNotification.php index 1865b1b..65835d5 100644 --- a/app/Domain/Notifications/VacationRequestsSummaryNotification.php +++ b/app/Domain/Notifications/VacationRequestsSummaryNotification.php @@ -59,8 +59,10 @@ class VacationRequestsSummaryNotification extends Notification ->subject("Wnioski oczekujące na akcje - stan na dzień {$this->day->toDisplayString()}"); foreach ($this->vacationRequests as $request) { + $url = route("vacation.requests.show", ["vacationRequest" => $request->id]); + $message->line( - "Wniosek nr {$request->name} użytkownika {$request->user->profile->full_name} ({$request->from->toDisplayString()} - {$request->to->toDisplayString()})", + "- [wniosek nr {$request->name}]({$url}) użytkownika {$request->user->profile->full_name} ({$request->from->toDisplayString()} - {$request->to->toDisplayString()})", ); } diff --git a/app/Infrastructure/Slack/Elements/VacationRequestsAttachment.php b/app/Infrastructure/Slack/Elements/VacationRequestsAttachment.php index 3cd81b4..37653e1 100644 --- a/app/Infrastructure/Slack/Elements/VacationRequestsAttachment.php +++ b/app/Infrastructure/Slack/Elements/VacationRequestsAttachment.php @@ -27,7 +27,12 @@ class VacationRequestsAttachment extends ListAttachment ? "{$request->from->toDisplayString()}" : "{$request->from->toDisplayString()} - {$request->to->toDisplayString()}"; - return __("<:url|Request no. :request> for user :user (:date)",["url"=> $url, "request"=>$request->name,"user"=>$request->profile->full_name,"date"=>$date]); + return __("<:url|Request no. :request> for user :user (:date)", [ + "url" => $url, + "request" => $request->name, + "user" => $request->user->profile->full_name, + "date" => $date + ]); }); } }