Skip to content

Commit

Permalink
Add "Unknown" status to the available component statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasfagotti committed Oct 21, 2016
1 parent d0dbf27 commit 73f4920
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Bus/Commands/Component/AddComponentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ final class AddComponentCommand
public $rules = [
'name' => 'required|string',
'description' => 'string',
'status' => 'int|min:1|max:4',
'status' => 'int|min:0|max:4',
'link' => 'url',
'order' => 'int',
'group_id' => 'int',
Expand Down
2 changes: 1 addition & 1 deletion app/Bus/Commands/Component/UpdateComponentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ final class UpdateComponentCommand
public $rules = [
'name' => 'string',
'description' => 'string',
'status' => 'int|min:1|max:4',
'status' => 'int|min:0|max:4',
'link' => 'url',
'order' => 'int',
'group_id' => 'int',
Expand Down
2 changes: 1 addition & 1 deletion app/Bus/Commands/Incident/ReportIncidentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ final class ReportIncidentCommand
'message' => 'string',
'visible' => 'bool',
'component_id' => 'int|required_with:component_status',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'component_status' => 'int|min:0|max:4|required_with:component_id',
'notify' => 'bool',
'stickied' => 'bool',
'incident_date' => 'string',
Expand Down
2 changes: 1 addition & 1 deletion app/Bus/Commands/Incident/UpdateIncidentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ final class UpdateIncidentCommand
'message' => 'string',
'visible' => 'bool',
'component_id' => 'int',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'component_status' => 'int|min:0|max:4|required_with:component_id',
'notify' => 'bool',
'stickied' => 'bool',
'template' => 'string',
Expand Down
1 change: 1 addition & 0 deletions app/Composers/ThemeComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function compose(View $view)
$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->withThemeGreys($this->config->get('setting.style_greys', '#888888'));
$view->withThemeMetrics($this->config->get('setting.style_metrics', '#0dccc0'));
$view->withThemeLinks($this->config->get('setting.style_links', '#7ED321'));
}
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/ComponentPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ComponentPresenter extends BasePresenter implements Arrayable
public function status_color()
{
switch ($this->wrappedObject->status) {
case 0: return 'greys';
case 1: return 'greens';
case 2: return 'blues';
case 3: return 'yellows';
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'components' => [
'last_updated' => 'Last updated :timestamp',
'status' => [
0 => 'Unknown',
1 => 'Operational',
2 => 'Performance Issues',
3 => 'Partial Outage',
Expand Down
1 change: 1 addition & 0 deletions resources/views/partials/stylesheet.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
.greens { color: {{ $theme_greens }} !important; }
.yellows { color: {{ $theme_yellows }} !important; }
.oranges { color: {{ $theme_oranges }} !important; }
.greys { color: {{ $theme_greys }} !important; }
.metrics { color: {{ $theme_metrics }} !important; }
.links { color: {{ $theme_links }} !important; }
Expand Down

0 comments on commit 73f4920

Please sign in to comment.