'name' => $this->name,
'message' => $this->message,
'title' => $this->title,
- 'severity' => $this->level,
+ 'severity' => CRM_Utils_Check::severityMap($this->level, TRUE),
+ 'severity_id' => $this->level,
'is_visible' => (int) $this->isVisible(),
'icon' => $this->icon,
);
(function(angular, $, _) {
angular.module('statuspage').controller('statuspageStatusPage',
- function($scope, crmApi, crmStatus, statusData, statuspageSeverityList) {
+ function($scope, crmApi, crmStatus, statusData) {
function preprocessStatuses(apiData) {
_.each(apiData.values, function(status) {
- status.severity_id = status.severity;
- status.severity = statuspageSeverityList[status.severity];
if (status.hidden_until) {
var date = $.datepicker.parseDate('yy-mm-dd', status.hidden_until);
status.hidden_until = $.datepicker.formatDate(CRM.config.dateInputFormat, date);
angular.module('statuspage')
.filter('trusted', function($sce){ return $sce.trustAsHtml; })
- .service('statuspageSeverityList', function() {
- return ['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'];
- })
-
// Todo: abstract this into a generic crmUi directive?
.directive('statuspagePopupMenu', function($timeout) {
return {
);
$spec['severity'] = array(
'title' => 'Severity',
+ 'description' => 'Psr\Log\LogLevel string',
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'options' => array_combine(CRM_Utils_Check::$severityMap, CRM_Utils_Check::$severityMap),
+ );
+ $spec['severity_id'] = array(
+ 'title' => 'Severity ID',
'description' => 'Integer representation of Psr\Log\LogLevel',
'type' => CRM_Utils_Type::T_INT,
'options' => CRM_Utils_Check::$severityMap,
break;
}
}
- $this->assertEquals($testedCheck['severity'], '3', ' in line ' . __LINE__);
+ $this->assertEquals($testedCheck['severity_id'], '3', ' in line ' . __LINE__);
}
/**
}
/**
- * Items hushed through tomorrow shouldn't show up.
+ * Items hushed through tomorrow shouldn't show up.
*/
public function testSystemCheckHushFuture() {
$tomorrow = new DateTime('tomorrow');
}
/**
- * Items hushed through today should show up.
+ * Items hushed through today should show up.
*/
public function testSystemCheckHushToday() {
$today = new DateTime('today');
}
/**
- * Items hushed through yesterday should show up.
+ * Items hushed through yesterday should show up.
*/
public function testSystemCheckHushYesterday() {
$yesterday = new DateTime('yesterday');
}
/**
- * Items hushed above current severity should be hidden.
+ * Items hushed above current severity should be hidden.
*/
public function testSystemCheckHushAboveSeverity() {
$this->_params = array(
}
/**
- * Items hushed at current severity should be hidden.
+ * Items hushed at current severity should be hidden.
*/
public function testSystemCheckHushAtSeverity() {
$this->_params = array(
}
/**
- * Items hushed below current severity should be shown.
+ * Items hushed below current severity should be shown.
*/
public function testSystemCheckHushBelowSeverity() {
$this->_params = array(