FIX: makes dashboard more resilient to errors (#6217)

This commit is an attempt to limit cases where the dashboard will generate a full exception page and also make it easier to track the error.
This commit is contained in:
Joffrey JAFFEUX
2018-07-31 21:23:28 -04:00
committed by GitHub
parent 7d8286e7ad
commit 2b2a506a7b
12 changed files with 135 additions and 76 deletions

View File

@ -112,7 +112,7 @@ componentTest("timeout", {
template: "{{admin-report dataSourceName='signups_timeout'}}",
test(assert) {
assert.ok(exists(".alert-error"), "it displays a timeout error");
assert.ok(exists(".alert-error.timeout"), "it displays a timeout error");
}
});
@ -120,6 +120,14 @@ componentTest("no data", {
template: "{{admin-report dataSourceName='posts'}}",
test(assert) {
assert.ok(exists(".no-data-alert"), "it displays a no data alert");
assert.ok(exists(".no-data"), "it displays a no data alert");
}
});
componentTest("exception", {
template: "{{admin-report dataSourceName='signups_exception'}}",
test(assert) {
assert.ok(exists(".alert-error.exception"), "it displays an error");
}
});

View File

@ -0,0 +1,11 @@
import signups from "fixtures/signups";
const signupsExceptionKey = "/admin/reports/signups_exception";
const signupsKey = "/admin/reports/signups";
let fixture = {};
fixture[signupsExceptionKey] = JSON.parse(JSON.stringify(signups[signupsKey]));
fixture[signupsExceptionKey].report.error = "exception";
export default fixture;

View File

@ -1,35 +1,11 @@
export default {
"/admin/reports/signups_timeout": {
report: {
type: "signups",
title: "Signups",
xaxis: "Day",
yaxis: "Number of signups",
description: "New account registrations for this period",
data: null,
start_date: "2018-06-16T00:00:00Z",
end_date: "2018-07-16T23:59:59Z",
prev_data: null,
prev_start_date: "2018-05-17T00:00:00Z",
prev_end_date: "2018-06-17T00:00:00Z",
category_id: null,
group_id: null,
prev30Days: null,
dates_filtering: true,
report_key: "reports:signups_timeout::20180616:20180716::[:prev_period]:",
labels: [
{ type: "date", properties: ["x"], title: "Day" },
{ type: "number", properties: ["y"], title: "Count" }
],
processing: false,
average: false,
percent: false,
higher_is_better: true,
category_filtering: false,
group_filtering: true,
modes: ["table", "chart"],
prev_period: 961,
timeout: true
}
}
};
import signups from "fixtures/signups";
const signupsTimeoutKey = "/admin/reports/signups_timeout";
const signupsKey = "/admin/reports/signups";
let fixture = {};
fixture[signupsTimeoutKey] = JSON.parse(JSON.stringify(signups[signupsKey]));
fixture[signupsTimeoutKey].report.error = "timeout";
export default fixture;