Added metric visibility options. Closes #2244

This commit is contained in:
James Brooks
2016-12-04 16:54:36 +00:00
parent 984d132902
commit 105cff50b9
14 changed files with 189 additions and 26 deletions
@@ -92,6 +92,13 @@ final class UpdateMetricCommand
*/
public $order;
/**
* The visibility of the metric.
*
* @var int
*/
public $visible;
/**
* The validation rules.
*
@@ -109,6 +116,7 @@ final class UpdateMetricCommand
'default_view' => 'nullable|numeric|between:0,4',
'threshold' => 'nullable|numeric|between:0,10',
'order' => 'nullable|int',
'visible' => 'required|int|between:0,2',
];
/**
@@ -125,10 +133,11 @@ final class UpdateMetricCommand
* @param int $default_view
* @param int $threshold
* @param int|null $order
* @param int $visible
*
* @return void
*/
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = null)
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = null, $visible = null)
{
$this->metric = $metric;
$this->name = $name;
@@ -141,5 +150,6 @@ final class UpdateMetricCommand
$this->default_view = $default_view;
$this->threshold = $threshold;
$this->order = $order;
$this->visible = $visible;
}
}