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

View File

@@ -86,7 +86,8 @@ class MetricController extends AbstractApiController
Binput::get('places', 2),
Binput::get('default_view', Binput::get('view', 1)),
Binput::get('threshold', 5),
Binput::get('order', 0)
Binput::get('order', 0),
Binput::get('visible', 1)
));
} catch (QueryException $e) {
throw new BadRequestHttpException();
@@ -116,7 +117,8 @@ class MetricController extends AbstractApiController
Binput::get('places'),
Binput::get('default_view', Binput::get('view')),
Binput::get('threshold'),
Binput::get('order')
Binput::get('order'),
Binput::get('visible')
));
} catch (QueryException $e) {
throw new BadRequestHttpException();

View File

@@ -79,7 +79,9 @@ class MetricController extends Controller
$metricData['display_chart'],
$metricData['places'],
$metricData['default_view'],
$metricData['threshold']
$metricData['threshold'],
0, // Default order
$metricData['visible']
));
} catch (ValidationException $e) {
return cachet_redirect('dashboard.metrics.create')
@@ -152,7 +154,9 @@ class MetricController extends Controller
Binput::get('display_chart', null, false),
Binput::get('places', null, false),
Binput::get('default_view', null, false),
Binput::get('threshold', null, false)
Binput::get('threshold', null, false),
null,
Binput::get('visible', null, false)
));
} catch (ValidationException $e) {
return cachet_redirect('dashboard.metrics.edit', [$metric->id])