Skip to content

Commit

Permalink
Merge branch '2.4' into bugs-in-the-average-metrics-graph
Browse files Browse the repository at this point in the history
  • Loading branch information
uxen-ab committed Jan 17, 2018
2 parents c11626a + 64bf42a commit 9af7978
Show file tree
Hide file tree
Showing 184 changed files with 4,075 additions and 2,505 deletions.
69 changes: 63 additions & 6 deletions app/Http/Controllers/Dashboard/IncidentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
use CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand;
use CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand;
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\CreateIncidentUpdateCommand;
use CachetHQ\Cachet\Bus\Commands\IncidentUpdate\UpdateIncidentUpdateCommand;
use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use CachetHQ\Cachet\Models\IncidentUpdate;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Routing\Controller;
Expand Down Expand Up @@ -293,9 +295,21 @@ public function editTemplateAction(IncidentTemplate $template)
*
* @return \Illuminate\View\View
*/
public function showIncidentUpdateAction(Incident $incident)
public function showIncidentUpdates(Incident $incident)
{
return View::make('dashboard.incidents.update')->withIncident($incident);
return View::make('dashboard.incidents.updates.index')->withIncident($incident);
}

/**
* Shows the incident update form.
*
* @param \CachetHQ\Cachet\Models\Incident $incident
*
* @return \Illuminate\View\View
*/
public function showCreateIncidentUpdateAction(Incident $incident)
{
return View::make('dashboard.incidents.updates.add')->withIncident($incident);
}

/**
Expand All @@ -308,20 +322,63 @@ public function showIncidentUpdateAction(Incident $incident)
public function createIncidentUpdateAction(Incident $incident)
{
try {
$incident = dispatch(new CreateIncidentUpdateCommand(
$incidentUpdate = dispatch(new CreateIncidentUpdateCommand(
$incident,
Binput::get('status'),
Binput::get('message'),
$this->auth->user()
));
} catch (ValidationException $e) {
return cachet_redirect('dashboard.incidents.updates', ['id' => $incident->id])
return cachet_redirect('dashboard.incidents.updates.create', ['id' => $incident->id])
->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.edit.failure')))
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.updates.add.failure')))
->withErrors($e->getMessageBag());
}

return cachet_redirect('dashboard.incidents')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.update.success')));
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.updates.success')));
}

/**
* Shows the edit incident view.
*
* @param \CachetHQ\Cachet\Models\Incident $incident
* @param \CachetHQ\Cachet\Models\IncidentUpdate $incidentUpdate
*
* @return \Illuminate\View\View
*/
public function showEditIncidentUpdateAction(Incident $incident, IncidentUpdate $incidentUpdate)
{
return View::make('dashboard.incidents.updates.edit')
->withIncident($incident)
->withUpdate($incidentUpdate);
}

/**
* Edit an incident update.
*
* @param \CachetHQ\Cachet\Models\Incident $incident
* @param \CachetHQ\Cachet\Models\IncidentUpdate $incidentUpdate
*
* @return \Illuminate\Http\RedirectResponse
*/
public function editIncidentUpdateAction(Incident $incident, IncidentUpdate $incidentUpdate)
{
try {
$incidentUpdate = dispatch(new UpdateIncidentUpdateCommand(
$incidentUpdate,
Binput::get('status'),
Binput::get('message'),
$this->auth->user()
));
} catch (ValidationException $e) {
return cachet_redirect('dashboard.incidents.updates.edit', ['incident' => $incident->id, 'incident_update' => $incidentUpdate->id])
->withInput(Binput::all())
->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.updates.edit.failure')))
->withErrors($e->getMessageBag());
}

return cachet_redirect('dashboard.incidents.updates', ['incident' => $incident->id])
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.updates.edit.success')));
}
}
18 changes: 15 additions & 3 deletions app/Http/Routes/Dashboard/IncidentRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,24 @@ public function map(Registrar $router)

