This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ulrik nielsen
committed
Dec 14, 2015
1 parent
777e7d2
commit 5bb44d3
Showing
8 changed files
with
23 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,16 @@ | |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Unity\CachetSlackIntegration\Handlers\Events\Component; | ||
namespace Mrbase\CachetSlackIntegration\Handlers\Events\Component; | ||
|
||
use CachetHQ\Cachet\Events\Component\ComponentWasUpdatedEvent; | ||
use Maknz\Slack\Facades\Slack; | ||
use Unity\CachetSlackIntegration\Utils; | ||
use Mrbase\CachetSlackIntegration\Utils; | ||
|
||
/** | ||
* Class ComponentUpdated | ||
* | ||
* @package Unity\CachetSlackIntegration | ||
* @package Mrbase\CachetSlackIntegration | ||
* @author Ulrik Nielsen <[email protected]> | ||
*/ | ||
class ComponentUpdated | ||
|
@@ -31,21 +31,10 @@ public function handle(ComponentWasUpdatedEvent $event) | |
return; | ||
} | ||
|
||
$changes = Utils::getChanges('component'); | ||
$newStatus = $event->component->status; | ||
$oldStatus = isset($changes['status']) | ||
? $changes['status'] | ||
: $newStatus; | ||
|
||
if ($oldStatus == $newStatus) { | ||
return; | ||
} | ||
|
||
$statuses = trans('cachet.components.status'); | ||
$message = trans('slack::messages.component.status_update', [ | ||
'name' => $event->component->name, | ||
'old_status' => $statuses[$oldStatus], | ||
'new_status' => $statuses[$newStatus], | ||
'name' => $event->component->name, | ||
'status' => $statuses[$event->component->status], | ||
]); | ||
|
||
Slack::send($message); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,16 @@ | |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Unity\CachetSlackIntegration\Handlers\Events\Incident; | ||
namespace Mrbase\CachetSlackIntegration\Handlers\Events\Incident; | ||
|
||
use CachetHQ\Cachet\Events\Incident\IncidentWasReportedEvent; | ||
use Maknz\Slack\Facades\Slack; | ||
use Unity\CachetSlackIntegration\Utils; | ||
use Mrbase\CachetSlackIntegration\Utils; | ||
|
||
/** | ||
* Class IncidentReported | ||
* | ||
* @package Unity\CachetSlackIntegration | ||
* @package Mrbase\CachetSlackIntegration | ||
* @author Ulrik Nielsen <[email protected]> | ||
*/ | ||
class IncidentReported | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,16 @@ | |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Unity\CachetSlackIntegration\Handlers\Events\Incident; | ||
namespace Mrbase\CachetSlackIntegration\Handlers\Events\Incident; | ||
|
||
use CachetHQ\Cachet\Events\Incident\IncidentWasUpdatedEvent; | ||
use Maknz\Slack\Facades\Slack; | ||
use Unity\CachetSlackIntegration\Utils; | ||
use Mrbase\CachetSlackIntegration\Utils; | ||
|
||
/** | ||
* Class IncidentUpdated | ||
* | ||
* @package Unity\CachetSlackIntegration | ||
* @package Mrbase\CachetSlackIntegration | ||
* @author Ulrik Nielsen <[email protected]> | ||
*/ | ||
class IncidentUpdated | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,20 @@ | |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Unity\CachetSlackIntegration; | ||
namespace Mrbase\CachetSlackIntegration; | ||
|
||
use CachetHQ\Cachet\Models\Component; | ||
use CachetHQ\Cachet\Models\Incident; | ||
use Illuminate\Foundation\Support\Providers\EventServiceProvider; | ||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; | ||
use Unity\CachetSlackIntegration\Handlers\Events\Component\ComponentUpdated; | ||
use Unity\CachetSlackIntegration\Handlers\Events\Incident\IncidentReported; | ||
use Unity\CachetSlackIntegration\Handlers\Events\Incident\IncidentUpdated; | ||
use Mrbase\CachetSlackIntegration\Handlers\Events\Component\ComponentUpdated; | ||
use Mrbase\CachetSlackIntegration\Handlers\Events\Incident\IncidentReported; | ||
use Mrbase\CachetSlackIntegration\Handlers\Events\Incident\IncidentUpdated; | ||
|
||
/** | ||
* Class ServiceProvider | ||
* | ||
* @package Unity\CachetSlackIntegration | ||
* @package Mrbase\CachetSlackIntegration | ||
* @author Ulrik Nielsen <[email protected]> | ||
*/ | ||
class ServiceProvider extends EventServiceProvider | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,14 @@ | |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Unity\CachetSlackIntegration; | ||
namespace Mrbase\CachetSlackIntegration; | ||
|
||
use CachetHQ\Cachet\Models\Component; | ||
|
||
/** | ||
* Class Utils | ||
* | ||
* @package Unity\CachetSlackIntegration | ||
* @package Mrbase\CachetSlackIntegration | ||
* @author Ulrik Nielsen <[email protected]> | ||
*/ | ||
class Utils | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters