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 24, 2016
1 parent 196eba7 commit b223da9
Show file tree
Hide file tree
Showing 8 changed files with 9 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' => 'required|string',
'status' => 'required|int|min:1|max:4',
'status' => 'required|int|min:0|max:4',
'link' => 'nullable|url',
'order' => 'nullable|int',
'group_id' => 'nullable|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' => 'nullable|string',
'description' => 'nullable|string',
'status' => 'nullable|int|min:1|max:4',
'status' => 'nullable|int|min:0|max:4',
'link' => 'nullable|url',
'order' => 'nullable|int',
'group_id' => 'nullable|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' => 'required|string',
'visible' => 'nullable|bool',
'component_id' => 'nullable|required_with:component_status|int',
'component_status' => 'nullable|required_with:component_id|int|min:1|max:4',
'component_status' => 'nullable|required_with:component_id|int|min:0|max:4',
'notify' => 'nullable|bool',
'stickied' => 'required|bool',
'incident_date' => 'nullable|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' => 'nullable|string',
'visible' => 'nullable|bool',
'component_id' => 'nullable|int',
'component_status' => 'nullable|int|min:1|max:4|required_with:component_id',
'component_status' => 'nullable|int|min:0|max:4|required_with:component_id',
'notify' => 'nullable|bool',
'stickied' => 'nullable|bool',
'template' => 'nullable|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
2 changes: 2 additions & 0 deletions app/Presenters/ComponentPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class ComponentPresenter extends BasePresenter implements Arrayable
public function status_color()
{
switch ($this->wrappedObject->status) {
case 0:
return 'greys';
case 1:
return 'greens';
case 2:
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 b223da9

Please sign in to comment.