From 69729b828c323767910da6745ad56c0eda53462c Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 15:09:51 +0300 Subject: [PATCH 01/17] Fix links --- api/app/Mail/EventCreatedMailToInvitee.php | 14 +++++++++++++- api/app/Mail/EventCreatedMailToOwner.php | 15 ++++++++++++++- .../emails/event_created_to_invitee.blade.php | 6 +++--- .../views/notifications/event_created.blade.php | 6 +++--- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/api/app/Mail/EventCreatedMailToInvitee.php b/api/app/Mail/EventCreatedMailToInvitee.php index 408de1389..cd04f9e6e 100644 --- a/api/app/Mail/EventCreatedMailToInvitee.php +++ b/api/app/Mail/EventCreatedMailToInvitee.php @@ -40,6 +40,17 @@ public function __construct(Event $event) */ public function build() { + $locationType = ''; + $locationLink = ''; + if ($this->event->zoom_meeting_link) { + $locationType = 'Zoom'; + $locationLink = $this->event->zoom_meeting_link; + } + + if ($this->event->whale_meeting_link) { + $locationType = 'Whale'; + $locationLink = $this->event->whale_meeting_link; + } return $this ->subject("You have been invited to an event: {$this->eventType->name}, {$this->event->start_date}, {$this->owner->name}") @@ -50,7 +61,8 @@ public function build() 'inviteeName' => $this->inviteeName, 'inviteeEmail' => $this->inviteeEmail, 'customFieldValues' => $this->event->customFieldValues, - 'location' => $this->event->location + 'locationType' => $locationType, + 'locationLink' => $locationLink, ]); } } diff --git a/api/app/Mail/EventCreatedMailToOwner.php b/api/app/Mail/EventCreatedMailToOwner.php index 92041089f..6011ddbaa 100644 --- a/api/app/Mail/EventCreatedMailToOwner.php +++ b/api/app/Mail/EventCreatedMailToOwner.php @@ -40,6 +40,18 @@ public function build() { $this->to($this->owner->getEmail()); + $locationType = ''; + $locationLink = ''; + if ($this->event->zoom_meeting_link) { + $locationType = 'Zoom'; + $locationLink = $this->event->zoom_meeting_link; + } + + if ($this->event->whale_meeting_link) { + $locationType = 'Whale'; + $locationLink = $this->event->whale_meeting_link; + } + return $this ->subject("New Event: {$this->event->invitee_name}, {$this->event->start_date}, {$this->eventType->name}") @@ -48,7 +60,8 @@ public function build() 'eventType' => $this->eventType, 'user' => $this->owner, 'customFieldValues' => $this->event->customFieldValues, - 'location' => $this->event->location + 'locationType' => $locationType, + 'locationLink' => $locationLink, ]); } } diff --git a/api/resources/views/emails/event_created_to_invitee.blade.php b/api/resources/views/emails/event_created_to_invitee.blade.php index f7c86e752..1b0b0bd4d 100644 --- a/api/resources/views/emails/event_created_to_invitee.blade.php +++ b/api/resources/views/emails/event_created_to_invitee.blade.php @@ -21,9 +21,9 @@ Event Date/Time:
{{ $event->start_date }} -@if($location) -Location:
-{{ $location }} +@if($locationType) +{{ $locationType }}:
+{{ $locationLink }} @endif @if(count($customFieldValues)) diff --git a/api/resources/views/notifications/event_created.blade.php b/api/resources/views/notifications/event_created.blade.php index 247247519..761f32e61 100644 --- a/api/resources/views/notifications/event_created.blade.php +++ b/api/resources/views/notifications/event_created.blade.php @@ -18,9 +18,9 @@ Invitee TimeZone:
{{ $event->timezone }} -@if($location) -Location:
-{{ $location }} +@if($locationType) +{{ $locationType }}:
+{{ $locationLink }} @endif @if(count($customFieldValues)) From aadb5792740c642ff20fcd70bcd30a1a7b51c406 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 18:16:13 +0300 Subject: [PATCH 02/17] fix resources --- .../views/emails/event_created_to_invitee.blade.php | 5 ----- api/resources/views/notifications/event_created.blade.php | 5 ----- 2 files changed, 10 deletions(-) diff --git a/api/resources/views/emails/event_created_to_invitee.blade.php b/api/resources/views/emails/event_created_to_invitee.blade.php index 1b0b0bd4d..1b5be306a 100644 --- a/api/resources/views/emails/event_created_to_invitee.blade.php +++ b/api/resources/views/emails/event_created_to_invitee.blade.php @@ -21,11 +21,6 @@ Event Date/Time:
{{ $event->start_date }} -@if($locationType) -{{ $locationType }}:
-{{ $locationLink }} -@endif - @if(count($customFieldValues)) Questions:
@foreach($customFieldValues as $customFieldValue) diff --git a/api/resources/views/notifications/event_created.blade.php b/api/resources/views/notifications/event_created.blade.php index 761f32e61..f5f5738e1 100644 --- a/api/resources/views/notifications/event_created.blade.php +++ b/api/resources/views/notifications/event_created.blade.php @@ -18,11 +18,6 @@ Invitee TimeZone:
{{ $event->timezone }} -@if($locationType) -{{ $locationType }}:
-{{ $locationLink }} -@endif - @if(count($customFieldValues)) Questions:
@foreach($customFieldValues as $customFieldValue) From ff98a8c716c85c44e8a2688063382674e9ce20f8 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 18:16:28 +0300 Subject: [PATCH 03/17] Fix mails --- api/app/Mail/EventCreatedMailToInvitee.php | 15 +-------------- api/app/Mail/EventCreatedMailToOwner.php | 16 +--------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/api/app/Mail/EventCreatedMailToInvitee.php b/api/app/Mail/EventCreatedMailToInvitee.php index cd04f9e6e..ebd41731a 100644 --- a/api/app/Mail/EventCreatedMailToInvitee.php +++ b/api/app/Mail/EventCreatedMailToInvitee.php @@ -40,17 +40,6 @@ public function __construct(Event $event) */ public function build() { - $locationType = ''; - $locationLink = ''; - if ($this->event->zoom_meeting_link) { - $locationType = 'Zoom'; - $locationLink = $this->event->zoom_meeting_link; - } - - if ($this->event->whale_meeting_link) { - $locationType = 'Whale'; - $locationLink = $this->event->whale_meeting_link; - } return $this ->subject("You have been invited to an event: {$this->eventType->name}, {$this->event->start_date}, {$this->owner->name}") @@ -60,9 +49,7 @@ public function build() 'owner' => $this->owner, 'inviteeName' => $this->inviteeName, 'inviteeEmail' => $this->inviteeEmail, - 'customFieldValues' => $this->event->customFieldValues, - 'locationType' => $locationType, - 'locationLink' => $locationLink, + 'customFieldValues' => $this->event->customFieldValues ]); } } diff --git a/api/app/Mail/EventCreatedMailToOwner.php b/api/app/Mail/EventCreatedMailToOwner.php index 6011ddbaa..984220fa7 100644 --- a/api/app/Mail/EventCreatedMailToOwner.php +++ b/api/app/Mail/EventCreatedMailToOwner.php @@ -40,18 +40,6 @@ public function build() { $this->to($this->owner->getEmail()); - $locationType = ''; - $locationLink = ''; - if ($this->event->zoom_meeting_link) { - $locationType = 'Zoom'; - $locationLink = $this->event->zoom_meeting_link; - } - - if ($this->event->whale_meeting_link) { - $locationType = 'Whale'; - $locationLink = $this->event->whale_meeting_link; - } - return $this ->subject("New Event: {$this->event->invitee_name}, {$this->event->start_date}, {$this->eventType->name}") @@ -59,9 +47,7 @@ public function build() 'event' => $this->event, 'eventType' => $this->eventType, 'user' => $this->owner, - 'customFieldValues' => $this->event->customFieldValues, - 'locationType' => $locationType, - 'locationLink' => $locationLink, + 'customFieldValues' => $this->event->customFieldValues ]); } } From c3d4dd7de2926985e89060e1a9d58dfab68a68f2 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 18:17:11 +0300 Subject: [PATCH 04/17] Fix listener --- .../SendEventCreatedNotificationToOwner.php | 4 +- .../EventCreatedNotificationToOwnerMail.php | 38 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 api/app/Notifications/EventCreatedNotificationToOwnerMail.php diff --git a/api/app/Listeners/SendEventCreatedNotificationToOwner.php b/api/app/Listeners/SendEventCreatedNotificationToOwner.php index b60c5cffd..ca2bdb462 100644 --- a/api/app/Listeners/SendEventCreatedNotificationToOwner.php +++ b/api/app/Listeners/SendEventCreatedNotificationToOwner.php @@ -4,6 +4,7 @@ use App\Events\EventCreated; use App\Notifications\EventCreatedNotification; +use App\Notifications\EventCreatedNotificationToOwnerMail; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; @@ -26,6 +27,7 @@ public function __construct() */ public function handle(EventCreated $eventCreated) { - $eventCreated->event->eventType->owner->notify(new EventCreatedNotification($eventCreated->event)); +// $eventCreated->event->eventType->owner->notify(new EventCreatedNotification($eventCreated->event)); + $eventCreated->event->eventType->owner->notify(new EventCreatedNotificationToOwnerMail($eventCreated->event)); } } diff --git a/api/app/Notifications/EventCreatedNotificationToOwnerMail.php b/api/app/Notifications/EventCreatedNotificationToOwnerMail.php new file mode 100644 index 000000000..b5273aecf --- /dev/null +++ b/api/app/Notifications/EventCreatedNotificationToOwnerMail.php @@ -0,0 +1,38 @@ +event = $event; + } + + public function via($notifiable) + { + return ['mail']; + } + + public function toMail($notifiable) + { + return new EventCreatedMailToOwner($this->event); + } + + public function toArray($notifiable) + { + return [ + // + ]; + } +} From a903b9294c571ff740f82beb543ac560d18466c8 Mon Sep 17 00:00:00 2001 From: Yevhen Turovets Date: Wed, 9 Sep 2020 18:33:13 +0300 Subject: [PATCH 05/17] Delete old code --- client/src/store/modules/scheduledEvent/normalizer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/store/modules/scheduledEvent/normalizer.js b/client/src/store/modules/scheduledEvent/normalizer.js index be5127531..53f8b730c 100644 --- a/client/src/store/modules/scheduledEvent/normalizer.js +++ b/client/src/store/modules/scheduledEvent/normalizer.js @@ -38,5 +38,4 @@ export const eventApiMapper = Event => ({ .utc() .format('YYYY-MM-DD HH:mm:ss'), timezone: Event.timezone, - event_type: eventTypeMapper(Event.eventType) }); From 84db5340692a8145cafab64983d1f6957880d433 Mon Sep 17 00:00:00 2001 From: Yevhen Turovets Date: Wed, 9 Sep 2020 18:34:50 +0300 Subject: [PATCH 06/17] Fix code style --- client/src/store/modules/scheduledEvent/normalizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/store/modules/scheduledEvent/normalizer.js b/client/src/store/modules/scheduledEvent/normalizer.js index 53f8b730c..dddfaf9f5 100644 --- a/client/src/store/modules/scheduledEvent/normalizer.js +++ b/client/src/store/modules/scheduledEvent/normalizer.js @@ -37,5 +37,5 @@ export const eventApiMapper = Event => ({ .tz(Event.timezone) .utc() .format('YYYY-MM-DD HH:mm:ss'), - timezone: Event.timezone, + timezone: Event.timezone }); From 3471f9602b13a43cb0787d009ee776a9b6c4920b Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 19:18:18 +0300 Subject: [PATCH 07/17] Decompose notifications --- ...EventCreatedNotificationToOwnerChatito.php | 36 ++++++++++++++++++ .../EventCreatedNotificationToOwnerSlack.php | 38 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 api/app/Notifications/EventCreatedNotificationToOwnerChatito.php create mode 100644 api/app/Notifications/EventCreatedNotificationToOwnerSlack.php diff --git a/api/app/Notifications/EventCreatedNotificationToOwnerChatito.php b/api/app/Notifications/EventCreatedNotificationToOwnerChatito.php new file mode 100644 index 000000000..4f52adfa9 --- /dev/null +++ b/api/app/Notifications/EventCreatedNotificationToOwnerChatito.php @@ -0,0 +1,36 @@ +event = $event; + $this->toChatito(); + } + + private function toChatito() + { + return new EventCreatedChatitoMessage($this->event); + } + + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/api/app/Notifications/EventCreatedNotificationToOwnerSlack.php b/api/app/Notifications/EventCreatedNotificationToOwnerSlack.php new file mode 100644 index 000000000..322cd4394 --- /dev/null +++ b/api/app/Notifications/EventCreatedNotificationToOwnerSlack.php @@ -0,0 +1,38 @@ +event = $event; + } + + public function via($notifiable) + { + return ['slack']; + } + + public function toSlack($notifiable) + { + return new EventCreatedSlackMessage($this->event); + } + + public function toArray($notifiable) + { + return [ + // + ]; + } +} From 7393bc66a840a1241ee81a32c3ec634cac773947 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 19:18:33 +0300 Subject: [PATCH 08/17] Fix mails --- .../Listeners/SendEventCreatedNotificationToOwner.php | 9 ++++++++- api/app/Mail/EventCreatedMailToOwner.php | 10 ---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/api/app/Listeners/SendEventCreatedNotificationToOwner.php b/api/app/Listeners/SendEventCreatedNotificationToOwner.php index ca2bdb462..396dc7b29 100644 --- a/api/app/Listeners/SendEventCreatedNotificationToOwner.php +++ b/api/app/Listeners/SendEventCreatedNotificationToOwner.php @@ -4,7 +4,9 @@ use App\Events\EventCreated; use App\Notifications\EventCreatedNotification; +use App\Notifications\EventCreatedNotificationToOwnerChatito; use App\Notifications\EventCreatedNotificationToOwnerMail; +use App\Notifications\EventCreatedNotificationToOwnerSlack; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; @@ -27,7 +29,12 @@ public function __construct() */ public function handle(EventCreated $eventCreated) { -// $eventCreated->event->eventType->owner->notify(new EventCreatedNotification($eventCreated->event)); $eventCreated->event->eventType->owner->notify(new EventCreatedNotificationToOwnerMail($eventCreated->event)); + if ($eventCreated->event->eventType->owner->slack_active) { + $eventCreated->event->eventType->owner->notify(new EventCreatedNotificationToOwnerSlack($eventCreated->event)); + } + if ($eventCreated->event->eventType->owner->chatito_active) { + new EventCreatedNotificationToOwnerChatito($eventCreated->event); + } } } diff --git a/api/app/Mail/EventCreatedMailToOwner.php b/api/app/Mail/EventCreatedMailToOwner.php index 984220fa7..b507af819 100644 --- a/api/app/Mail/EventCreatedMailToOwner.php +++ b/api/app/Mail/EventCreatedMailToOwner.php @@ -19,11 +19,6 @@ class EventCreatedMailToOwner extends Mailable public EventType $eventType; public User $owner; - /** - * Create a new message instance. - * - * @return void - */ public function __construct(Event $event) { $this->event = $event; @@ -31,11 +26,6 @@ public function __construct(Event $event) $this->owner = $event->eventType->owner; } - /** - * Build the message. - * - * @return $this - */ public function build() { $this->to($this->owner->getEmail()); From 185e78b31e3d72861aba716bba3c9db621ed2150 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 19:37:28 +0300 Subject: [PATCH 09/17] Fix listener --- .../SendEventCreatedNotificationToOwner.php | 2 - .../EventCreatedNotification.php | 82 ------------------- 2 files changed, 84 deletions(-) delete mode 100644 api/app/Notifications/EventCreatedNotification.php diff --git a/api/app/Listeners/SendEventCreatedNotificationToOwner.php b/api/app/Listeners/SendEventCreatedNotificationToOwner.php index 396dc7b29..d218b5dd8 100644 --- a/api/app/Listeners/SendEventCreatedNotificationToOwner.php +++ b/api/app/Listeners/SendEventCreatedNotificationToOwner.php @@ -3,12 +3,10 @@ namespace App\Listeners; use App\Events\EventCreated; -use App\Notifications\EventCreatedNotification; use App\Notifications\EventCreatedNotificationToOwnerChatito; use App\Notifications\EventCreatedNotificationToOwnerMail; use App\Notifications\EventCreatedNotificationToOwnerSlack; use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Queue\InteractsWithQueue; class SendEventCreatedNotificationToOwner implements ShouldQueue { diff --git a/api/app/Notifications/EventCreatedNotification.php b/api/app/Notifications/EventCreatedNotification.php deleted file mode 100644 index d18d9a5e8..000000000 --- a/api/app/Notifications/EventCreatedNotification.php +++ /dev/null @@ -1,82 +0,0 @@ -event = $event; - $this->eventType = $event->eventType; - $this->user = $event->eventType->owner; - - if ($this->user->chatito_active) { - $this->toChatito(); - } - } - - /** - * Get the notifications's delivery channels. - * - * @return array - */ - public function via($notifiable) - { - $channels = ['mail']; - if ($this->user->slack_active) { - $channels[] = 'slack'; - } - return $channels; - } - - /** - * Get the mail representation of the notifications. - * - */ - public function toMail($notifiable) - { - return new EventCreatedMailToOwner($this->event); - } - - public function toSlack($notifiable) - { - return new EventCreatedSlackMessage($this->event); - } - - private function toChatito() - { - return new EventCreatedChatitoMessage($this->event); - } - - /** - * Get the array representation of the notifications. - * - * @return array - */ - public function toArray($notifiable) - { - return [ - // - ]; - } -} From 264f8875405d3936b45b4308e252c8106d400202 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 20:13:58 +0300 Subject: [PATCH 10/17] Add job for Chatito --- .../Jobs/SendNotificationToOwnerChatito.php | 36 +++++++++++++++++++ .../SendEventCreatedNotificationToOwner.php | 3 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 api/app/Jobs/SendNotificationToOwnerChatito.php diff --git a/api/app/Jobs/SendNotificationToOwnerChatito.php b/api/app/Jobs/SendNotificationToOwnerChatito.php new file mode 100644 index 000000000..3938e971b --- /dev/null +++ b/api/app/Jobs/SendNotificationToOwnerChatito.php @@ -0,0 +1,36 @@ +event = $event; + } + + /** + * Execute the job. + * + * @return void + */ + public function handle() + { + new EventCreatedNotificationToOwnerChatito($this->event); + } +} diff --git a/api/app/Listeners/SendEventCreatedNotificationToOwner.php b/api/app/Listeners/SendEventCreatedNotificationToOwner.php index d218b5dd8..0fbfb117c 100644 --- a/api/app/Listeners/SendEventCreatedNotificationToOwner.php +++ b/api/app/Listeners/SendEventCreatedNotificationToOwner.php @@ -3,6 +3,7 @@ namespace App\Listeners; use App\Events\EventCreated; +use App\Jobs\SendNotificationToOwnerChatito; use App\Notifications\EventCreatedNotificationToOwnerChatito; use App\Notifications\EventCreatedNotificationToOwnerMail; use App\Notifications\EventCreatedNotificationToOwnerSlack; @@ -32,7 +33,7 @@ public function handle(EventCreated $eventCreated) $eventCreated->event->eventType->owner->notify(new EventCreatedNotificationToOwnerSlack($eventCreated->event)); } if ($eventCreated->event->eventType->owner->chatito_active) { - new EventCreatedNotificationToOwnerChatito($eventCreated->event); + SendNotificationToOwnerChatito::dispatch($eventCreated->event); } } } From c5a4dc1ab06d4b07fbc8459c34320ea08e15bf36 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 20:40:46 +0300 Subject: [PATCH 11/17] Add (UTC) postfix --- .../Notifications/Chatito/BeforeEventChatitoMessage.php | 2 +- .../Notifications/Chatito/EventCreatedChatitoMessage.php | 8 ++------ .../views/emails/event_created_to_invitee.blade.php | 2 +- api/resources/views/notifications/event_created.blade.php | 6 +++--- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/api/app/Notifications/Chatito/BeforeEventChatitoMessage.php b/api/app/Notifications/Chatito/BeforeEventChatitoMessage.php index 26e4b6887..f0cb1675c 100644 --- a/api/app/Notifications/Chatito/BeforeEventChatitoMessage.php +++ b/api/app/Notifications/Chatito/BeforeEventChatitoMessage.php @@ -25,7 +25,7 @@ protected function generateMessage() "{$this->user->name}

" . "Organizator Email:
" . "{$this->user->email}

" . - "Event Date/Time:
" . + "Event Date/Time (UTC):
" . "{$this->event->start_date}

"; if ($this->event->eventType->location_type == 'zoom') { diff --git a/api/app/Notifications/Chatito/EventCreatedChatitoMessage.php b/api/app/Notifications/Chatito/EventCreatedChatitoMessage.php index ac617c464..005a37871 100644 --- a/api/app/Notifications/Chatito/EventCreatedChatitoMessage.php +++ b/api/app/Notifications/Chatito/EventCreatedChatitoMessage.php @@ -8,7 +8,7 @@ final class EventCreatedChatitoMessage extends ChatitoMessage { protected function generateMessage() { - $message = "Hi, {$this->event->invitee_name} and {$this->user->name}
" . + return "Hi, {$this->event->invitee_name} and {$this->user->name}
" . "A new event was scheduled!

" . "Event Type:
" . "{$this->eventType->name}

" . @@ -22,11 +22,7 @@ protected function generateMessage() "{$this->user->name}

" . "Organizator Email:
" . "{$this->user->email}

" . - "Event Date/Time:
" . + "Event Date/Time (UTC):
" . "{$this->event->start_date}
"; - if ($this->event->location) { - $message .= "Location:
{$this->event->location}
"; - } - return $message; } } diff --git a/api/resources/views/emails/event_created_to_invitee.blade.php b/api/resources/views/emails/event_created_to_invitee.blade.php index 1b5be306a..ce6cb3592 100644 --- a/api/resources/views/emails/event_created_to_invitee.blade.php +++ b/api/resources/views/emails/event_created_to_invitee.blade.php @@ -18,7 +18,7 @@ Invitee Email (You):
{{ $inviteeEmail }} -Event Date/Time:
+Event Date/Time (UTC):
{{ $event->start_date }} @if(count($customFieldValues)) diff --git a/api/resources/views/notifications/event_created.blade.php b/api/resources/views/notifications/event_created.blade.php index f5f5738e1..59e6bf7a9 100644 --- a/api/resources/views/notifications/event_created.blade.php +++ b/api/resources/views/notifications/event_created.blade.php @@ -12,12 +12,12 @@ Invitee Email:
{{ $event->invitee_email }} -Event Date/Time:
-{{ $event->start_date }} - Invitee TimeZone:
{{ $event->timezone }} +Event Date/Time(UTC):
+{{ $event->start_date }} + @if(count($customFieldValues)) Questions:
@foreach($customFieldValues as $customFieldValue) From 04c277cb8fc0019942584b6e610eaaa36926162f Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 20:41:51 +0300 Subject: [PATCH 12/17] fix --- api/resources/views/notifications/event_created.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/resources/views/notifications/event_created.blade.php b/api/resources/views/notifications/event_created.blade.php index 59e6bf7a9..00dd8893d 100644 --- a/api/resources/views/notifications/event_created.blade.php +++ b/api/resources/views/notifications/event_created.blade.php @@ -15,7 +15,7 @@ Invitee TimeZone:
{{ $event->timezone }} -Event Date/Time(UTC):
+Event Date/Time (UTC):
{{ $event->start_date }} @if(count($customFieldValues)) From 1a49a7d61be5201c7778c6685cfeacc21716c914 Mon Sep 17 00:00:00 2001 From: Serhii Date: Wed, 9 Sep 2020 21:20:06 +0300 Subject: [PATCH 13/17] fixed error message for address is missed --- .../EventType/CoordinatesFieldIsRequiredException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app/Exceptions/EventType/CoordinatesFieldIsRequiredException.php b/api/app/Exceptions/EventType/CoordinatesFieldIsRequiredException.php index 78de53f52..e7981b76e 100644 --- a/api/app/Exceptions/EventType/CoordinatesFieldIsRequiredException.php +++ b/api/app/Exceptions/EventType/CoordinatesFieldIsRequiredException.php @@ -9,6 +9,6 @@ final class CoordinatesFieldIsRequiredException extends BaseException { - protected $message = "For 'location_type = address' field 'coordinates' is required!"; + protected $message = "Please, choose address for your meeting"; protected $code = ErrorCode::COORDINATES_FIELD_IS_REQUIRED; } From dd72c1b5ecd090c5542c39a22da7a83bfca7ad36 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 21:45:17 +0300 Subject: [PATCH 14/17] Add invitee_information --- api/app/Actions/Event/AddEventAction.php | 1 + api/app/Actions/Event/AddEventRequest.php | 10 +++++++++- api/app/Entity/Event.php | 3 ++- api/app/Http/Controllers/Api/EventController.php | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/api/app/Actions/Event/AddEventAction.php b/api/app/Actions/Event/AddEventAction.php index d20dd340d..242e0efb6 100644 --- a/api/app/Actions/Event/AddEventAction.php +++ b/api/app/Actions/Event/AddEventAction.php @@ -37,6 +37,7 @@ public function execute(AddEventRequest $request): UpdateEventResponse $event->invitee_email = $request->getInviteeEmail(); $event->start_date = $request->getStartDate(); $event->timezone = $request->getTimezone(); + $event->invitee_information = $request->getInviteeInformation(); $this->eventRepository->save($event); diff --git a/api/app/Actions/Event/AddEventRequest.php b/api/app/Actions/Event/AddEventRequest.php index 9da5ee312..56881969b 100644 --- a/api/app/Actions/Event/AddEventRequest.php +++ b/api/app/Actions/Event/AddEventRequest.php @@ -12,6 +12,7 @@ final class AddEventRequest private string $startDate; private string $timezone; private ?array $customFieldValues; + private ?string $inviteeInformation; public function __construct( int $eventTypeId, @@ -19,7 +20,8 @@ public function __construct( string $inviteeEmail, string $startDate, string $timezone, - ?array $customFieldValues + ?array $customFieldValues, + ?string $inviteeInformation ) { $this->eventTypeId = $eventTypeId; $this->inviteeName = $inviteeName; @@ -27,6 +29,7 @@ public function __construct( $this->startDate = $startDate; $this->timezone = $timezone; $this->customFieldValues = $customFieldValues; + $this->inviteeInformation = $inviteeInformation; } public function getEventTypeId(): int @@ -58,4 +61,9 @@ public function getCustomFieldValues(): ?array { return $this->customFieldValues; } + + public function getInviteeInformation(): ?string + { + return $this->inviteeInformation; + } } diff --git a/api/app/Entity/Event.php b/api/app/Entity/Event.php index 128e61e4c..caef5e776 100644 --- a/api/app/Entity/Event.php +++ b/api/app/Entity/Event.php @@ -17,7 +17,8 @@ class Event extends Model 'timezone', 'status', 'location', - 'created_at' + 'created_at', + 'invitee_information' ]; protected $attributes = [ diff --git a/api/app/Http/Controllers/Api/EventController.php b/api/app/Http/Controllers/Api/EventController.php index b0d51d293..22fccf5d4 100644 --- a/api/app/Http/Controllers/Api/EventController.php +++ b/api/app/Http/Controllers/Api/EventController.php @@ -54,7 +54,8 @@ public function store(EventRequest $request): JsonResponse $request->invitee_email, $request->start_date, $request->timezone, - $request->custom_field_values + $request->custom_field_values, + $request->invitee_information ) ); From b6d661e80831bd1024b70d3f42269c5b8a392468 Mon Sep 17 00:00:00 2001 From: Serhii Date: Wed, 9 Sep 2020 22:00:04 +0300 Subject: [PATCH 15/17] fixed incorrect text transfer --- .../src/components/public/users-event-types/UserEventType.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/public/users-event-types/UserEventType.vue b/client/src/components/public/users-event-types/UserEventType.vue index 34a70cc6a..64e435d10 100644 --- a/client/src/components/public/users-event-types/UserEventType.vue +++ b/client/src/components/public/users-event-types/UserEventType.vue @@ -43,7 +43,8 @@ export default { } .event-type-name, .description { - word-break: break-all; + white-space: pre-wrap; + word-break: break-word; } .description { text-overflow: ellipsis; From fc47aa8b7dccd42446b19d9a8f1750383a358071 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 22:04:18 +0300 Subject: [PATCH 16/17] fix --- api/app/Actions/SocialAccount/AuthResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app/Actions/SocialAccount/AuthResponse.php b/api/app/Actions/SocialAccount/AuthResponse.php index 3cae5e276..21eb7ad2f 100644 --- a/api/app/Actions/SocialAccount/AuthResponse.php +++ b/api/app/Actions/SocialAccount/AuthResponse.php @@ -6,7 +6,7 @@ class AuthResponse { - private string $urt; + private string $url; private ?array $data; public function __construct(string $url, array $data = []) From 06543b162c11736da29a4ba54355edd342dc35c3 Mon Sep 17 00:00:00 2001 From: dmitriy-sanders Date: Wed, 9 Sep 2020 22:17:51 +0300 Subject: [PATCH 17/17] Fix subject --- api/app/Notifications/EventTypeDeletedToOwner.php | 1 + 1 file changed, 1 insertion(+) diff --git a/api/app/Notifications/EventTypeDeletedToOwner.php b/api/app/Notifications/EventTypeDeletedToOwner.php index 3897fa9f2..f4334713a 100644 --- a/api/app/Notifications/EventTypeDeletedToOwner.php +++ b/api/app/Notifications/EventTypeDeletedToOwner.php @@ -32,6 +32,7 @@ public function via($notifiable) public function toMail($notifiable) { return (new MailMessage()) + ->subject("EventType was deleted!") ->line(new HtmlString("Hi, {$this->owner->name}!")) ->line(new HtmlString("EventType {$this->eventTypeName} was deleted, so all events was declined!")); }