mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 05:28:18 +01:00
Fix validation of metric thresholds. Closes #3549
This commit is contained in:
parent
76e9f41e55
commit
2efbaebe63
@ -45,8 +45,7 @@ class MetricController extends Controller
|
||||
public function showAddMetric()
|
||||
{
|
||||
return View::make('dashboard.metrics.add')
|
||||
->withPageTitle(trans('dashboard.metrics.add.title').' - '.trans('dashboard.dashboard'))
|
||||
->withAcceptableThresholds(Metric::ACCEPTABLE_THRESHOLDS);
|
||||
->withPageTitle(trans('dashboard.metrics.add.title').' - '.trans('dashboard.dashboard'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,8 +131,7 @@ class MetricController extends Controller
|
||||
{
|
||||
return View::make('dashboard.metrics.edit')
|
||||
->withPageTitle(trans('dashboard.metrics.edit.title').' - '.trans('dashboard.dashboard'))
|
||||
->withMetric($metric)
|
||||
->withAcceptableThresholds(Metric::ACCEPTABLE_THRESHOLDS);
|
||||
->withMetric($metric);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -62,13 +62,6 @@ class Metric extends Model implements HasPresenter
|
||||
*/
|
||||
const VISIBLE_HIDDEN = 2;
|
||||
|
||||
/**
|
||||
* Array of acceptable threshold minutes.
|
||||
*
|
||||
* @var int[]
|
||||
*/
|
||||
const ACCEPTABLE_THRESHOLDS = [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60];
|
||||
|
||||
/**
|
||||
* The model's attributes.
|
||||
*
|
||||
@ -134,7 +127,6 @@ class Metric extends Model implements HasPresenter
|
||||
'default_value' => 'required|numeric',
|
||||
'places' => 'required|numeric|between:0,4',
|
||||
'default_view' => 'required|numeric|between:0,3',
|
||||
'threshold' => 'required|numeric|between:0,10',
|
||||
'visible' => 'required|numeric|between:0,2',
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user