Sha256: 4acd72b0ceab3fb8db35b8f6226b8a184a17613ac13b9752bda5dca871c804bf

Contents?: true

Size: 1.46 KB

Versions: 28

Compression:

Stored size: 1.46 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

      @configuration = Configuration::Admin.instance
    end

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-admin-3.5.6 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.5.5 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.5.4 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.5.3 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.5.2 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.5.1 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.5.0 app/controllers/workarea/admin/dashboards_controller.rb
workarea-admin-3.5.0.beta.1 app/controllers/workarea/admin/dashboards_controller.rb