FIX: Show 'Export' button for all tabular reports. (#7838)

This commit is contained in:
Bianca Nenciu 2019-07-03 15:47:36 +03:00 committed by Joffrey JAFFEUX
parent 426c8045de
commit bfdf740a05
3 changed files with 63 additions and 2 deletions

View File

@ -55,7 +55,6 @@ export default Ember.Component.extend({
showTitle: true,
showFilteringUI: false,
showDatesOptions: Ember.computed.alias("model.dates_filtering"),
showExport: Ember.computed.not("model.isTable"),
showRefresh: Ember.computed.or(
"showDatesOptions",
"model.available_filters.length"

View File

@ -164,7 +164,7 @@
</div>
{{/each}}
{{#if showExport}}
{{#if model.isTable}}
<div class="control">
<div class="input">
{{d-button

View File

@ -27,3 +27,65 @@ QUnit.test("Visit reports page", async assert => {
"List of my activities"
);
});
QUnit.test("Visit report page", async assert => {
// eslint-disable-next-line
server.get("/admin/reports/bulk", () => [
200,
{ "Content-Type": "application/json" },
{
reports: [
{
type: "staff_logins",
title: "Admin Logins",
xaxis: null,
yaxis: null,
description: "List of admin login times with locations.",
data: [
{
avatar_template:
"/letter_avatar_proxy/v4/letter/q/a4c791/{size}.png",
user_id: 4,
username: "codinghorror",
location: null,
created_at: "2019-06-10T00:00:00.000Z"
}
],
start_date: "2019-06-01T00:00:00Z",
end_date: "2019-07-01T23:59:59Z",
prev_data: null,
prev_start_date: "2019-04-30T00:00:00Z",
prev_end_date: "2019-06-01T00:00:00Z",
prev30Days: null,
dates_filtering: true,
report_key:
"reports:staff_logins:20190601:20190702:[:prev_period]:50:4",
primary_color: "rgba(0,136,204,1)",
secondary_color: "rgba(0,136,204,0.1)",
available_filters: [],
labels: [
{
type: "user",
properties: {
username: "username",
id: "user_id",
avatar: "avatar_template"
},
title: "User"
},
{ property: "location", title: "Location" },
{ property: "created_at", type: "precise_date", title: "Login at" }
],
average: false,
percent: false,
higher_is_better: true,
modes: ["table"],
limit: 50
}
]
}
]);
await visit("/admin/reports/staff_logins");
assert.ok(exists(".export-csv-btn"));
});