Skip to content
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 Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ gem 'redis', '>= 4.0.1'
gem 'sassc-rails'
gem "sentry-ruby"
gem "sentry-rails"
# Required when Sentry profiles_sample_rate is set (see config/initializers/sentry.rb)
gem 'stackprof'
gem 'skylight'
gem 'stimulus-rails'
gem 'turbo-rails'
Expand All @@ -40,6 +42,8 @@ group :development, :test do
gem 'pry-rails'
gem 'rails-controller-testing'
gem 'rspec-rails'
gem "rubocop", "~> 1.86"
gem "rubocop-rails"
gem 'simplecov'
gem 'webdrivers'
end
Expand Down
38 changes: 38 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ GEM
arbre (1.7.0)
activesupport (>= 3.0.0)
ruby2_keywords (>= 0.0.2)
ast (2.4.3)
base64 (0.3.0)
bcrypt (3.1.22)
benchmark (0.5.0)
Expand Down Expand Up @@ -187,6 +188,7 @@ GEM
thor (>= 0.14, < 2.0)
jsbundling-rails (1.3.1)
railties (>= 6.0.0)
json (2.19.3)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand All @@ -199,6 +201,7 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
language_server-protocol (3.17.0.5)
launchy (3.1.1)
addressable (~> 2.8)
childprocess (~> 5.0)
Expand All @@ -210,6 +213,7 @@ GEM
letter_opener (~> 1.9)
railties (>= 6.1)
rexml
lint_roller (1.1.0)
logger (1.7.0)
loofah (2.25.1)
crass (~> 1.0.2)
Expand Down Expand Up @@ -251,10 +255,15 @@ GEM
racc (~> 1.4)
orm_adapter (0.5.0)
ostruct (0.6.3)
parallel (1.28.0)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
pg (1.5.9)
pp (0.6.2)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -313,6 +322,7 @@ GEM
thor (~> 1.0, >= 1.2.2)
tsort (>= 0.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
ransack (4.4.1)
activerecord (>= 7.2)
Expand Down Expand Up @@ -349,6 +359,27 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.2)
rubocop (1.86.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-rails (2.34.3)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.4.1)
sassc (2.4.0)
Expand Down Expand Up @@ -385,6 +416,7 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
stackprof (0.2.28)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.5)
Expand All @@ -398,6 +430,9 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unaccent (0.4.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
useragent (0.16.11)
warden (1.2.9)
rack (>= 2.0.9)
Expand Down Expand Up @@ -452,11 +487,14 @@ DEPENDENCIES
rails-controller-testing
redis (>= 4.0.1)
rspec-rails
rubocop (~> 1.86)
rubocop-rails
sassc-rails
sentry-rails
sentry-ruby
simplecov
skylight
stackprof
stimulus-rails
turbo-rails
tzinfo-data
Expand Down
29 changes: 24 additions & 5 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
column do
current_year_applications_scope = Application.active_conference_applications
current_year_application_count = current_year_applications_scope.count
recent_applications = current_year_applications_scope.order(created_at: :desc).limit(25)
recent_applications =
current_year_applications_scope.order(created_at: :desc).limit(25)

panel "Latest 25 of #{current_year_application_count} Applications for the #{ApplicationSetting.get_current_app_year} conference" do
table_for recent_applications do
Expand Down Expand Up @@ -69,10 +70,28 @@

column do
panel "Recent Payments" do
table_for Payment.current_conference_payments.sort.reverse.first(10) do
recent_payments =
Payment.current_conference_payments
.order(created_at: :desc)
.limit(10)
.includes(:user)
.to_a
conf_year = ApplicationSetting.get_current_app_year
user_ids = recent_payments.map(&:user_id).uniq
current_app_by_user_id =
if user_ids.empty?
{}
else
Application.where(user_id: user_ids, conf_year: conf_year)
.order(:user_id, :id)
.group_by(&:user_id)
.transform_values(&:last)
end
table_for recent_payments do
column("Name") do |a|
if a.user.current_conf_application.present?
link_to a.user.current_conf_application.display_name, admin_application_path(a.user.current_conf_application)
app = current_app_by_user_id[a.user_id]
if app.present?
link_to app.display_name, admin_application_path(app)
else
"#{a.user.email} ( - waiting for application to be submitted)"
end
Expand Down Expand Up @@ -128,7 +147,7 @@
panel "Waiting for responses from these #{ApplicationSetting.get_current_app_year} applicants (#{offered_count})" do
applications =
if offered_applications.respond_to?(:sort)
offered_applications.sort.reverse
offered_applications.includes(:user).sort.reverse
else
Array(offered_applications).select { |app| app.respond_to?(:user) }
end
Expand Down
55 changes: 55 additions & 0 deletions app/admin/payment_gateway_callbacks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
ActiveAdmin.register PaymentGatewayCallback do
menu parent: 'User Management', priority: 2.5, label: 'Gateway callbacks'

actions :index, :show

config.sort_order = 'created_at_desc'

filter :transaction_id
filter :processing_status, as: :select, collection: PaymentGatewayCallback::PROCESSING_STATUSES
filter :event_type
filter :user
filter :payment
filter :created_at

index do
actions
column :id do |callback|
link_to callback.id, admin_payment_gateway_callback_path(callback)
end
column :transaction_id
column :processing_status
column :event_type
column :user
column :payment
column :failure_reason do |callback|
truncate(callback.failure_reason.to_s, length: 80)
end
column :created_at
end

show do
attributes_table do
row :id
row :transaction_id
row :processing_status
row :event_type
row :user do |callback|
if callback.user
link_to(callback.user.email, admin_user_path(callback.user))
end
end
row :payment do |callback|
if callback.payment
link_to("Payment ##{callback.payment.id}", admin_payment_path(callback.payment))
end
end
row :failure_reason
row :created_at
row :updated_at
row :payload do |callback|
pre JSON.pretty_generate(callback.payload.presence || {})
end
end
end
end
20 changes: 20 additions & 0 deletions app/admin/payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@
row :created_at
row :updated_at
end

panel 'Gateway callbacks' do
callbacks = payment.payment_gateway_callbacks.order(created_at: :desc)
if callbacks.any?
table_for callbacks do
column :id do |callback|
link_to(callback.id, admin_payment_gateway_callback_path(callback))
end
column :processing_status
column :transaction_id
column :failure_reason do |callback|
truncate(callback.failure_reason.to_s, length: 60)
end
column :created_at
end
else
para 'No gateway callback rows are linked to this payment. Callbacks are attached when a gateway receipt is successfully recorded for this row.'
end
end

active_admin_comments
end

Expand Down
Loading
Loading