mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 14:23:39 +08:00
FIX: Show 'Export' button for all tabular reports. (#7838)
This commit is contained in:
parent
426c8045de
commit
bfdf740a05
|
@ -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"
|
||||
|
|
|
@ -164,7 +164,7 @@
|
|||
</div>
|
||||
{{/each}}
|
||||
|
||||
{{#if showExport}}
|
||||
{{#if model.isTable}}
|
||||
<div class="control">
|
||||
<div class="input">
|
||||
{{d-button
|
||||
|
|
|
@ -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"));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user