$router->get('{incident}/updates', [
'as' => 'get:dashboard.incidents.updates',
'uses' => 'IncidentController@showIncidentUpdateAction',
'uses' => 'IncidentController@showIncidentUpdates',
]);
$router->post('{incident}/updates', [
'as' => 'post:dashboard.incidents.updates',
$router->get('{incident}/updates/create', [
'as' => 'get:dashboard.incidents.updates.create',
'uses' => 'IncidentController@showCreateIncidentUpdateAction',
]);
$router->post('{incident}/updates/create', [
'as' => 'post:dashboard.incidents.updates.create',
'uses' => 'IncidentController@createIncidentUpdateAction',
]);
$router->get('{incident}/updates/{incident_update}', [
'as' => 'get:dashboard.incidents.updates.edit',
'uses' => 'IncidentController@showEditIncidentUpdateAction',
]);
$router->post('{incident}/updates/{incident_update}', [
'as' => 'post:dashboard.incidents.updates.edit',
'uses' => 'IncidentController@editIncidentUpdateAction',
]);
});
}
}
23 changes: 12 additions & 11 deletions resources/lang/af-ZA/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,28 @@
return [
// Components
'components' => [
'last_updated' => 'Last updated :timestamp',
'last_updated' => ':timestamp laas opgedateer',
'status' => [
0 => 'Unknown',
0 => 'Onbekend',
1 => 'Operasioneel',
2 => 'Prestasieprobleme',
3 => 'Gedeeltelike Onderbreking',
4 => 'Groot Onderbreking',
],
'group' => [
'other' => 'Other Components',
'other' => 'Ander komponente',
],
],

// Incidents
'incidents' => [
'none' => 'No incidents reported',
'none' => 'Geen voorvalle aangemeld',
'past' => 'Vorige Voorvalle',
'stickied' => 'Stickied Incidents',
'scheduled' => 'Geskeduleerde Instandhouding',
'scheduled_at' => ', scheduled :timestamp',
'posted' => 'Posted :timestamp',
'scheduled_at' => ', :timestamp geskeduleer',
'posted' => ':timestamp gepos',
'posted_at' => 'Posted at :timestamp',
'status' => [
1 => 'Onder die Loep',
2 => 'Geïdentifiseerd',
Expand All @@ -44,9 +45,9 @@
// Schedule
'schedules' => [
'status' => [
0 => 'Upcoming',
1 => 'In Progress',
2 => 'Complete',
0 => 'Opkomend',
1 => 'Besig',
2 => 'Voltooid',
],
],

Expand All @@ -65,7 +66,7 @@
// Metrics
'metrics' => [
'filter' => [
'last_hour' => 'Last Hour',
'last_hour' => 'Laaste uur',
'hourly' => 'Afgelope 12 Uur',
'weekly' => 'Weekliks',
'monthly' => 'Maandeliks',
Expand All @@ -74,7 +75,7 @@

// Subscriber
'subscriber' => [
'subscribe' => 'Subscribe to get the updates',
'subscribe' => 'Teken in om opdaterings te kry',
'unsubscribe' => 'Unsubscribe at :link',
'button' => 'Teken aan',
'manage' => [
Expand Down
40 changes: 25 additions & 15 deletions resources/lang/af-ZA/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,23 @@
'incidents' => [
'title' => 'Incidents & Schedule',
'incidents' => 'Incidents',
'logged' => '{0} There are no incidents, good work.|You have logged one incident.|You have reported <strong>:count</strong> incidents.',
'logged' => '{0} There are no incidents, good work.|[1] You have logged one incident.|[2,*] You have reported <strong>:count</strong> incidents.',
'incident-create-template' => 'Create Template',
'incident-templates' => 'Incident Templates',
'updates' => '{0} Zero Updates|One Update|:count Updates',
'updates' => [
'title' => 'Incident updates for :incident',
'count' => '{0} Zero Updates|[1] One Update|[2] Two Updates|[3,*] Several Updates',
'add' => [
'title' => 'Create new incident update',
'success' => 'Your new incident update has been created.',
'failure' => 'Something went wrong with the incident update.',
],
'edit' => [
'title' => 'Edit incident update',
'success' => 'The incident update has been updated.',
'failure' => 'Something went wrong updating the incident update',
],
],
'add' => [
'title' => 'Report an incident',
'success' => 'Incident added.',
Expand All @@ -36,11 +49,6 @@
'success' => 'The incident has been deleted and will not show on your status page.',
'failure' => 'The incident could not be deleted, please try again.',
],
'update' => [
'title' => 'Create new incident update',
'subtitle' => 'Add an update to <strong>:incident</strong>',
'success' => 'Update added.',
],

// Incident templates
'templates' => [
Expand All @@ -66,7 +74,7 @@
// Incident Maintenance
'schedule' => [
'schedule' => 'Geskeduleerde Instandhouding',
'logged' => '{0} There are no schedules, good work.|You have logged one schedule.|You have reported <strong>:count</strong> schedules.',
'logged' => '{0} There are no schedules, good work.|[1] You have logged one schedule.|[2,*] You have reported <strong>:count</strong> schedules.',
'scheduled_at' => 'Scheduled at :timestamp',
'add' => [
'title' => 'Add Scheduled Maintenance',
Expand Down Expand Up @@ -147,13 +155,15 @@
],
// Subscribers
'subscribers' => [
'subscribers' => 'Subscribers',
'description' => 'Subscribers will receive email updates when incidents are created or components are updated.',
'verified' => 'Verified',
'not_verified' => 'Not verified',
'subscriber' => ':email, subscribed :date',
'no_subscriptions' => 'Subscribed to all updates',
'add' => [
'subscribers' => 'Subscribers',
'description' => 'Subscribers will receive email updates when incidents are created or components are updated.',
'description_disabled' => 'To use this feature, you need allow people to signup for notifications.',
'verified' => 'Verified',
'not_verified' => 'Not verified',
'subscriber' => ':email, subscribed :date',
'no_subscriptions' => 'Subscribed to all updates',
'global' => 'Globally subscribed',
'add' => [
'title' => 'Add a new subscriber',
'success' => 'Subscriber has been added!',
'failure' => 'Something went wrong adding the subscriber, please try again.',
Expand Down
24 changes: 13 additions & 11 deletions resources/lang/af-ZA/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'time_before_refresh' => 'Status page refresh rate (in seconds).',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
'subscribers' => 'Allow people to signup to email notifications?',
Expand Down Expand Up @@ -223,17 +224,18 @@
],

// Buttons
'add' => 'Add',
'save' => 'Save',
'update' => 'Update',
'create' => 'Create',
'edit' => 'Edit',
'delete' => 'Delete',
'submit' => 'Submit',
'cancel' => 'Cancel',
'remove' => 'Remove',
'invite' => 'Invite',
'signup' => 'Teken Aan',
'add' => 'Add',
'save' => 'Save',
'update' => 'Update',
'create' => 'Create',
'edit' => 'Edit',
'delete' => 'Delete',
'submit' => 'Submit',
'cancel' => 'Cancel',
'remove' => 'Remove',
'invite' => 'Invite',
'signup' => 'Teken Aan',
'manage_updates' => 'Manage Updates',

// Other
'optional' => '* Optional',
Expand Down
4 changes: 2 additions & 2 deletions resources/lang/af-ZA/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
|
*/

'previous' => 'Previous',
'next' => 'Next',
'previous' => 'Vorige',
'next' => 'Volgende',

];
1 change: 1 addition & 0 deletions resources/lang/ar-SA/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'scheduled' => 'صيانة مجدولة',
'scheduled_at' => ', مجدولة :timestamp',
'posted' => 'تم الإرسال :timestamp',
'posted_at' => 'Posted at :timestamp',
'status' => [
1 => 'تحقيق',
2 => 'تم التعرف عليه',
Expand Down
40 changes: 25 additions & 15 deletions resources/lang/ar-SA/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@
'logged' => '{0} There are no incidents, good work.|You have logged one incident.|You have reported <strong>:count</strong> incidents.',
'incident-create-template' => 'إنشاء قالب',
'incident-templates' => 'قوالب الحالات',
'updates' => '{0} لا توجد تحديثات | تحديث واحد | :count تحديثات',
'updates' => [
'title' => 'Incident updates for :incident',
'count' => '{0} Zero Updates|[1] One Update|[2] Two Updates|[3,*] Several Updates',
'add' => [
'title' => 'إنشاء تحديث حالة جديد',
'success' => 'Your new incident update has been created.',
'failure' => 'Something went wrong with the incident update.',
],
'edit' => [
'title' => 'Edit incident update',
'success' => 'The incident update has been updated.',
'failure' => 'Something went wrong updating the incident update',
],
],
'add' => [
'title' => 'الإبلاغ عن حالة',
'success' => 'تم إضافة الحالة.',
Expand All @@ -36,11 +49,6 @@
'success' => 'تم حذف الحالة و لن تظهر في صفحة الحالة الخاصة بك.',
'failure' => 'حدث خلل أثناء حذف الحالة، الرجاء المحاولة مرة أخرى.',
],
'update' => [
'title' => 'إنشاء تحديث حالة جديد',
'subtitle' => 'إضافة تحديث إلى <strong>:incident</strong>',
'success' => 'Update added.',
],

// Incident templates
'templates' => [
Expand All @@ -52,7 +60,7 @@
'failure' => 'Something went wrong with the incident template.',
],
'edit' => [
'title' => 'Edit Template',
'title' => 'تغيير النموذج',
'success' => 'The incident template has been updated.',
'failure' => 'Something went wrong updating the incident template',
],
Expand Down Expand Up @@ -147,13 +155,15 @@
],
// Subscribers
'subscribers' => [
'subscribers' => 'Subscribers',
'description' => 'Subscribers will receive email updates when incidents are created or components are updated.',
'verified' => 'Verified',
'not_verified' => 'Not verified',
'subscriber' => ':email, subscribed :date',
'no_subscriptions' => 'Subscribed to all updates',
'add' => [
'subscribers' => 'المشتركين',
'description' => 'Subscribers will receive email updates when incidents are created or components are updated.',
'description_disabled' => 'To use this feature, you need allow people to signup for notifications.',
'verified' => 'Verified',
'not_verified' => 'Not verified',
'subscriber' => ':email, subscribed :date',
'no_subscriptions' => 'Subscribed to all updates',
'global' => 'Globally subscribed',
'add' => [
'title' => 'Add a new subscriber',
'success' => 'Subscriber has been added!',
'failure' => 'Something went wrong adding the subscriber, please try again.',
Expand All @@ -168,7 +178,7 @@

// Team
'team' => [
'team' => 'Team',
'team' => 'فريق',
'member' => 'Member',
'profile' => 'Profile',
'description' => 'Team Members will be able to add, modify & edit components and incidents.',
Expand Down
Loading

0 comments on commit 9af7978

Please sign in to comment.