mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 09:04:45 +08:00
FEATURE: Export any type of report supporting table mode. (#7662)
This commit is contained in:

committed by
Joffrey JAFFEUX

parent
847f2943e8
commit
b2eb0f4ad6
@ -17,6 +17,21 @@ class Report
|
||||
30
|
||||
end
|
||||
|
||||
def self.default_labels
|
||||
[
|
||||
{
|
||||
type: :date,
|
||||
property: :x,
|
||||
title: I18n.t("reports.default.labels.day")
|
||||
},
|
||||
{
|
||||
type: :number,
|
||||
property: :y,
|
||||
title: I18n.t("reports.default.labels.count")
|
||||
},
|
||||
]
|
||||
end
|
||||
|
||||
def initialize(type)
|
||||
@type = type
|
||||
@start_date ||= Report.default_days.days.ago.utc.beginning_of_day
|
||||
@ -102,18 +117,7 @@ class Report
|
||||
primary_color: self.primary_color,
|
||||
secondary_color: self.secondary_color,
|
||||
available_filters: self.available_filters.map { |k, v| { id: k }.merge(v) },
|
||||
labels: labels || [
|
||||
{
|
||||
type: :date,
|
||||
property: :x,
|
||||
title: I18n.t("reports.default.labels.day")
|
||||
},
|
||||
{
|
||||
type: :number,
|
||||
property: :y,
|
||||
title: I18n.t("reports.default.labels.count")
|
||||
},
|
||||
],
|
||||
labels: labels || Report.default_labels,
|
||||
average: self.average,
|
||||
percent: self.percent,
|
||||
higher_is_better: self.higher_is_better,
|
||||
|
Reference in New Issue
Block a user