Sha256: e3f9a49a1f6d9cf170c4b536a2b9104e8e5ef817f784584ad9a9009c09d543f9

Contents?: true

Size: 1.4 KB

Versions: 34

Compression:

Stored size: 1.4 KB

Contents

module Workarea
  class Admin::DashboardsController < Admin::ApplicationController
    def index
      @dashboard = Admin::Dashboards::IndexViewModel.wrap(nil, view_model_options)
      @activity = Admin::ActivityViewModel.new(nil, view_model_options)
    end

    def store
      @dashboard = Admin::Dashboards::StoreViewModel.wrap(nil, view_model_options)
    end

    def search
      @dashboard = Admin::Dashboards::SearchViewModel.wrap(nil, view_model_options)
    end

    def catalog
      @dashboard = Admin::Dashboards::CatalogViewModel.wrap(nil, view_model_options)
    end

    def orders
      @dashboard = Admin::Dashboards::OrdersViewModel.wrap(nil, view_model_options)
    end

    def people
      @dashboard = Admin::Dashboards::PeopleViewModel.wrap(nil, view_model_options)
    end

    def marketing
      @dashboard = Admin::Dashboards::MarketingViewModel.wrap(nil, view_model_options)
    end

    def reports
      @dashboard = Admin::Dashboards::ReportsViewModel.wrap(nil, view_model_options)
    end

    def settings
      configuration = Workarea.config.merge(
        time_zone: Rails.application.config.time_zone
      )

      @settings = configuration.reject do |key, _value|
        Workarea.config.hide_from_settings.include?(key)
      end
    end

    # Override to provide permissions per-dashboard
    def required_permissions
      params[:action] unless params[:action] == 'index'
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-admin-3.4.45 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.44 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.43 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.42 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.41 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.40 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.39 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.38 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.37 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.36 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.35 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.34 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.33 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.32 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.31 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.30 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.29 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.28 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.27 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.4.26 app/controllers/workarea/admin/dashboards_controller.rb