From 21daa6d2d29d6e16ac9236c5fd6d5186e4112d57 Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 18 Jan 2019 02:01:43 +0200 Subject: [PATCH 01/11] Update ComponentStatusChangedNotification.php --- .../Component/ComponentStatusChangedNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index 8621e6f7902d..47502ed236e2 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -140,7 +140,7 @@ public function toSlack($notifiable) return (new SlackMessage()) ->$status() - ->content(trans('notifications.component.status_update.slack.subject')) + ->content(trans('notifications.component.status_update.slack.title')) ->attachment(function ($attachment) use ($content, $notifiable) { $attachment->title($content, cachet_route('status-page')) ->fields(array_filter([ From d52c961adf3b5fa5ba3afde767c9f878c4dfd76f Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 18 Jan 2019 03:00:51 +0200 Subject: [PATCH 02/11] Update NewIncidentNotification.php Fix a incident name issue --- app/Notifications/Incident/NewIncidentNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index 8ad938bb2e04..f816fa6f6dd8 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -128,7 +128,7 @@ public function toSlack($notifiable) ->$status() ->content($content) ->attachment(function ($attachment) use ($notifiable) { - $attachment->title(trans('notifications.incident.new.slack.title', [$this->incident->name])) + $attachment->title(trans('notifications.incident.new.slack.title', ['name' => $this->incident->name])) ->timestamp($this->incident->getWrappedObject()->occurred_at) ->fields(array_filter([ 'ID' => "#{$this->incident->id}", From 3b4e2e62364e7cf01ce9a8302e2da4c078fb925d Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 18 Jan 2019 03:03:04 +0200 Subject: [PATCH 03/11] Update NewIncidentNotification.php Remove slack unsubscribe --- app/Notifications/Incident/NewIncidentNotification.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index f816fa6f6dd8..e4344d99fb3d 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -134,7 +134,6 @@ public function toSlack($notifiable) 'ID' => "#{$this->incident->id}", 'Link' => $this->incident->permalink, ])) - ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); }); } } From 699df0b9f6fd243a2d4337820a42b0989f151e68 Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 18 Jan 2019 03:05:26 +0200 Subject: [PATCH 04/11] Update NewIncidentNotification.php --- app/Notifications/Incident/NewIncidentNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index e4344d99fb3d..c0f956b298b7 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -133,7 +133,7 @@ public function toSlack($notifiable) ->fields(array_filter([ 'ID' => "#{$this->incident->id}", 'Link' => $this->incident->permalink, - ])) + ])); }); } } From e983b43b53b074ded129cb238a5517e7f7785ca7 Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 18 Jan 2019 22:41:35 +0200 Subject: [PATCH 05/11] fix notifiction for slack --- app/Notifications/Schedule/NewScheduleNotification.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Notifications/Schedule/NewScheduleNotification.php b/app/Notifications/Schedule/NewScheduleNotification.php index 2ba73596bc95..b86c61def79e 100644 --- a/app/Notifications/Schedule/NewScheduleNotification.php +++ b/app/Notifications/Schedule/NewScheduleNotification.php @@ -124,8 +124,7 @@ public function toSlack($notifiable) ->fields(array_filter([ 'ID' => "#{$this->schedule->id}", 'Status' => $this->schedule->human_status, - ])) - ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); + ])); }); } } From 01281b2c47a05deff74e6736ae68ada69d863329 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 19 Jan 2019 02:12:28 +0200 Subject: [PATCH 06/11] Update index.blade.php Eding manage button for subscription --- resources/views/dashboard/subscribers/index.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/views/dashboard/subscribers/index.blade.php b/resources/views/dashboard/subscribers/index.blade.php index 55c0f9263168..74b72ee99423 100644 --- a/resources/views/dashboard/subscribers/index.blade.php +++ b/resources/views/dashboard/subscribers/index.blade.php @@ -51,6 +51,7 @@ @endif From e1988f345ee3cd657021d4ba5ad163f60e423708 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 19 Jan 2019 02:30:54 +0200 Subject: [PATCH 07/11] Update SubscriberRoutes.php Adding manage route --- app/Http/Routes/Dashboard/SubscriberRoutes.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Routes/Dashboard/SubscriberRoutes.php b/app/Http/Routes/Dashboard/SubscriberRoutes.php index 129d786f8bd8..03a94584c049 100644 --- a/app/Http/Routes/Dashboard/SubscriberRoutes.php +++ b/app/Http/Routes/Dashboard/SubscriberRoutes.php @@ -60,6 +60,10 @@ public function map(Registrar $router) 'as' => 'delete:dashboard.subscribers.delete', 'uses' => 'SubscriberController@deleteSubscriberAction', ]); + $router->post('{subscriber}/manage', [ + 'as' => 'manage:dashboard.subscribers.manage', + 'uses' => 'SubscriberController@manageSubscriberAction', + ]); }); } } From a3332054aa026e6dc0e50ad6c167f09849f2a2a7 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 19 Jan 2019 03:03:44 +0200 Subject: [PATCH 08/11] Revert --- app/Http/Routes/Dashboard/SubscriberRoutes.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/Http/Routes/Dashboard/SubscriberRoutes.php b/app/Http/Routes/Dashboard/SubscriberRoutes.php index 03a94584c049..129d786f8bd8 100644 --- a/app/Http/Routes/Dashboard/SubscriberRoutes.php +++ b/app/Http/Routes/Dashboard/SubscriberRoutes.php @@ -60,10 +60,6 @@ public function map(Registrar $router) 'as' => 'delete:dashboard.subscribers.delete', 'uses' => 'SubscriberController@deleteSubscriberAction', ]); - $router->post('{subscriber}/manage', [ - 'as' => 'manage:dashboard.subscribers.manage', - 'uses' => 'SubscriberController@manageSubscriberAction', - ]); }); } } From 27a0fb60080c2bef61b132c3de2a87732665f2e5 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 19 Jan 2019 03:05:12 +0200 Subject: [PATCH 09/11] Update index.blade.php --- resources/views/dashboard/subscribers/index.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/dashboard/subscribers/index.blade.php b/resources/views/dashboard/subscribers/index.blade.php index 74b72ee99423..37ad2090bd44 100644 --- a/resources/views/dashboard/subscribers/index.blade.php +++ b/resources/views/dashboard/subscribers/index.blade.php @@ -51,7 +51,7 @@ @endif From 123d24da9381fd16411031148c125307b92a7403 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 19 Jan 2019 03:16:32 +0200 Subject: [PATCH 10/11] Admin permision should override setting enableSubscribers is used for Signup on the main dashboard, but cannot be forced for Admin on control --- resources/views/dashboard/subscribers/index.blade.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/resources/views/dashboard/subscribers/index.blade.php b/resources/views/dashboard/subscribers/index.blade.php index 37ad2090bd44..bba28c24c58a 100644 --- a/resources/views/dashboard/subscribers/index.blade.php +++ b/resources/views/dashboard/subscribers/index.blade.php @@ -8,7 +8,7 @@ {{ trans('dashboard.subscribers.subscribers') }} - @if($currentUser->isAdmin && $enableSubscribers) + @if($currentUser->isAdmin) {{ trans('dashboard.subscribers.add.title') }} @@ -19,11 +19,7 @@

- @if($enableSubscribers) {{ trans('dashboard.subscribers.description') }} - @else - {{ trans('dashboard.subscribers.description_disabled') }} - @endif

From 47470146aec8394be60313fccceb07be013486aa Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 19 Jan 2019 15:39:10 +0200 Subject: [PATCH 11/11] Manage subscribtion Existing subscription user should be able to manage his setting without considering if he is allowed to subscribe or not. --- app/Http/Middleware/SubscribersConfigured.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/Http/Middleware/SubscribersConfigured.php b/app/Http/Middleware/SubscribersConfigured.php index a8bc4056fb3c..adcdd7bfe84b 100644 --- a/app/Http/Middleware/SubscribersConfigured.php +++ b/app/Http/Middleware/SubscribersConfigured.php @@ -52,10 +52,6 @@ public function __construct(Repository $config) */ public function handle(Request $request, Closure $next) { - if (!$this->config->get('setting.enable_subscribers')) { - return cachet_redirect('status-page'); - } - return $next($request); } }