Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
7bb266f
Bump rack from 3.1.18 to 3.1.20 in the bundler group across 1 directory
dependabot[bot] Feb 17, 2026
d2197c9
Bump minimatch in the npm_and_yarn group across 1 directory
dependabot[bot] Feb 25, 2026
4fd1dd6
Merge pull request #70 from lsa-mis/dependabot/bundler/bundler-153ca6…
rsmoke Mar 11, 2026
3d9eef6
Merge pull request #71 from lsa-mis/dependabot/npm_and_yarn/npm_and_y…
rsmoke Mar 11, 2026
9b1de9d
Bump nokogiri in the bundler group across 1 directory
dependabot[bot] Mar 11, 2026
485a666
Merge pull request #72 from lsa-mis/dependabot/bundler/bundler-6efc71…
rsmoke Mar 11, 2026
c590957
Bump immutable in the npm_and_yarn group across 1 directory
dependabot[bot] Mar 11, 2026
dff1b3a
Refactor payment activity display in ActiveAdmin for clarity and cons…
rsmoke Mar 11, 2026
9843d6a
Refactor ActiveAdmin payment parameters and filters for improved clar…
rsmoke Mar 11, 2026
754adc1
Add filters for user email, first name, and last name in ActiveAdmin …
rsmoke Mar 11, 2026
a199c08
Remove user_id filter from ActiveAdmin applications for improved clar…
rsmoke Mar 11, 2026
b3c7945
Enhance ActiveAdmin filters for payments and applications. Added filt…
rsmoke Mar 11, 2026
40382d2
Remove commented-out user_id filter from ActiveAdmin payments for imp…
rsmoke Mar 11, 2026
bffbc2a
Merge pull request #74 from lsa-mis/fix_manual_payment_link
rsmoke Mar 11, 2026
cd736cf
Merge pull request #73 from lsa-mis/dependabot/npm_and_yarn/npm_and_y…
rsmoke Mar 11, 2026
414a417
Update ActiveAdmin application filters to use correct associations fo…
rsmoke Mar 11, 2026
6405c1c
Update app/admin/payments.rb
rsmoke Mar 11, 2026
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
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,18 @@ GEM
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4)
nokogiri (1.18.9)
nokogiri (1.19.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.9-aarch64-linux-gnu)
nokogiri (1.19.1-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-arm-linux-gnu)
nokogiri (1.19.1-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.9-arm64-darwin)
nokogiri (1.19.1-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-darwin)
nokogiri (1.19.1-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-gnu)
nokogiri (1.19.1-x86_64-linux-gnu)
racc (~> 1.4)
orm_adapter (0.5.0)
pg (1.5.9)
Expand All @@ -266,7 +266,7 @@ GEM
puma (6.6.0)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.1.18)
rack (3.1.20)
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
Expand Down
14 changes: 11 additions & 3 deletions app/admin/applications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
button_to "Send Offer", send_offer_path(application) if application.offer_status == "not_offered"
end

filter :user_id, label: "User", as: :select, collection: -> { Application.all.map { |app| [app.display_name, app.user_id]}.uniq.sort}
filter :user_email, as: :select,
collection: -> { User.joins(:applications).distinct.order(:email).pluck(:email) },
label: "User Email"
filter :last_name, as: :select,
collection: -> { Application.distinct.order(:last_name).pluck(:last_name) },
label: "Last Name"
filter :first_name, as: :select,
collection: -> { Application.distinct.order(:first_name).pluck(:first_name) },
label: "First Name"
filter :offer_status, as: :select
filter :result_email_sent, as: :select
filter :workshop_selection1, label: "workshop_selection1", as: :select, collection: -> { Workshop.all.map { |mapp| [mapp.instructor, mapp.instructor]}.sort }
Expand Down Expand Up @@ -81,14 +89,14 @@ def load_index_batch_data
total_cost = cost_lodging + cost_partner
balance_due = total_cost - ttl_paid
panel "Payment Activity -- [Balance Due: #{number_to_currency(balance_due)} Total Cost: #{number_to_currency(total_cost)}]" do
table_for application.user.payments.where(conf_year: application.conf_year) do #application.user.payments.current_conference_payments
table_for application.user.payments.where(conf_year: application.conf_year) do
column(:id) { |aid| link_to(aid.id, admin_payment_path(aid.id)) }
column(:account_type) { |atype| atype.account_type.titleize }
column(:transaction_type)
column(:transaction_date) {|td| Date.parse(td.transaction_date) }
column(:total_amount) { |ta| number_to_currency(ta.total_amount.to_f / 100) }
end
text_node link_to("[Add Manual Payment]", new_admin_payment_path(:user_id => application))
text_node link_to("[Add Manual Payment]", new_admin_payment_path(user_id: application.user_id))
end


Expand Down
49 changes: 16 additions & 33 deletions app/admin/payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,25 @@
action_item :delete_manual_payment, only: :show do
link_to('Delete Manual Payment', delete_manual_payment_path(payment), method: :post, data: { confirm: 'Are you sure?' }) if payment.transaction_type == "ManuallyEntered"
end
menu parent: "User Mangement", priority: 2
menu parent: "User Management", priority: 2

# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# Uncomment all parameters which should be permitted for assignment
#
permit_params :transaction_type, :transaction_status, :transaction_id, :total_amount, :transaction_date, :account_type, :result_code, :result_message, :user_account, :payer_identity, :timestamp, :transaction_hash, :user_id, :conf_year
#
# or
#
# permit_params do
# permitted = [:transaction_type, :transaction_status, :transaction_id, :total_amount, :transaction_date, :account_type, :result_code, :result_message, :user_account, :payer_identity, :timestamp, :transaction_hash, :user_id]
# permitted << :other if params[:action] == 'create' && current_user.admin?
# permitted
# end

