mirror of
https://github.com/cachethq/cachet.git
synced 2026-03-05 12:37:02 +00:00
Compare commits
81 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1400d4a04f | ||
|
|
b413e402e5 | ||
|
|
8c627ee037 | ||
|
|
9a0ceb52bf | ||
|
|
a2a36cd080 | ||
|
|
0ea41bed47 | ||
|
|
c14b6d7df7 | ||
|
|
d682a42892 | ||
|
|
8f5afff4a2 | ||
|
|
b045028c7b | ||
|
|
16189da222 | ||
|
|
7596966e6c | ||
|
|
dcea947973 | ||
|
|
d8ea3c59e3 | ||
|
|
a2f8f4540e | ||
|
|
4031c42958 | ||
|
|
8348f48692 | ||
|
|
faf91470aa | ||
|
|
58039634bd | ||
|
|
915ea0d0bd | ||
|
|
a019d82010 | ||
|
|
0f029702d4 | ||
|
|
71b5d446ba | ||
|
|
6246f20506 | ||
|
|
9dcc5d6896 | ||
|
|
235e3281b0 | ||
|
|
04b96e7dec | ||
|
|
e15af44449 | ||
|
|
ef9f7d23a0 | ||
|
|
ef694b027a | ||
|
|
f53e466500 | ||
|
|
1e24138d7a | ||
|
|
9120dba237 | ||
|
|
7f261a218a | ||
|
|
5b5db06ce3 | ||
|
|
b6635d30ee | ||
|
|
5ae23b64d2 | ||
|
|
0d90f0459b | ||
|
|
bcbbee22d9 | ||
|
|
9750191bff | ||
|
|
52c4901a78 | ||
|
|
587555c2d4 | ||
|
|
b4c7fb2ab0 | ||
|
|
e61d24f685 | ||
|
|
88e85d2dfb | ||
|
|
5b72f2febc | ||
|
|
4703aeadb2 | ||
|
|
ef304950bb | ||
|
|
ad8f098ec1 | ||
|
|
2551a1a038 | ||
|
|
3874b533be | ||
|
|
85c0e94408 | ||
|
|
1793f5588a | ||
|
|
46ff13c7fb | ||
|
|
da8c8fae74 | ||
|
|
ff9eb123c6 | ||
|
|
895d1ea1b6 | ||
|
|
503252c3a2 | ||
|
|
ec0f0768f0 | ||
|
|
68cc6eb93c | ||
|
|
fdfebc18fb | ||
|
|
0cd3ea0e92 | ||
|
|
0f10522e9c | ||
|
|
83e1013771 | ||
|
|
7d4bab478f | ||
|
|
18d7af2b35 | ||
|
|
e3cfb47d66 | ||
|
|
716d357738 | ||
|
|
cee336fd7c | ||
|
|
b3497820f9 | ||
|
|
67152806d7 | ||
|
|
5298ad241a | ||
|
|
e2da8ee1fa | ||
|
|
b6c22c1029 | ||
|
|
5c54830b0f | ||
|
|
1a6c22a8a9 | ||
|
|
cb5badefcc | ||
|
|
c25437871a | ||
|
|
e96088fc0f | ||
|
|
7472657812 | ||
|
|
6becaf2acd |
24
README.md
24
README.md
@@ -10,9 +10,9 @@
|
||||
|
||||
Cachet is a beautiful and powerful open source status page system, a free replacement to services such as StatusPage.io, Status.io and others.
|
||||
|
||||
## Supporting Cachet
|
||||
## Show your support
|
||||
|
||||
Cachet is a BSD-3-licensed open source project. If you'd like to support future development, check out the [Cachet Patreon campaign](https://patreon.com/jbrooksuk).
|
||||
Cachet is a BSD-3-licensed open source project. If you'd like to support future development, check out the [Patreon campaign](https://patreon.com/jbrooksuk).
|
||||
|
||||
## Features
|
||||
|
||||
@@ -29,7 +29,7 @@ Cachet is a BSD-3-licensed open source project. If you'd like to support future
|
||||
|
||||
## Usage in production
|
||||
|
||||
The `master` branch of this repository is a development branch and **should not** be used in production. Instead, please check out the latest tag release.
|
||||
Use of `master` in a production environment is not recommended as it may change at any time.
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -43,9 +43,9 @@ We're always looking for contributions that improve Cachet. It's easy to get sta
|
||||
|
||||
### Contributing as a non-developer/non-designer
|
||||
|
||||
If you're one of the more linguistically talented people in the world who can speak and write more than just English, we're always looking for new [translations](#translations).
|
||||
We're always looking for new [translations](#translations).
|
||||
|
||||
Of course bug reports, feature requests and [documentation](https://docs.cachethq.io) are always being sought after.
|
||||
Of course bug reports, feature requests and [documentation](https://docs.cachethq.io) are always appreciated.
|
||||
|
||||
### Contributing as a designer
|
||||
|
||||
@@ -56,22 +56,22 @@ You'll need to install Node.js, Bower and Gulp.
|
||||
To get started you can do the following:
|
||||
|
||||
1. Install Node.js and our dev dependencies.
|
||||
2. Modify the SCSS files in `./resources/assets/sass/`
|
||||
2. Make your changes to the SCSS files in `./resources/assets/sass/`
|
||||
3. Run `gulp`
|
||||
|
||||
If you're making a lot of changes, you'll find that running `gulp watch` will really help you out!
|
||||
If you're making a lot of changes, you'll find that running `gulp watch` will make life easier for you!
|
||||
|
||||
### Contributing as a developer
|
||||
|
||||
Built using [Laravel](https://laravel.com), Cachet is very easy to jump into. Have a look around you'll find it surprisingly easy!
|
||||
Built using [Laravel](https://laravel.com).
|
||||
|
||||
These extra dependencies are required to develop Cachet:
|
||||
We use these extra dependencies to develop Cachet:
|
||||
|
||||
- Node.js
|
||||
- Gulp
|
||||
- Git
|
||||
|
||||
Once cloned to your local machine, you'll need some demo data! Simply run `php artisan cachet:seed` to get the demo installation on the go.
|
||||
Once cloned to your local machine, you'll need some demo data! Run `php artisan cachet:seed` to get the demo installation on the go.
|
||||
|
||||
## Installation, Upgrades and Documentation
|
||||
|
||||
@@ -91,7 +91,7 @@ The demo is reset every half hour.
|
||||
|
||||
### Release Notes
|
||||
|
||||
All releases are listed on the [Releases page](https://github.com/CachetHQ/Cachet/releases) of the [Cachet GitHub repository](https://github.com/CachetHQ/Cachet). On the Releases page, you can also find the release notes for each release.
|
||||
We list releases on the [Releases page](https://github.com/CachetHQ/Cachet/releases) of the [Cachet GitHub repository](https://github.com/CachetHQ/Cachet). On the Releases page, you can also find the release notes for each release.
|
||||
|
||||
## Translations
|
||||
|
||||
@@ -99,7 +99,7 @@ A special thank you to our [translators](https://crowdin.com/project/cachet/acti
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Cachet, please send an e-mail to us at support@alt-three.com. All security vulnerabilities will be promptly addressed.
|
||||
If you discover a security vulnerability within Cachet, please send an e-mail to us at support@alt-three.com. We handle all security vulnerabilities on a case-by-case basis.
|
||||
|
||||
## Installations
|
||||
|
||||
|
||||
@@ -11,7 +11,12 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
final class AddTeamMemberCommand
|
||||
/**
|
||||
* This is the add user command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class AddUserCommand
|
||||
{
|
||||
/**
|
||||
* The user username.
|
||||
@@ -11,7 +11,12 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Commands\User;
|
||||
|
||||
final class InviteTeamMemberCommand
|
||||
/**
|
||||
* This is the invite user command.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
final class InviteUserCommand
|
||||
{
|
||||
/**
|
||||
* The invite emails.
|
||||
@@ -30,7 +35,7 @@ final class InviteTeamMemberCommand
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new invite team member command instance.
|
||||
* Create a new invite user command instance.
|
||||
*
|
||||
* @param string[] $emails
|
||||
*
|
||||
@@ -11,20 +11,25 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
class AddTeamMemberCommandHandler
|
||||
/**
|
||||
* This is the add user command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class AddUserCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the add team member command.
|
||||
* Handle the add user command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand $command
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\AddUserCommand $command
|
||||
*
|
||||
* @return \CachetHQ\Cachet\Models\User
|
||||
*/
|
||||
public function handle(AddTeamMemberCommand $command)
|
||||
public function handle(AddUserCommand $command)
|
||||
{
|
||||
$user = User::create([
|
||||
'username' => $command->username,
|
||||
@@ -11,20 +11,25 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Bus\Handlers\Commands\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
class InviteTeamMemberCommandHandler
|
||||
/**
|
||||
* This is the invite user command handler.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class InviteUserCommandHandler
|
||||
{
|
||||
/**
|
||||
* Handle the invite team member command.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand $command
|
||||
* @param \CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand $command
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(InviteTeamMemberCommand $command)
|
||||
public function handle(InviteUserCommand $command)
|
||||
{
|
||||
foreach ($command->emails as $email) {
|
||||
$invite = Invite::create([
|
||||
@@ -46,9 +46,9 @@ class SendSubscriberVerificationEmailHandler
|
||||
public function handle(SubscriberHasSubscribedEvent $event)
|
||||
{
|
||||
$mail = [
|
||||
'email' => $event->subscriber->email,
|
||||
'subject' => 'Confirm your subscription.',
|
||||
'link' => route('subscribe.verify', ['code' => $event->subscriber->verify_code]),
|
||||
'email' => $event->subscriber->email,
|
||||
'subject' => 'Confirm your subscription.',
|
||||
'link' => route('subscribe.verify', ['code' => $event->subscriber->verify_code]),
|
||||
];
|
||||
|
||||
$this->mailer->queue([
|
||||
|
||||
@@ -11,12 +11,41 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class AppComposer
|
||||
{
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Dates\DateFactory
|
||||
*/
|
||||
protected $dates;
|
||||
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new app composer instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Dates\DateFactory $dates
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DateFactory $dates, Repository $config)
|
||||
{
|
||||
$this->dates = $dates;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Index page view composer.
|
||||
*
|
||||
@@ -26,25 +55,28 @@ class AppComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->withAboutApp(Markdown::convertToHtml(Config::get('setting.app_about')));
|
||||
$view->withAppAnalytics(Config::get('setting.app_analytics'));
|
||||
$view->withAppAnalyticsGoSquared(Config::get('setting.app_analytics_gs'));
|
||||
$view->withAppAnalyticsPiwikUrl(Config::get('setting.app_analytics_piwik_url'));
|
||||
$view->withAppAnalyticsPiwikSiteId(Config::get('setting.app_analytics_piwik_site_id'));
|
||||
$view->withAppBanner(Config::get('setting.app_banner'));
|
||||
$view->withAppBannerStyleFullWidth(Config::get('setting.style_fullwidth_header'));
|
||||
$view->withAppBannerType(Config::get('setting.app_banner_type'));
|
||||
$view->withAppDomain(Config::get('setting.app_domain'));
|
||||
$view->withAppGraphs(Config::get('setting.display_graphs'));
|
||||
$view->withAppLocale(Config::get('setting.app_locale'));
|
||||
$view->withAppStylesheet(Config::get('setting.stylesheet'));
|
||||
$view->withAppUrl(Config::get('app.url'));
|
||||
$view->withAppHeader(Config::get('setting.header'));
|
||||
$view->withAppFooter(Config::get('setting.footer'));
|
||||
$view->withAppName(Config::get('setting.app_name'));
|
||||
$view->withShowSupport($support = Config::get('setting.show_support'));
|
||||
$view->withAutomaticLocalization(Config::get('setting.automatic_localization'));
|
||||
$view->withSiteTitle(Config::get('setting.app_name'));
|
||||
$view->withFontSubset(Config::get('langs.'.Config::get('app.locale').'.subset', 'latin'));
|
||||
$view->withAboutApp(Markdown::convertToHtml($this->config->get('setting.app_about')));
|
||||
$view->withAppAnalytics($this->config->get('setting.app_analytics'));
|
||||
$view->withAppAnalyticsGoSquared($this->config->get('setting.app_analytics_gs'));
|
||||
$view->withAppAnalyticsPiwikUrl($this->config->get('setting.app_analytics_piwik_url'));
|
||||
$view->withAppAnalyticsPiwikSiteId($this->config->get('setting.app_analytics_piwik_site_id'));
|
||||
$view->withAppBanner($this->config->get('setting.app_banner'));
|
||||
$view->withAppBannerStyleFullWidth($this->config->get('setting.style_fullwidth_header'));
|
||||
$view->withAppBannerType($this->config->get('setting.app_banner_type'));
|
||||
$view->withAppDomain($this->config->get('setting.app_domain'));
|
||||
$view->withAppGraphs($this->config->get('setting.display_graphs'));
|
||||
$view->withAppLocale($this->config->get('setting.app_locale'));
|
||||
$view->withAppStylesheet($this->config->get('setting.stylesheet'));
|
||||
$view->withAppUrl($this->config->get('app.url'));
|
||||
$view->withAppHeader($this->config->get('setting.header'));
|
||||
$view->withAppFooter($this->config->get('setting.footer'));
|
||||
$view->withAppName($this->config->get('setting.app_name'));
|
||||
$view->withShowSupport($this->config->get('setting.show_support'));
|
||||
$view->withAutomaticLocalization($this->config->get('setting.automatic_localization'));
|
||||
$view->withEnableExternalDependencies($this->config->get('setting.enable_external_dependencies'));
|
||||
$view->withShowTimezone($this->config->get('setting.show_timezone'));
|
||||
$view->withTimezone($this->dates->getTimezone());
|
||||
$view->withSiteTitle($this->config->get('setting.app_name'));
|
||||
$view->withFontSubset($this->config->get('langs.'.$this->config->get('app.locale').'.subset', 'latin'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,30 @@
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class MetricsComposer
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new metrics composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Metrics view composer.
|
||||
*
|
||||
@@ -27,7 +46,7 @@ class MetricsComposer
|
||||
public function compose(View $view)
|
||||
{
|
||||
$metrics = null;
|
||||
if ($displayMetrics = Config::get('setting.display_graphs')) {
|
||||
if ($displayMetrics = $this->config->get('setting.display_graphs')) {
|
||||
$metrics = Metric::displayable()->orderBy('order')->orderBy('id')->get();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,38 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Core\System;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
/**
|
||||
* This is the status page composer.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class StatusPageComposer
|
||||
{
|
||||
/**
|
||||
* The system instance.
|
||||
*
|
||||
* @var \CachetHQ\Cachet\Integrations\Contracts\System
|
||||
*/
|
||||
protected $system;
|
||||
|
||||
/**
|
||||
* Create a new status page composer instance.
|
||||
*
|
||||
* @param \CachetHQ\Cachet\Integrations\Contracts\System $system
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(System $system)
|
||||
{
|
||||
$this->system = $system;
|
||||
}
|
||||
|
||||
/**
|
||||
* Index page view composer.
|
||||
*
|
||||
@@ -27,42 +52,7 @@ class StatusPageComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$totalComponents = Component::enabled()->count();
|
||||
$majorOutages = Component::enabled()->status(4)->count();
|
||||
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents) >= 0.5 : false;
|
||||
|
||||
// Default data
|
||||
$withData = [
|
||||
'system_status' => 'info',
|
||||
'system_message' => trans_choice('cachet.service.bad', $totalComponents),
|
||||
'favicon' => 'favicon-high-alert',
|
||||
];
|
||||
|
||||
if ($isMajorOutage) {
|
||||
$withData = [
|
||||
'system_status' => 'danger',
|
||||
'system_message' => trans_choice('cachet.service.major', $totalComponents),
|
||||
'favicon' => 'favicon-high-alert',
|
||||
];
|
||||
} elseif (Component::enabled()->notStatus(1)->count() === 0) {
|
||||
// If all our components are ok, do we have any non-fixed incidents?
|
||||
$incidents = Incident::notScheduled()->orderBy('created_at', 'desc')->get()->filter(function ($incident) {
|
||||
return $incident->status > 0;
|
||||
});
|
||||
$incidentCount = $incidents->count();
|
||||
|
||||
if ($incidentCount === 0 || ($incidentCount >= 1 && (int) $incidents->first()->status === 4)) {
|
||||
$withData = [
|
||||
'system_status' => 'success',
|
||||
'system_message' => trans_choice('cachet.service.good', $totalComponents),
|
||||
'favicon' => 'favicon',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
if (Component::enabled()->whereIn('status', [2, 3])->count() > 0) {
|
||||
$withData['favicon'] = 'favicon-medium-alert';
|
||||
}
|
||||
}
|
||||
$status = $this->system->getStatus();
|
||||
|
||||
// Scheduled maintenance code.
|
||||
$scheduledMaintenance = Incident::scheduled()->orderBy('scheduled_at')->get();
|
||||
@@ -72,7 +62,7 @@ class StatusPageComposer
|
||||
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
|
||||
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
|
||||
|
||||
$view->with($withData)
|
||||
$view->with($status)
|
||||
->withComponentGroups($componentGroups)
|
||||
->withUngroupedComponents($ungroupedComponents)
|
||||
->withScheduledMaintenance($scheduledMaintenance);
|
||||
|
||||
@@ -11,11 +11,30 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class ThemeComposer
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new theme composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind data to the view.
|
||||
*
|
||||
@@ -26,17 +45,17 @@ class ThemeComposer
|
||||
public function compose(View $view)
|
||||
{
|
||||
// Theme colors.
|
||||
$view->withThemeBackgroundColor(Config::get('setting.style_background_color', '#F0F3F4'));
|
||||
$view->withThemeBackgroundFills(Config::get('setting.style_background_fills', '#FFFFFF'));
|
||||
$view->withThemeBannerBackgroundColor(Config::get('setting.style_banner_background_color', ''));
|
||||
$view->withThemeBannerPadding(Config::get('setting.style_banner_padding', '40px 0'));
|
||||
$view->withThemeTextColor(Config::get('setting.style_text_color', '#333333'));
|
||||
$view->withThemeReds(Config::get('setting.style_reds', '#ff6f6f'));
|
||||
$view->withThemeBlues(Config::get('setting.style_blues', '#3498db'));
|
||||
$view->withThemeGreens(Config::get('setting.style_greens', '#7ED321'));
|
||||
$view->withThemeYellows(Config::get('setting.style_yellows', '#F7CA18'));
|
||||
$view->withThemeOranges(Config::get('setting.style_oranges', '#FF8800'));
|
||||
$view->withThemeMetrics(Config::get('setting.style_metrics', '#0dccc0'));
|
||||
$view->withThemeLinks(Config::get('setting.style_links', '#7ED321'));
|
||||
$view->withThemeBackgroundColor($this->config->get('setting.style_background_color', '#F0F3F4'));
|
||||
$view->withThemeBackgroundFills($this->config->get('setting.style_background_fills', '#FFFFFF'));
|
||||
$view->withThemeBannerBackgroundColor($this->config->get('setting.style_banner_background_color', ''));
|
||||
$view->withThemeBannerPadding($this->config->get('setting.style_banner_padding', '40px 0'));
|
||||
$view->withThemeTextColor($this->config->get('setting.style_text_color', '#333333'));
|
||||
$view->withThemeReds($this->config->get('setting.style_reds', '#ff6f6f'));
|
||||
$view->withThemeBlues($this->config->get('setting.style_blues', '#3498db'));
|
||||
$view->withThemeGreens($this->config->get('setting.style_greens', '#7ED321'));
|
||||
$view->withThemeYellows($this->config->get('setting.style_yellows', '#F7CA18'));
|
||||
$view->withThemeOranges($this->config->get('setting.style_oranges', '#FF8800'));
|
||||
$view->withThemeMetrics($this->config->get('setting.style_metrics', '#0dccc0'));
|
||||
$view->withThemeLinks($this->config->get('setting.style_links', '#7ED321'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,30 @@ namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class TimezoneLocaleComposer
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new timezone locale composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Timezones and Locales composer.
|
||||
*
|
||||
@@ -27,7 +46,7 @@ class TimezoneLocaleComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$enabledLangs = Config::get('langs');
|
||||
$enabledLangs = $this->config->get('langs');
|
||||
|
||||
$langs = array_map(function ($lang) use ($enabledLangs) {
|
||||
$locale = basename($lang);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Dates;
|
||||
|
||||
use DateTimeZone;
|
||||
use Jenssegers\Date\Date;
|
||||
|
||||
class DateFactory
|
||||
@@ -88,4 +89,17 @@ class DateFactory
|
||||
{
|
||||
return (new Date($time))->setTimezone($this->cachetTimezone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the abbreviated timezone.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTimezone()
|
||||
{
|
||||
$dateTime = new Date();
|
||||
$dateTime->setTimeZone(new DateTimeZone($this->cachetTimezone));
|
||||
|
||||
return $dateTime->format('T');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@ namespace CachetHQ\Cachet\Foundation\Providers;
|
||||
use AltThree\Bus\Dispatcher;
|
||||
use CachetHQ\Cachet\Bus\Middleware\UseDatabaseTransactions;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Integrations\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Feed;
|
||||
use CachetHQ\Cachet\Integrations\Releases;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -55,9 +52,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function register()
|
||||
{
|
||||
$this->registerDateFactory();
|
||||
$this->registerCredits();
|
||||
$this->registerFeed();
|
||||
$this->registerReleases();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,47 +68,4 @@ class AppServiceProvider extends ServiceProvider
|
||||
return new DateFactory($appTimezone, $cacheTimezone);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the credits class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerCredits()
|
||||
{
|
||||
$this->app->singleton(Credits::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Credits($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the feed class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerFeed()
|
||||
{
|
||||
$this->app->singleton(Feed::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Feed($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the releases class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerReleases()
|
||||
{
|
||||
$this->app->singleton(Releases::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
$token = $app['config']->get('services.github.token');
|
||||
|
||||
return new Releases($cache, $token);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@ class EventServiceProvider extends ServiceProvider
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent' => [
|
||||
//
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\Incident\MaintenanceWasScheduledEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\Incident\SendMaintenanceEmailNotificationHandler',
|
||||
],
|
||||
@@ -90,5 +93,8 @@ class EventServiceProvider extends ServiceProvider
|
||||
'CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent' => [
|
||||
'CachetHQ\Cachet\Bus\Handlers\Events\User\SendInviteUserEmailHandler',
|
||||
],
|
||||
'CachetHQ\Cachet\Bus\Events\User\UserWasRemovedEvent' => [
|
||||
//
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
100
app/Foundation/Providers/IntegrationServiceProvider.php
Normal file
100
app/Foundation/Providers/IntegrationServiceProvider.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Foundation\Providers;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Credits as CreditsContract;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Feed as FeedContract;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Releases as ReleasesContract;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
|
||||
use CachetHQ\Cachet\Integrations\Core\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Core\Feed;
|
||||
use CachetHQ\Cachet\Integrations\Core\System;
|
||||
use CachetHQ\Cachet\Integrations\GitHub\Releases;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
/**
|
||||
* This is the integration service provider.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IntegrationServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->registerCredits();
|
||||
$this->registerFeed();
|
||||
$this->registerSystem();
|
||||
|
||||
$this->registerReleases();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the credits class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerCredits()
|
||||
{
|
||||
$this->app->singleton(CreditsContract::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Credits($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the feed class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerFeed()
|
||||
{
|
||||
$this->app->singleton(FeedContract::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
|
||||
return new Feed($cache);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the system class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerSystem()
|
||||
{
|
||||
$this->app->singleton(SystemContract::class, function (Container $app) {
|
||||
return new System();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the releases class.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerReleases()
|
||||
{
|
||||
$this->app->singleton(ReleasesContract::class, function ($app) {
|
||||
$cache = $app['cache.store'];
|
||||
$token = $app['config']->get('services.github.token');
|
||||
|
||||
return new Releases($cache, $token);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Api;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Releases;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Releases;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\System;
|
||||
|
||||
/**
|
||||
* This is the general api controller.
|
||||
@@ -37,11 +38,23 @@ class GeneralController extends AbstractApiController
|
||||
*/
|
||||
public function version()
|
||||
{
|
||||
$latest = app(Releases::class)->latest();
|
||||
$latest = app()->make(Releases::class)->latest();
|
||||
|
||||
return $this->setMetaData([
|
||||
'on_latest' => version_compare(CACHET_VERSION, $latest['tag_name']) === 1,
|
||||
'latest' => $latest,
|
||||
])->item(CACHET_VERSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the system status message.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
$system = app()->make(System::class)->getStatus();
|
||||
|
||||
return $this->item($system['system_message']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
@@ -48,12 +49,10 @@ class SubscriberController extends AbstractApiController
|
||||
*/
|
||||
public function postSubscribers()
|
||||
{
|
||||
$verified = Binput::get('verify', app(Repository::class)->get('setting.skip_subscriber_verification'));
|
||||
|
||||
try {
|
||||
$subscriber = dispatch(new SubscribeSubscriberCommand(
|
||||
Binput::get('email'),
|
||||
Binput::get('verify', false),
|
||||
Binput::get('components', null)
|
||||
));
|
||||
$subscriber = dispatch(new SubscribeSubscriberCommand(Binput::get('email'), $verified, Binput::get('components')));
|
||||
} catch (QueryException $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Feed;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Feed;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Credits;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use CachetHQ\Cachet\Settings\Repository;
|
||||
use Exception;
|
||||
|
||||
@@ -16,6 +16,7 @@ use CachetHQ\Cachet\Bus\Commands\Subscriber\SubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriberCommand;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\View;
|
||||
@@ -52,11 +53,13 @@ class SubscriberController extends Controller
|
||||
*/
|
||||
public function createSubscriberAction()
|
||||
{
|
||||
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
|
||||
|
||||
try {
|
||||
$subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email'));
|
||||
|
||||
foreach ($subscribers as $subscriber) {
|
||||
dispatch(new SubscribeSubscriberCommand($subscriber));
|
||||
dispatch(new SubscribeSubscriberCommand($subscriber, $verified));
|
||||
}
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('dashboard.subscribers.add')
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
namespace CachetHQ\Cachet\Http\Controllers\Dashboard;
|
||||
|
||||
use AltThree\Validator\ValidationException;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\RemoveUserCommand;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
@@ -81,7 +81,7 @@ class TeamController extends Controller
|
||||
public function postAddUser()
|
||||
{
|
||||
try {
|
||||
dispatch(new AddTeamMemberCommand(
|
||||
dispatch(new AddUserCommand(
|
||||
Binput::get('username'),
|
||||
Binput::get('password'),
|
||||
Binput::get('email'),
|
||||
@@ -130,7 +130,7 @@ class TeamController extends Controller
|
||||
public function postInviteUser()
|
||||
{
|
||||
try {
|
||||
dispatch(new InviteTeamMemberCommand(
|
||||
dispatch(new InviteUserCommand(
|
||||
array_unique(array_filter((array) Binput::get('emails')))
|
||||
));
|
||||
} catch (ValidationException $e) {
|
||||
|
||||
@@ -18,10 +18,12 @@ use CachetHQ\Cachet\Bus\Commands\Subscriber\UnsubscribeSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\UpdateSubscriberSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\VerifySubscriberCommand;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Cachet\Models\Subscription;
|
||||
use GrahamCampbell\Binput\Facades\Binput;
|
||||
use GrahamCampbell\Markdown\Facades\Markdown;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
@@ -56,10 +58,9 @@ class SubscribeController extends Controller
|
||||
{
|
||||
$email = Binput::get('email');
|
||||
$subscriptions = Binput::get('subscriptions');
|
||||
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
|
||||
|
||||
try {
|
||||
$verified = false;
|
||||
|
||||
$subscription = dispatch(new SubscribeSubscriberCommand($email, $verified));
|
||||
} catch (ValidationException $e) {
|
||||
return Redirect::route('status-page')
|
||||
@@ -147,15 +148,19 @@ class SubscribeController extends Controller
|
||||
}
|
||||
|
||||
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
|
||||
$usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->pluck('group_id');
|
||||
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
|
||||
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
|
||||
|
||||
if (!$subscriber) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
return View::make('subscribe.manage')
|
||||
->withComponents(Component::all())
|
||||
->withUngroupedComponents($ungroupedComponents)
|
||||
->withSubscriber($subscriber)
|
||||
->withSubscriptions($subscriber->subscriptions->pluck('component_id')->all());
|
||||
->withSubscriptions($subscriber->subscriptions->pluck('component_id')->all())
|
||||
->withComponentGroups($componentGroups);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,6 +33,7 @@ class ApiRoutes
|
||||
$router->group(['middleware' => ['auth.api']], function (Registrar $router) {
|
||||
$router->get('ping', 'GeneralController@ping');
|
||||
$router->get('version', 'GeneralController@version');
|
||||
$router->get('status', 'GeneralController@status');
|
||||
|
||||
$router->get('components', 'ComponentController@getComponents');
|
||||
$router->get('components/groups', 'ComponentGroupController@getGroups');
|
||||
|
||||
27
app/Integrations/Contracts/Credits.php
Normal file
27
app/Integrations/Contracts/Credits.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations\Contracts;
|
||||
|
||||
/**
|
||||
* This is the credits interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface Credits
|
||||
{
|
||||
/**
|
||||
* Returns the latest credits.
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function latest();
|
||||
}
|
||||
27
app/Integrations/Contracts/Feed.php
Normal file
27
app/Integrations/Contracts/Feed.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations\Contracts;
|
||||
|
||||
/**
|
||||
* This is the feed interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface Feed
|
||||
{
|
||||
/**
|
||||
* Returns the latest entries.
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function latest();
|
||||
}
|
||||
27
app/Integrations/Contracts/Releases.php
Normal file
27
app/Integrations/Contracts/Releases.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations\Contracts;
|
||||
|
||||
/**
|
||||
* This is the releases interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface Releases
|
||||
{
|
||||
/**
|
||||
* Returns the latest release.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function latest();
|
||||
}
|
||||
27
app/Integrations/Contracts/System.php
Normal file
27
app/Integrations/Contracts/System.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations\Contracts;
|
||||
|
||||
/**
|
||||
* This is the system interface.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
interface System
|
||||
{
|
||||
/**
|
||||
* Get the entire system status.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getStatus();
|
||||
}
|
||||
@@ -9,13 +9,14 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations;
|
||||
namespace CachetHQ\Cachet\Integrations\Core;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Credits as CreditsContract;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Contracts\Cache\Repository;
|
||||
|
||||
class Credits
|
||||
class Credits implements CreditsContract
|
||||
{
|
||||
/**
|
||||
* The default url.
|
||||
@@ -9,8 +9,9 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations;
|
||||
namespace CachetHQ\Cachet\Integrations\Core;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Feed as FeedContract;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Contracts\Cache\Repository;
|
||||
@@ -20,7 +21,7 @@ use Illuminate\Contracts\Cache\Repository;
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class Feed
|
||||
class Feed implements FeedContract
|
||||
{
|
||||
/**
|
||||
* The default url.
|
||||
70
app/Integrations/Core/System.php
Normal file
70
app/Integrations/Core/System.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations\Core;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\System as SystemContract;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
/**
|
||||
* This is the core system class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class System implements SystemContract
|
||||
{
|
||||
/**
|
||||
* Get the entire system status.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
$enabledScope = Component::enabled();
|
||||
$totalComponents = Component::enabled()->count();
|
||||
$majorOutages = Component::enabled()->status(4)->count();
|
||||
$isMajorOutage = $totalComponents ? ($majorOutages / $totalComponents) >= 0.5 : false;
|
||||
|
||||
// Default data
|
||||
$status = [
|
||||
'system_status' => 'info',
|
||||
'system_message' => trans_choice('cachet.service.bad', $totalComponents),
|
||||
'favicon' => 'favicon-high-alert',
|
||||
];
|
||||
|
||||
if ($isMajorOutage) {
|
||||
$status = [
|
||||
'system_status' => 'danger',
|
||||
'system_message' => trans_choice('cachet.service.major', $totalComponents),
|
||||
'favicon' => 'favicon-high-alert',
|
||||
];
|
||||
} elseif (Component::enabled()->notStatus(1)->count() === 0) {
|
||||
// If all our components are ok, do we have any non-fixed incidents?
|
||||
$incidents = Incident::notScheduled()->orderBy('created_at', 'desc')->get()->filter(function ($incident) {
|
||||
return $incident->status > 0;
|
||||
});
|
||||
$incidentCount = $incidents->count();
|
||||
|
||||
if ($incidentCount === 0 || ($incidentCount >= 1 && (int) $incidents->first()->status === 4)) {
|
||||
$status = [
|
||||
'system_status' => 'success',
|
||||
'system_message' => trans_choice('cachet.service.good', $totalComponents),
|
||||
'favicon' => 'favicon',
|
||||
];
|
||||
}
|
||||
} elseif (Component::enabled()->whereIn('status', [2, 3])->count() > 0) {
|
||||
$status['favicon'] = 'favicon-medium-alert';
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,13 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Cachet\Integrations;
|
||||
namespace CachetHQ\Cachet\Integrations\GitHub;
|
||||
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Releases as ReleasesContract;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Contracts\Cache\Repository;
|
||||
|
||||
class Releases
|
||||
class Releases implements ReleasesContract
|
||||
{
|
||||
/**
|
||||
* The default url.
|
||||
@@ -12,6 +12,7 @@
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use AltThree\Validator\ValidatingTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -66,7 +67,7 @@ class IncidentTemplate extends Model
|
||||
*
|
||||
* @return \Illuminate\Database\Query\Builder
|
||||
*/
|
||||
public function scopeForSlug($query, $slug)
|
||||
public function scopeForSlug(Builder $query, $slug)
|
||||
{
|
||||
return $query->where('slug', $slug);
|
||||
}
|
||||
|
||||
@@ -97,4 +97,27 @@ class ComponentGroupPresenter extends BasePresenter implements Arrayable
|
||||
'lowest_human_status' => $this->lowest_human_status(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if any of the contained components have active subscriptions.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has_subscriber($subscriptions)
|
||||
{
|
||||
$enabled_components = $this->wrappedObject->enabled_components()->orderBy('order')->pluck('id')->toArray();
|
||||
$intersected = array_intersect($enabled_components, $subscriptions);
|
||||
|
||||
return count($intersected) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine the class for collapsed/uncollapsed groups on the subscription form.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function collapse_class_with_subscriptions($subscriptions)
|
||||
{
|
||||
return $this->has_subscriber($subscriptions) ? 'ion-ios-minus-outline' : 'ion-ios-plus-outline';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.3-dev"
|
||||
"dev-master": "2.5-dev"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
|
||||
597
composer.lock
generated
597
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -184,6 +184,7 @@ return [
|
||||
'CachetHQ\Cachet\Foundation\Providers\ComposerServiceProvider',
|
||||
'CachetHQ\Cachet\Foundation\Providers\ConsoleServiceProvider',
|
||||
'CachetHQ\Cachet\Foundation\Providers\ConfigServiceProvider',
|
||||
'CachetHQ\Cachet\Foundation\Providers\IntegrationServiceProvider',
|
||||
'CachetHQ\Cachet\Foundation\Providers\EventServiceProvider',
|
||||
'CachetHQ\Cachet\Foundation\Providers\RepositoryServiceProvider',
|
||||
'CachetHQ\Cachet\Foundation\Providers\RouteServiceProvider',
|
||||
|
||||
@@ -56,4 +56,36 @@ return [
|
||||
|
||||
'show_support' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable External Dependencies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether to disable third-party dependencies.
|
||||
|
|
||||
*/
|
||||
|
||||
'enable_external_dependencies' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Show the timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether to show the status page timezone in the footer.
|
||||
|
|
||||
*/
|
||||
|
||||
'show_timezone' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Skip subscriber verifications
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Whether to allow skipping of subscriber verifications.
|
||||
|
|
||||
*/
|
||||
|
||||
'skip_subscriber_verification' => false,
|
||||
];
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
var elixir = require('laravel-elixir');
|
||||
|
||||
elixir.config.production = true;
|
||||
elixir.config.sourcemaps = false;
|
||||
|
||||
elixir(function (mix) {
|
||||
mix
|
||||
.sass('app.scss', 'public/dist/css/app.css')
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
</filter>
|
||||
<php>
|
||||
<env name="APP_ENV" value="testing"/>
|
||||
<env name="APP_DEBUG" value="true"/>
|
||||
<env name="APP_URL" value="http://localhost"/>
|
||||
<env name="APP_KEY" value="GCvcgDKMRIN498g52zfVEd9CxDs6PR7q"/>
|
||||
<env name="DB_DRIVER" value="sqlite"/>
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 7.1 KiB |
@@ -277,6 +277,24 @@ $(function() {
|
||||
$this.next('.group-items').toggleClass('hide');
|
||||
});
|
||||
|
||||
$('.select-group').on('click', function () {
|
||||
var $parentGroup = $(this).closest('ul.list-group');
|
||||
$parentGroup.find('input[type=checkbox]').prop('checked', true);
|
||||
$parentGroup.find('.group-items').removeClass('hide')
|
||||
$parentGroup.find('.group-toggle').addClass('ion-ios-minus-outline').removeClass('ion-ios-plus-outline');
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.deselect-group').on('click', function () {
|
||||
var $parentGroup = $(this).closest('ul.list-group');
|
||||
$parentGroup.find('input[type=checkbox]').prop('checked', false);
|
||||
$parentGroup.find('.group-items').addClass('hide');
|
||||
$parentGroup.find('.group-toggle').removeClass('ion-ios-minus-outline').addClass('ion-ios-plus-outline');
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Setup wizard
|
||||
$('.wizard-next').on('click', function () {
|
||||
var $form = $('#setup-form'),
|
||||
|
||||
@@ -15,7 +15,7 @@ $tooltip-bg: #333 !default;
|
||||
$tooltip-opacity: .9 !default;
|
||||
$base-background-color: #f1f1f1;
|
||||
|
||||
$base-font-family: "Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
|
||||
$base-font-family: -apple-system, BlinkMacSystemFont, "Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
|
||||
$base-font-weight: 400;
|
||||
$base-letter-spacing: 0.08em;
|
||||
$base-font-size: 15px;
|
||||
|
||||
@@ -136,6 +136,7 @@ return [
|
||||
'home' => 'Home',
|
||||
'description' => 'Stay up to date with the latest service updates from :app.',
|
||||
'powered_by' => 'Powered by <a href="https://cachethq.io" class="links">Cachet</a>.',
|
||||
'timezone' => 'Times are shown in :timezone.',
|
||||
'about_this_site' => 'About This Site',
|
||||
'rss-feed' => 'RSS',
|
||||
'atom-feed' => 'Atom',
|
||||
|
||||
@@ -104,17 +104,20 @@ return [
|
||||
|
||||
// Settings
|
||||
'settings' => [
|
||||
/// Application setup
|
||||
// Application setup
|
||||
'app-setup' => [
|
||||
'site-name' => 'Site Name',
|
||||
'site-url' => 'Site URL',
|
||||
'display-graphs' => 'Display graphs on status page?',
|
||||
'about-this-page' => 'About this page',
|
||||
'days-of-incidents' => 'How many days of incidents to show?',
|
||||
'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?',
|
||||
'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?',
|
||||
'site-name' => 'Site Name',
|
||||
'site-url' => 'Site URL',
|
||||
'display-graphs' => 'Display graphs on status page?',
|
||||
'about-this-page' => 'About this page',
|
||||
'days-of-incidents' => 'How many days of incidents to show?',
|
||||
'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?',
|
||||
'skip_subscriber_verification' => 'Skip verifying of users? (Be warned, you could be spammed)',
|
||||
'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?',
|
||||
'enable_external_dependencies' => 'Enable Third Party Dependencies (Google Fonts, Trackers, etc...)',
|
||||
'show_timezone' => 'Show the timezone the status page is running in.',
|
||||
],
|
||||
'analytics' => [
|
||||
'analytics_google' => 'Google Analytics code',
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<li class="list-group-item {{ $component->group_id ? "sub-component" : "component" }}">
|
||||
<form class='component-inline form-vertical' data-messenger="{{trans('dashboard.components.edit.success')}}">
|
||||
<form class='component-inline form-vertical' data-messenger="{{ trans('dashboard.components.edit.success') }}">
|
||||
<div class="row striped-list-item">
|
||||
<div class="col-lg-4 col-md-3 col-sm-12">
|
||||
<h5 class="{{ $component->status_color }}">{{ $component->name }}</h5>
|
||||
</div>
|
||||
<div class="col-lg-8 col-md-9 col-sm-12 radio-items component-inline-update">
|
||||
@foreach(trans('cachet.components.status') as $statusID => $status)
|
||||
@foreach(trans('cachet.components.status') as $id => $status)
|
||||
<div class="radio-inline">
|
||||
<label>
|
||||
<input type="radio" name="status" value="{{ $statusID }}" {{ (int) $component->status === $statusID ? 'checked' : null }}>
|
||||
<input type="radio" name="status" value="{{ $id }}" {{ (int) $component->status === $id ? 'checked' : null }}>
|
||||
{{ $status }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
@if($component_groups->count() > 0)
|
||||
@foreach($component_groups as $componentGroup)
|
||||
@if($componentGroup->enabled_components->count() > 0)
|
||||
@foreach($component_groups as $component_group)
|
||||
@if($component_group->enabled_components)
|
||||
<ul class="list-group components">
|
||||
<li class="list-group-item group-name">
|
||||
<i class="{{ $componentGroup->collapse_class }} group-toggle"></i>
|
||||
<span class="component-group-name">{{ $componentGroup->name }}</span>
|
||||
<i class="{{ $component_group->collapse_class }} group-toggle"></i>
|
||||
<span class="component-group-name">{{ $component_group->name }}</span>
|
||||
</li>
|
||||
<div class="group-items {{ $componentGroup->is_collapsed ? "hide" : null }}">
|
||||
@foreach($componentGroup->enabled_components()->orderBy('order')->get() as $component)
|
||||
<div class="group-items {{ $component_group->is_collapsed ? "hide" : null }}">
|
||||
@foreach($component_group->enabled_components()->orderBy('order')->get() as $component)
|
||||
@include('dashboard.partials.component', compact($component))
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
|
||||
<title>{{ $page_title or $site_title }}</title>
|
||||
|
||||
@if($enable_external_dependencies)
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css">
|
||||
@endif
|
||||
<link rel="stylesheet" href="{{ elixir('dist/css/all.css') }}">
|
||||
@yield('css')
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label>{{ trans('forms.settings.analytics.analytics_piwik_siteid') }}</label>
|
||||
<input type="number" min="1" max="100" name="app_analytics_piwik_site_id" class="form-control" value="{{ $app_analytics_piwik_site_id }}" placeholder="1">
|
||||
<input type="number" min="1" max="1000" name="app_analytics_piwik_site_id" class="form-control" value="{{ $app_analytics_piwik_site_id }}" placeholder="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,6 +62,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="hidden" value="0" name="skip_subscriber_verification">
|
||||
<input type="checkbox" value="1" name="skip_subscriber_verification" {{ Config::get('setting.skip_subscriber_verification') ? 'checked' : null }}>
|
||||
{{ trans('forms.settings.app-setup.skip_subscriber_verification') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="checkbox">
|
||||
@@ -84,6 +95,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="hidden" value="0" name="enable_external_dependencies">
|
||||
<input type="checkbox" value="1" name="enable_external_dependencies" {{ $enable_external_dependencies ? 'checked' : null }}>
|
||||
{{ trans('forms.settings.app-setup.enable_external_dependencies') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="hidden" value="0" name="show_timezone">
|
||||
<input type="checkbox" value="1" name="show_timezone" {{ $show_timezone ? 'checked' : null }}>
|
||||
{{ trans('forms.settings.app-setup.show_timezone') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="form-group">
|
||||
<label>
|
||||
{{ trans('forms.settings.localization.date-format') }}
|
||||
<a href="http://php.net/manual/en/function.date.php" target="_blank"><i class="ion ion-help-circled"></i></a>
|
||||
<a href="http://php.net/manual/en/datetime.format.php" target="_blank"><i class="ion ion-help-circled"></i></a>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="date_format" value="{{ Config::get('setting.date_format') ?: 'l jS F Y' }}">
|
||||
</div>
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="form-group">
|
||||
<label>
|
||||
{{ trans('forms.settings.localization.incident-date-format') }}
|
||||
<a href="http://php.net/manual/en/function.date.php" target="_blank"><i class="ion ion-help-circled"></i></a>
|
||||
<a href="http://php.net/manual/en/datetime.format.php" target="_blank"><i class="ion ion-help-circled"></i></a>
|
||||
</label>
|
||||
<input type="text" class="form-control" name="incident_date_format" value="{{ Config::get('setting.incident_date_format') ?: 'l jS F Y H:i:s' }}">
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,9 @@
|
||||
|
||||
<title>{{ $site_title }}</title>
|
||||
|
||||
@if($enable_external_dependencies)
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css">
|
||||
@endif
|
||||
<link rel="stylesheet" href="{{ elixir('dist/css/all.css') }}">
|
||||
|
||||
@include('partials.stylesheet')
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@if($enable_external_dependencies)
|
||||
@if($app_analytics)
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
@@ -14,12 +15,10 @@
|
||||
arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];
|
||||
d.src='https://d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.
|
||||
insertBefore(d,q)}(window,document,'script','_gs');
|
||||
|
||||
_gs('{{ $app_analytics_go_squared }}');
|
||||
</script>
|
||||
@endif
|
||||
@if($app_analytics_piwik_url)
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
@@ -34,3 +33,4 @@
|
||||
</script>
|
||||
<noscript><p><img src="https://{{ $app_analytics_piwik_url }}/piwik.php?idsite={{ $app_analytics_piwik_site_id }}" style="border:0;" alt="" /></p></noscript>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
17
resources/views/partials/component_input.blade.php
Normal file
17
resources/views/partials/component_input.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<li class="list-group-item {{ $component->group_id ? "sub-component" : "component" }}">
|
||||
<div class="checkbox">
|
||||
<label for="component-{{ $component->id }}">
|
||||
<input type="checkbox"
|
||||
id="component-{{ $component->id }}"
|
||||
name="subscriptions[]"
|
||||
value="{{ $component->id }}"
|
||||
@if (in_array($component->id, $subscriptions) || $subscriber->global)
|
||||
checked="checked"
|
||||
@endif />
|
||||
{{ $component->name }}
|
||||
</label>
|
||||
</div>
|
||||
@if($component->description)
|
||||
<i class="ion ion-ios-help-outline help-icon" data-toggle="tooltip" data-title="{{ $component->description }}" data-container="body"></i>
|
||||
@endif
|
||||
</li>
|
||||
33
resources/views/partials/components_form.blade.php
Normal file
33
resources/views/partials/components_form.blade.php
Normal file
@@ -0,0 +1,33 @@
|
||||
@if($component_groups->count() > 0)
|
||||
@foreach($component_groups as $componentGroup)
|
||||
<ul class="list-group components">
|
||||
@if($componentGroup->enabled_components->count() > 0)
|
||||
<li class="list-group-item group-name">
|
||||
<i class="{{ $componentGroup->collapse_class_with_subscriptions($subscriptions) }} group-toggle"></i>
|
||||
<strong>{{ $componentGroup->name }}</strong>
|
||||
<div class="pull-right text-muted small">
|
||||
<a href="#" class="select-group" id="select-all-{{$componentGroup->id}}">Select All</a>
|
||||
|
|
||||
<a href="#" class="deselect-group" id="deselect-all-{{$componentGroup->id}}">Deselect All</a>
|
||||
</div>
|
||||
</li>
|
||||
<div class="form-group group-items {{ $componentGroup->has_subscriber($subscriptions) ? null : "hide" }}">
|
||||
@foreach($componentGroup->enabled_components()->orderBy('order')->get() as $component)
|
||||
@include('partials.component_input', compact($component))
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</ul>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if($ungrouped_components->count() > 0)
|
||||
<ul class="list-group components">
|
||||
<li class="list-group-item group-name">
|
||||
<strong>{{ trans('cachet.components.group.other') }}</strong>
|
||||
</li>
|
||||
@foreach($ungrouped_components as $component)
|
||||
@include('partials.component_input', compact($component))
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@@ -1,4 +1,4 @@
|
||||
@if($app_locale === 'en-UD')
|
||||
@if($app_locale === 'en-UD' && $enable_external_dependencies)
|
||||
<script type="text/javascript">
|
||||
var _jipt = [];
|
||||
_jipt.push(['project', 'cachet']);
|
||||
|
||||
@@ -4,12 +4,17 @@
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-5">
|
||||
<div class="col-sm-4">
|
||||
@if($show_support)
|
||||
<p>{!! trans('cachet.powered_by') !!}</p>
|
||||
<p>
|
||||
{!! trans('cachet.powered_by') !!}
|
||||
@if($show_timezone)
|
||||
{{ trans('cachet.timezone', ['timezone' => $timezone]) }}
|
||||
@endif
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="col-sm-8">
|
||||
<ul class="list-inline">
|
||||
@if($current_user || Config::get('setting.dashboard_login_link'))
|
||||
<li>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="pull-right">
|
||||
<p><a class="btn btn-success btn-outline" href="/"><i class="ion ion-home"></i></a></p>
|
||||
</div>
|
||||
@@ -17,43 +18,24 @@
|
||||
Manage notifications for {{ $subscriber->email }}
|
||||
</p>
|
||||
</div>
|
||||
@if($components->count() > 0)
|
||||
<form action="{{ route('subscribe.manage', $subscriber->verify_code) }}" method="post">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{{ trans('cachet.subscriber.manage.my_subscriptions') }}
|
||||
</div>
|
||||
<div class="list-group">
|
||||
@foreach($components as $component)
|
||||
<div class="list-group-item">
|
||||
<div class="checkbox">
|
||||
<label for="component-{{ $component->id }}">
|
||||
<input type="checkbox"
|
||||
id="component-{{ $component->id }}"
|
||||
name="subscriptions[]"
|
||||
value="{{ $component->id }}"
|
||||
@if (in_array($component->id, $subscriptions) || $subscriber->global)
|
||||
checked="checked"
|
||||
@endif>
|
||||
{{ $component->name }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="panel-body">
|
||||
@if(!$component_groups->isEmpty() || !$ungrouped_components->isEmpty())
|
||||
@include('partials.components_form')
|
||||
@else
|
||||
<p>{{ trans('cachet.subscriber.manage.no_subscriptions') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button type="submit" class="btn btn-success">Update Subscription</button>
|
||||
</div>
|
||||
</form>
|
||||
@else
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<p>{{ trans('cachet.subscriber.manage.no_subscriptions') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
30
tests/Bus/Commands/CommandExistenceTest.php
Normal file
30
tests/Bus/Commands/CommandExistenceTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Commands;
|
||||
|
||||
use AltThree\TestBench\ExistenceTrait;
|
||||
use PHPUnit_Framework_TestCase as TestCase;
|
||||
|
||||
/**
|
||||
* This is the command existence test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class CommandExistenceTest extends TestCase
|
||||
{
|
||||
use ExistenceTrait;
|
||||
|
||||
protected function getSourcePath()
|
||||
{
|
||||
return realpath(__DIR__.'/../../../app/Bus/Commands');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Commands\Subscriber;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\Subscriber\UpdateSubscriberSubscriptionCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\Subscriber\UpdateSubscriberSubscriptionCommandHandler;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the update subscriber subscription command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UpdateSubscriberSubscriptionCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['subscriber' => new Subscriber(), 'subscriptions' => null];
|
||||
$object = new UpdateSubscriberSubscriptionCommand($params['subscriber'], $params['subscriptions']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return UpdateSubscriberSubscriptionCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -12,17 +12,17 @@
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Commands\User;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\User\AddTeamMemberCommandHandler;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\AddUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\User\AddUserCommandHandler;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the add team member command test class.
|
||||
* This is the add user command test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class AddTeamMemberCommandTest extends AbstractTestCase
|
||||
class AddUserCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
@@ -35,7 +35,7 @@ class AddTeamMemberCommandTest extends AbstractTestCase
|
||||
'level' => 1,
|
||||
];
|
||||
|
||||
$object = new AddTeamMemberCommand(
|
||||
$object = new AddUserCommand(
|
||||
$params['username'],
|
||||
$params['password'],
|
||||
$params['email'],
|
||||
@@ -52,6 +52,6 @@ class AddTeamMemberCommandTest extends AbstractTestCase
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return AddTeamMemberCommandHandler::class;
|
||||
return AddUserCommandHandler::class;
|
||||
}
|
||||
}
|
||||
@@ -12,23 +12,24 @@
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Commands\User;
|
||||
|
||||
use AltThree\TestBench\CommandTrait;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteTeamMemberCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\User\InviteTeamMemberCommandHandler;
|
||||
use CachetHQ\Cachet\Bus\Commands\User\InviteUserCommand;
|
||||
use CachetHQ\Cachet\Bus\Handlers\Commands\User\InviteUserCommandHandler;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the invite team member command test class.
|
||||
* This is the invite user command test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
* @author James Brooks <graham@alt-three.com>
|
||||
*/
|
||||
class InviteTeamMemberCommandTest extends AbstractTestCase
|
||||
class InviteUserCommandTest extends AbstractTestCase
|
||||
{
|
||||
use CommandTrait;
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['emails' => ['foo@example.com']];
|
||||
$object = new InviteTeamMemberCommand($params['emails']);
|
||||
$object = new InviteUserCommand($params['emails']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
@@ -40,6 +41,6 @@ class InviteTeamMemberCommandTest extends AbstractTestCase
|
||||
|
||||
protected function getHandlerClass()
|
||||
{
|
||||
return InviteTeamMemberCommandHandler::class;
|
||||
return InviteUserCommandHandler::class;
|
||||
}
|
||||
}
|
||||
30
tests/Bus/Events/EventExistenceTest.php
Normal file
30
tests/Bus/Events/EventExistenceTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events;
|
||||
|
||||
use AltThree\TestBench\ExistenceTrait;
|
||||
use PHPUnit_Framework_TestCase as TestCase;
|
||||
|
||||
/**
|
||||
* This is the event existence test class.
|
||||
*
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class EventExistenceTest extends TestCase
|
||||
{
|
||||
use ExistenceTrait;
|
||||
|
||||
protected function getSourcePath()
|
||||
{
|
||||
return realpath(__DIR__.'/../../../app/Bus/Events');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/Incident/IncidentWasRemovedEventTest.php
Normal file
36
tests/Bus/Events/Incident/IncidentWasRemovedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
/**
|
||||
* This is the incident was removed event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IncidentWasRemovedEventTest extends AbstractIncidentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['incident' => new Incident()];
|
||||
$object = new IncidentWasRemovedEvent($params['incident']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/Incident/IncidentWasReportedEventTest.php
Normal file
36
tests/Bus/Events/Incident/IncidentWasReportedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasReportedEvent;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
/**
|
||||
* This is the incident was reported event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IncidentWasReportedEventTest extends AbstractIncidentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['incident' => new Incident()];
|
||||
$object = new IncidentWasReportedEvent($params['incident']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/Incident/IncidentWasUpdatedEventTest.php
Normal file
36
tests/Bus/Events/Incident/IncidentWasUpdatedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
/**
|
||||
* This is the incident was updated event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class IncidentWasUpdatedEventTest extends AbstractIncidentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['incident' => new Incident()];
|
||||
$object = new IncidentWasUpdatedEvent($params['incident']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\MaintenanceWasScheduledEvent;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
|
||||
/**
|
||||
* This is the maintenance was scheduled event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class MaintenanceWasScheduledEventTest extends AbstractIncidentEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['incident' => new Incident()];
|
||||
$object = new MaintenanceWasScheduledEvent($params['incident']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php
Normal file
36
tests/Bus/Events/Metric/MetricPointWasAddedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
/**
|
||||
* This is the metric point was added event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class MetricPointWasAddedEventTest extends AbstractMetricEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['metricPoint' => new MetricPoint()];
|
||||
$object = new MetricPointWasAddedEvent($params['metricPoint']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/Metric/MetricPointWasRemovedEventTest.php
Normal file
36
tests/Bus/Events/Metric/MetricPointWasRemovedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
/**
|
||||
* This is the metric point was removed event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class MetricPointWasRemovedEventTest extends AbstractMetricEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['metricPoint' => new MetricPoint()];
|
||||
$object = new MetricPointWasRemovedEvent($params['metricPoint']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/Metric/MetricPointWasUpdatedEventTest.php
Normal file
36
tests/Bus/Events/Metric/MetricPointWasUpdatedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\Metric;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricPointWasUpdatedEvent;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
|
||||
/**
|
||||
* This is the metric point was updated event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class MetricPointWasUpdatedEventTest extends AbstractMetricEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['metricPoint' => new MetricPoint()];
|
||||
$object = new MetricPointWasUpdatedEvent($params['metricPoint']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/User/UserWasInvitedEventTest.php
Normal file
36
tests/Bus/Events/User/UserWasInvitedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasInvitedEvent;
|
||||
use CachetHQ\Cachet\Models\Invite;
|
||||
|
||||
/**
|
||||
* This is the user was invited event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UserWasInvitedEventTest extends AbstractUserEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['invite' => new Invite()];
|
||||
$object = new UserWasInvitedEvent($params['invite']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
36
tests/Bus/Events/User/UserWasRemovedEventTest.php
Normal file
36
tests/Bus/Events/User/UserWasRemovedEventTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Bus\Events\User;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Events\User\UserWasRemovedEvent;
|
||||
use CachetHQ\Cachet\Models\User;
|
||||
|
||||
/**
|
||||
* This is the user was removed event test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
*/
|
||||
class UserWasRemovedEventTest extends AbstractUserEventTestCase
|
||||
{
|
||||
protected function objectHasHandlers()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getObjectAndParams()
|
||||
{
|
||||
$params = ['user' => new User()];
|
||||
$object = new UserWasRemovedEvent($params['user']);
|
||||
|
||||
return compact('params', 'object');
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,6 @@ namespace CachetHQ\Tests\Cachet\Foundation\Providers;
|
||||
|
||||
use AltThree\TestBench\ServiceProviderTrait;
|
||||
use CachetHQ\Cachet\Dates\DateFactory;
|
||||
use CachetHQ\Cachet\Integrations\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Releases;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
@@ -30,14 +28,4 @@ class AppServiceProviderTest extends AbstractTestCase
|
||||
{
|
||||
$this->assertIsInjectable(DateFactory::class);
|
||||
}
|
||||
|
||||
public function testCreditsIsInjectable()
|
||||
{
|
||||
$this->assertIsInjectable(Credits::class);
|
||||
}
|
||||
|
||||
public function testReleasesIsInjectable()
|
||||
{
|
||||
$this->assertIsInjectable(Releases::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Cachet.
|
||||
*
|
||||
* (c) Alt Three Services Limited
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CachetHQ\Tests\Cachet\Foundation\Providers;
|
||||
|
||||
use AltThree\TestBench\ServiceProviderTrait;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Credits;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Feed;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\Releases;
|
||||
use CachetHQ\Cachet\Integrations\Contracts\System;
|
||||
use CachetHQ\Tests\Cachet\AbstractTestCase;
|
||||
|
||||
/**
|
||||
* This is the integration service provider test class.
|
||||
*
|
||||
* @author James Brooks <james@alt-three.com>
|
||||
* @author Graham Campbell <graham@alt-three.com>
|
||||
*/
|
||||
class IntegrationServiceProviderTest extends AbstractTestCase
|
||||
{
|
||||
use ServiceProviderTrait;
|
||||
|
||||
public function testCreditsIsInjectable()
|
||||
{
|
||||
$this->assertIsInjectable(Credits::class);
|
||||
}
|
||||
|
||||
public function testFeedIsInjectable()
|
||||
{
|
||||
$this->assertIsInjectable(Feed::class);
|
||||
}
|
||||
|
||||
public function testSystemIsInjectable()
|
||||
{
|
||||
$this->assertIsInjectable(System::class);
|
||||
}
|
||||
|
||||
public function testReleasesIsInjectable()
|
||||
{
|
||||
$this->assertIsInjectable(Releases::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user