Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `app/controllers/admin/dashboard_controller.rb`:
  Upstream completely redesigned the admin dashboard.
  glitch-soc tracked extra features, but that list is
  gone.
  Followed upstram.
- `app/views/admin/dashboard/index.html.haml`
  Upstream completely redesigned the admin dashboard.
  glitch-soc tracked extra features, but that list is
  gone.
  Followed upstram.
This commit is contained in:
Claire
2021-10-14 20:55:16 +02:00
52 changed files with 1690 additions and 290 deletions

View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
class REST::Admin::CohortSerializer < ActiveModel::Serializer
attributes :period, :frequency
class CohortDataSerializer < ActiveModel::Serializer
attributes :date, :percent, :value
def date
object.date.iso8601
end
end
has_many :data, serializer: CohortDataSerializer
def period
object.period.iso8601
end
end

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
class REST::Admin::DimensionSerializer < ActiveModel::Serializer
attributes :key, :data
end

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class REST::Admin::MeasureSerializer < ActiveModel::Serializer
attributes :key, :total, :previous_total, :data
def total
object.total.to_s
end
def previous_total
object.previous_total.to_s
end
end

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class REST::Admin::TagSerializer < REST::TagSerializer
attributes :id, :trendable, :usable, :requires_review
def id
object.id.to_s
end
def requires_review
object.requires_review?
end
end