chore(manager): basic dashboard for EmailEvents

This commit is contained in:
Colin Darie 2023-01-09 17:36:26 +01:00
parent 0a22c1d2f0
commit 22e2749357
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,4 @@
module Manager
class EmailEventsController < Manager::ApplicationController
end
end

View 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

View file

@ -65,6 +65,8 @@ Rails.application.routes.draw do
resources :team_accounts, only: [:index, :show]
resources :email_events, only: [:index, :show]
resources :dubious_procedures, only: [:index]
resources :outdated_procedures, only: [:index] do
patch :bulk_update, on: :collection