From 32b66df5f03aa1ccd6fec1f410aa74d8560bde95 Mon Sep 17 00:00:00 2001 From: phecho Date: Fri, 20 Nov 2015 17:02:11 +0800 Subject: [PATCH] Fixes issue #1158 --- .../Dashboard/ComponentController.php | 10 +++++---- .../Dashboard/IncidentController.php | 10 +++++---- .../Dashboard/MetricController.php | 5 +++-- .../Dashboard/ScheduleController.php | 4 ++-- resources/lang/en/dashboard.php | 21 +++++++++++++++++++ .../components/groups/index.blade.php | 1 + .../dashboard/components/index.blade.php | 1 + .../views/dashboard/templates/index.blade.php | 1 + 8 files changed, 41 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Dashboard/ComponentController.php b/app/Http/Controllers/Dashboard/ComponentController.php index bab78c83..518d7b41 100644 --- a/app/Http/Controllers/Dashboard/ComponentController.php +++ b/app/Http/Controllers/Dashboard/ComponentController.php @@ -194,7 +194,7 @@ class ComponentController extends Controller $component->tags()->sync($componentTags); - return Redirect::route('dashboard.components.add') + return Redirect::route('dashboard.components.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.add.success'))); } @@ -209,7 +209,8 @@ class ComponentController extends Controller { $this->dispatch(new RemoveComponentCommand($component)); - return Redirect::route('dashboard.components.index'); + return Redirect::route('dashboard.components.index') + ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); } /** @@ -223,7 +224,8 @@ class ComponentController extends Controller { $this->dispatch(new RemoveComponentGroupCommand($group)); - return Redirect::route('dashboard.components.index'); + return Redirect::route('dashboard.components.index') + ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.delete.success'))); } /** @@ -270,7 +272,7 @@ class ComponentController extends Controller ->withErrors($e->getMessageBag()); } - return Redirect::route('dashboard.components.groups.add') + return Redirect::route('dashboard.components.groups') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.add.success'))); } diff --git a/app/Http/Controllers/Dashboard/IncidentController.php b/app/Http/Controllers/Dashboard/IncidentController.php index 31ef65af..ddfd4cb6 100644 --- a/app/Http/Controllers/Dashboard/IncidentController.php +++ b/app/Http/Controllers/Dashboard/IncidentController.php @@ -129,7 +129,7 @@ class IncidentController extends Controller ->withErrors($e->getMessageBag()); } - return Redirect::route('dashboard.incidents.add') + return Redirect::route('dashboard.incidents.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.add.success'))); } @@ -169,7 +169,8 @@ class IncidentController extends Controller { $template->delete(); - return Redirect::route('dashboard.incidents.index'); + return Redirect::route('dashboard.templates.index') + ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.delete.success'))); } /** @@ -188,7 +189,7 @@ class IncidentController extends Controller ->withErrors($e->getMessageBag()); } - return Redirect::route('dashboard.templates.add') + return Redirect::route('dashboard.templates.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.add.success'))); } @@ -203,7 +204,8 @@ class IncidentController extends Controller { $this->dispatch(new RemoveIncidentCommand($incident)); - return Redirect::route('dashboard.incidents.index'); + return Redirect::route('dashboard.incidents.index') + ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success'))); } /** diff --git a/app/Http/Controllers/Dashboard/MetricController.php b/app/Http/Controllers/Dashboard/MetricController.php index a00b2bf2..8aba84d5 100644 --- a/app/Http/Controllers/Dashboard/MetricController.php +++ b/app/Http/Controllers/Dashboard/MetricController.php @@ -80,7 +80,7 @@ class MetricController extends Controller ->withErrors($e->getMessageBag()); } - return Redirect::route('dashboard.metrics.add') + return Redirect::route('dashboard.metrics.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.add.success'))); } @@ -106,7 +106,8 @@ class MetricController extends Controller { $this->dispatch(new RemoveMetricCommand($metric)); - return Redirect::route('dashboard.metrics.index'); + return Redirect::route('dashboard.metrics.index') + ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.delete.success'))); } /** diff --git a/app/Http/Controllers/Dashboard/ScheduleController.php b/app/Http/Controllers/Dashboard/ScheduleController.php index 497edd0b..dd792bb4 100644 --- a/app/Http/Controllers/Dashboard/ScheduleController.php +++ b/app/Http/Controllers/Dashboard/ScheduleController.php @@ -110,7 +110,7 @@ class ScheduleController extends Controller ->withErrors($e->getMessageBag()); } - return Redirect::route('dashboard.schedule.add') + return Redirect::route('dashboard.schedule.index') ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.add.success'))); } @@ -182,6 +182,6 @@ class ScheduleController extends Controller $schedule->delete(); return Redirect::route('dashboard.schedule.index') - ->withWarning(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success'))); + ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.schedule.delete.success'))); } } diff --git a/resources/lang/en/dashboard.php b/resources/lang/en/dashboard.php index eb0b2d61..0d0b5a1e 100755 --- a/resources/lang/en/dashboard.php +++ b/resources/lang/en/dashboard.php @@ -30,6 +30,10 @@ return [ 'success' => 'Incident updated.', 'failure' => 'Something went wrong with the incident.', ], + 'delete' => [ + 'success' => 'The incident has been deleted and will not show on your status page.', + 'failure' => 'The incident could not be deleted. Please try again.', + ], // Incident templates 'templates' => [ @@ -45,6 +49,10 @@ return [ 'success' => 'Template has been updated!', 'failure' => 'Something went wrong updating the incident template', ], + 'delete' => [ + 'success' => 'The tmplate has been deleted.', + 'failure' => 'The template could not be deleted. Please try again.', + ], ], ], @@ -85,6 +93,10 @@ return [ 'success' => 'Component updated.', 'failure' => 'Something went wrong with the component.', ], + 'delete' => [ + 'success' => 'Component deleted.', + 'failure' => 'The Component could not be deleted. Please try again.', + ], // Component groups 'groups' => [ @@ -100,6 +112,11 @@ return [ 'success' => 'Component group updated.', 'failure' => 'Something went wrong with the component group.', ], + 'delete' => [ + 'success' => 'Component Group deleted.', + 'failure' => 'The Component Group could not be deleted. Please try again.', + ], + ], ], @@ -117,6 +134,10 @@ return [ 'success' => 'Metric updated.', 'failure' => 'Something went wrong with the metric.', ], + 'delete' => [ + 'success' => 'The metric has been deleted and will not show on your status page.', + 'failure' => 'The metric could not be deleted. Please try again.', + ], ], // Subscribers 'subscribers' => [ diff --git a/resources/views/dashboard/components/groups/index.blade.php b/resources/views/dashboard/components/groups/index.blade.php index 5ab4f1df..bed117e0 100644 --- a/resources/views/dashboard/components/groups/index.blade.php +++ b/resources/views/dashboard/components/groups/index.blade.php @@ -15,6 +15,7 @@
+ @include('dashboard.partials.errors')
@forelse($groups as $group) diff --git a/resources/views/dashboard/components/index.blade.php b/resources/views/dashboard/components/index.blade.php index cb63323b..1454ba83 100644 --- a/resources/views/dashboard/components/index.blade.php +++ b/resources/views/dashboard/components/index.blade.php @@ -15,6 +15,7 @@
+ @include('dashboard.partials.errors')
@forelse($components as $component) diff --git a/resources/views/dashboard/templates/index.blade.php b/resources/views/dashboard/templates/index.blade.php index 84c7726a..6dc099f0 100644 --- a/resources/views/dashboard/templates/index.blade.php +++ b/resources/views/dashboard/templates/index.blade.php @@ -15,6 +15,7 @@
+ @include('dashboard.partials.errors')
@forelse($incident_templates as $template)