# filter :user, as: :select, collection: -> { User.all.order(:email) }
# filter user.current_application, label: "Last Name (Starts with)"
# filter :application_first_name_start, label: "First Name (Starts with)"

scope :current_conference_payments
scope :all

filter :user_id, as: :select,
# collection: -> { User.all.order(:email) },
collection: -> { Application.all.order(:last_name).map { |app| [app.display_name, app.user_id] } },
label: "Name"
filter :conf_year, as: :select

filter :payer_identity, as: :select,
collection: -> { Payment.order(:payer_identity).distinct.pluck(:payer_identity) },
label: "User Email"
filter :user_applications_last_name, as: :select,
collection: -> { Application.joins(user: :payments).distinct.order(:last_name).pluck(:last_name) },
label: "Last Name"
filter :user_applications_first_name, as: :select,
collection: -> { Application.joins(user: :payments).distinct.order(:first_name).pluck(:first_name) },
label: "First Name"
filter :payments_conf_year, as: :select,
collection: -> { Payment.order(:conf_year).distinct.pluck(:conf_year) },
label: "Payment Conf Year"

index do
selectable_column
Expand All @@ -47,23 +36,17 @@
number_to_currency(amount.total_amount.to_f / 100)
end
column :transaction_status
# column :transaction_id

column :transaction_date
column :account_type
column :result_code
column :result_message
# column :user_account
# column :payer_identity
# column :timestamp
# column :transaction_hash
column :created_at
column :updated_at
end

show do
attributes_table do
row :user do |user|
row :user do |user|
if (app = payment.user.applications.find_by(conf_year: ApplicationSetting.get_current_app_year))
link_to(app.display_name, admin_application_path(app))
else
Expand Down Expand Up @@ -100,7 +83,7 @@
li "<strong>User: #{User.find(params[:user_id]).display_name}</strong>".html_safe
f.input :user_id, input_html: {value: params[:user_id]}, as: :hidden
else
f.input :user, as: :select, :collection => User.all.map { |u| ["#{u.email}", u.id] }.sort # Application.active_conference_applications.map { |a| ["#{a.display_name}", a.user_id] }.sort
f.input :user, as: :select, :collection => User.all.map { |u| ["#{u.email}", u.id] }.sort
end
li "Conf Year #{f.object.conf_year}" unless f.object.new_record?
f.input :conf_year, input_html: {value: ApplicationSetting.get_current_app_year} unless f.object.persisted?
Expand All @@ -112,7 +95,7 @@
f.input :account_type, collection: ['scholarship', 'special', 'other']
f.input :result_code, as: :hidden, :input_html => { value: "Manually Entered" } # 'Manually Entered'
f.input :result_message, as: :hidden, :input_html => { value: "This was manually entered by #{current_admin_user.email}" }
f.input :timestamp, as: :hidden, :input_html => { value: DateTime.now.strftime("%Q").to_i } # DateTime.now.strftime("%Q").to_i
f.input :timestamp, as: :hidden, :input_html => { value: DateTime.now.strftime("%Q").to_i }
end
f.actions
end
Expand Down
8 changes: 7 additions & 1 deletion app/models/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ def self.ransackable_associations(auth_object = nil)
end

def self.ransackable_attributes(auth_object = nil)
["account_type", "conf_year", "created_at", "id", "id_value", "payer_identity", "result_code", "result_message", "timestamp", "total_amount", "transaction_date", "transaction_hash", "transaction_id", "transaction_status", "transaction_type", "updated_at", "user_account", "user_id"]
["account_type", "conf_year", "created_at", "id", "id_value", "payer_identity", "payments_conf_year", "result_code", "result_message", "timestamp", "total_amount", "transaction_date", "transaction_hash", "transaction_id", "transaction_status", "transaction_type", "updated_at", "user_account", "user_id"]
end

# Disambiguate conf_year when joining associated tables in Ransack searches.
# This forces the filter to reference the payments table explicitly.
ransacker :payments_conf_year do |parent|
parent.table[:conf_year]
end


Expand Down
2 changes: 1 addition & 1 deletion spec/models/payment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
it 'returns the correct attributes' do
expected_attributes = [
"account_type", "conf_year", "created_at", "id", "id_value",
"payer_identity", "result_code", "result_message", "timestamp",
"payer_identity", "payments_conf_year", "result_code", "result_message", "timestamp",
"total_amount", "transaction_date", "transaction_hash",
"transaction_id", "transaction_status", "transaction_type",
"updated_at", "user_account", "user_id"
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ ignore@^5.2.4:
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==

immutable@^4.0.0:
version "4.3.5"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.5.tgz#f8b436e66d59f99760dc577f5c99a4fd2a5cc5a0"
integrity sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==
version "4.3.8"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.8.tgz#02d183c7727fb2bb1d5d0380da0d779dce9296a7"
integrity sha512-d/Ld9aLbKpNwyl0KiM2CT1WYvkitQ1TSvmRtkcV8FKStiDoA7Slzgjmb/1G2yhKM1p0XeNOieaTbFZmU1d3Xuw==

is-binary-path@~2.1.0:
version "2.1.0"
Expand Down Expand Up @@ -529,9 +529,9 @@ micromatch@^4.0.4:
picomatch "^2.3.1"

minimatch@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
version "3.1.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.4.tgz#89d910ea3970a77ac8edfd30340ccd038b758079"
integrity sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==
dependencies:
brace-expansion "^1.1.7"

Expand Down
Loading