chore(manager): basic dashboard for EmailEvents
This commit is contained in:
parent
0a22c1d2f0
commit
22e2749357
3 changed files with 24 additions and 0 deletions
4
app/controllers/manager/email_events_controller.rb
Normal file
4
app/controllers/manager/email_events_controller.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
module Manager
|
||||||
|
class EmailEventsController < Manager::ApplicationController
|
||||||
|
end
|
||||||
|
end
|
18
app/dashboards/email_event_dashboard.rb
Normal file
18
app/dashboards/email_event_dashboard.rb
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
require "administrate/base_dashboard"
|
||||||
|
|
||||||
|
class EmailEventDashboard < Administrate::BaseDashboard
|
||||||
|
ATTRIBUTE_TYPES = {
|
||||||
|
id: Field::Number,
|
||||||
|
to: Field::String,
|
||||||
|
subject: Field::String,
|
||||||
|
method: Field::Enum,
|
||||||
|
status: Field::Enum,
|
||||||
|
processed_at: Field::DateTime.with_options(format: "%F %T")
|
||||||
|
}
|
||||||
|
COLLECTION_ATTRIBUTES = [:id, :to, :subject, :method, :status, :processed_at].freeze
|
||||||
|
SHOW_PAGE_ATTRIBUTES = [:id, :to, :subject, :method, :status, :processed_at].freeze
|
||||||
|
COLLECTION_FILTERS = {
|
||||||
|
dispatched: -> (resources) { resources.dispatched },
|
||||||
|
dispatch_error: -> (resources) { resources.dispatch_error }
|
||||||
|
}.freeze
|
||||||
|
end
|
|
@ -65,6 +65,8 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
resources :team_accounts, only: [:index, :show]
|
resources :team_accounts, only: [:index, :show]
|
||||||
|
|
||||||
|
resources :email_events, only: [:index, :show]
|
||||||
|
|
||||||
resources :dubious_procedures, only: [:index]
|
resources :dubious_procedures, only: [:index]
|
||||||
resources :outdated_procedures, only: [:index] do
|
resources :outdated_procedures, only: [:index] do
|
||||||
patch :bulk_update, on: :collection
|
patch :bulk_update, on: :collection
|
||||||
|
|
Loading…
Reference in a new issue