A platform for community discussion. Free, open, simple.
FIX: Show 'Export' button for all tabular reports. (#7838)
Bianca Nenciubfdf740a0538
diff --git a/app/assets/javascripts/admin/components/admin-report.js.es6 b/app/assets/javascripts/admin/components/admin-report.js.es6index 15f7a6eb751..97a82c69876 100644--- a/app/assets/javascripts/admin/components/admin-report.js.es6+++ b/app/assets/javascripts/admin/components/admin-report.js.es6@@ -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"diff --git a/app/assets/javascripts/admin/templates/components/admin-report.hbs b/app/assets/javascripts/admin/templates/components/admin-report.hbsindex 7181ac3dd11..a23223d2bba 100644--- a/app/assets/javascripts/admin/templates/components/admin-report.hbs+++ b/app/assets/javascripts/admin/templates/components/admin-report.hbs@@ -164,7 +164,7 @@</div>{{/each}}- {{#if showExport}}+ {{#if model.isTable}}<div class="control"><div class="input">{{d-buttondiff --git a/test/javascripts/acceptance/reports-test.js.es6 b/test/javascripts/acceptance/reports-test.js.es6index 76bb6fa746d..0742116e580 100644--- a/test/javascripts/acceptance/reports-test.js.es6+++ b/test/javascripts/acceptance/reports-test.js.es6@@ -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"));+});