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
+11 -1
View File
@@ -83,6 +83,13 @@ final class AddMetricCommand
*/
public $order;
/**
* The visibility of the metric.
*
* @var int
*/
public $visible;
/**
* The validation rules.
*
@@ -100,6 +107,7 @@ final class AddMetricCommand
'default_view' => 'required|int|between:0,3',
'threshold' => 'nullable|numeric|between:0,10',
'order' => 'nullable|int',
'visible' => 'required|int|between:0,2',
];
/**
@@ -115,10 +123,11 @@ final class AddMetricCommand
* @param int $default_view
* @param int $threshold
* @param int $order
* @param int $visible
*
* @return void
*/
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = 0)
public function __construct($name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = 0, $visible = 1)
{
$this->name = $name;
$this->suffix = $suffix;
@@ -130,5 +139,6 @@ final class AddMetricCommand
$this->default_view = $default_view;
$this->threshold = $threshold;
$this->order = $order;
$this->visible = $visible;
}
}
@@ -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;
}
}