FEATURE: initial implementation of generic filters for reports

This commit is contained in:
Joffrey JAFFEUX
2019-04-26 12:17:10 +02:00
committed by GitHub
parent 4b455e741e
commit bcca2b5d73
33 changed files with 361 additions and 314 deletions

View File

@ -4,6 +4,18 @@ acceptance("Dashboard", {
loggedIn: true,
settings: {
dashboard_general_tab_activity_metrics: "page_view_total_reqs"
},
site: {
groups: [
{
id: 88,
name: "tl1"
},
{
id: 89,
name: "tl2"
}
]
}
});
@ -86,3 +98,17 @@ QUnit.test("reports tab", async assert => {
"filter is case insensitive"
);
});
QUnit.test("report filters", async assert => {
await visit(
'/admin/reports/signups?end_date=2018-07-16&filters=%7B"group"%3A88%7D&start_date=2018-06-16'
);
const groupFilter = selectKit(".group-filter .combo-box");
assert.equal(
groupFilter.header().value(),
88,
"its set the value of the filter from the query params"
);
});

View File

@ -57,21 +57,20 @@ let signups = {
],
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::20180616:20180716::[:prev_period]:",
report_key:
'reports:signups:20180616:20180716:[:prev_period]:50:{"group":"88"}:4',
available_filters: [
{ id: "group", allow_any: false, choices: [], default: "88" }
],
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
};
@ -158,8 +157,6 @@ const page_view_total_reqs = {
prev_data: null,
prev_start_date: "2018-06-20T00:00:00Z",
prev_end_date: "2018-07-23T00:00:00Z",
category_id: null,
group_id: null,
prev30Days: 58110,
dates_filtering: true,
report_key: `reports:page_view_total_reqs:${startDate.format(
@ -169,12 +166,9 @@ const page_view_total_reqs = {
{ type: "date", property: "x", title: "Day" },
{ type: "number", property: "y", title: "Count" }
],
processing: false,
average: false,
percent: false,
higher_is_better: true,
category_filtering: false,
group_filtering: false,
modes: ["table", "chart"],
icon: "file",
total: 921672