Sha256: a002d2bc3e0907dfbbf5107295e7c5bba72da0c11174e6d3b907c44e49a718e3

Contents?: true

Size: 845 Bytes

Versions: 13

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    class DashboardMetricChartsPresenter < Decidim::MetricChartsPresenter
      def summary?
        __getobj__.fetch(:summary)
      end

      def highlighted_metrics
        return super unless summary?

        Decidim.metrics_registry.filtered(
          highlight: true,
          scope: "home"
        ).select do |registry|
          %w(users proposals).include? registry.metric_name
        end
      end

      def not_highlighted_metrics
        return super unless summary?

        Decidim.metrics_registry.filtered(
          highlight: false,
          scope: "home"
        ).select do |registry|
          %w(comments meetings accepted_proposals results blocked_users user_reports reported_users).include? registry.metric_name
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.28.4 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.29.0 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.28.3 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.29.0.rc4 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.29.0.rc3 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.29.0.rc2 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.29.0.rc1 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.28.2 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.28.1 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.28.0 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.28.0.rc5 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb
decidim-admin-0.28.0.rc4 app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb