Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Analytics::FileDownload and Lotteries::EntrantServiceDetail to madmin #1347

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/controllers/madmin/analytics/file_downloads_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Madmin
class Analytics::FileDownloadsController < Madmin::ResourceController
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Madmin
class Lotteries::EntrantServiceDetailsController < Madmin::ResourceController
end
end
27 changes: 27 additions & 0 deletions app/madmin/resources/analytics/file_download_resource.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Analytics::FileDownloadResource < Madmin::Resource
# Attributes
attribute :id, form: false
attribute :name
attribute :filename
attribute :byte_size
attribute :created_at, form: false
attribute :updated_at, form: false

# Associations
attribute :user
attribute :record

# Uncomment this to customize the display name of records in the admin area.
# def self.display_name(record)
# record.name
# end

# Uncomment this to customize the default sort column and direction.
# def self.default_sort_column
# "created_at"
# end
#
# def self.default_sort_direction
# "desc"
# end
end
28 changes: 28 additions & 0 deletions app/madmin/resources/lotteries/entrant_service_detail_resource.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Lotteries::EntrantServiceDetailResource < Madmin::Resource
# Attributes
attribute :lottery_entrant_id
attribute :form_accepted_at
attribute :form_rejected_at
attribute :form_accepted_comments
attribute :form_rejected_comments
attribute :created_at, form: false
attribute :updated_at, form: false
attribute :completed_form, index: false

# Associations
attribute :entrant

# Uncomment this to customize the display name of records in the admin area.
# def self.display_name(record)
# record.name
# end

# Uncomment this to customize the default sort column and direction.
# def self.default_sort_column
# "created_at"
# end
#
# def self.default_sort_direction
# "desc"
# end
end
4 changes: 4 additions & 0 deletions config/routes/madmin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Below are the routes for madmin
namespace :madmin do
namespace :lotteries do
resources :entrant_service_details
end
resources :historical_facts
namespace :analytics do
resources :file_downloads
resources :sendgrid_events
end
resources :connections
Expand Down
Loading