From 65b90ed799008067a6003450feda6f52ea5e438f Mon Sep 17 00:00:00 2001 From: Luke Oldenburg <87272260+Luke-Oldenburg@users.noreply.github.com> Date: Thu, 1 Oct 2026 06:11:54 +0000 Subject: [PATCH] [Views] Pass comment, receipt form and HCB code history ivars to partials as strict locals comments/_form and _comments (and the partials that render the form), receipts/_form_v3 (ledger_instance), hcb_codes/_admin_tools, _transaction_history and _pending_transaction_history, and reimbursement/reports/_actions, _conversation and _edit_form. The three receipt_upload_form_config hashes, ReceiptsController's error stream and the reimbursement actions streams pass the new locals too. Co-Authored-By: Claude Opus 5.5 (1M context) --- app/controllers/receipts_controller.rb | 7 +++-- .../reimbursement/expenses_controller.rb | 2 +- .../admin/ledger_audits/tasks/show.html.erb | 2 +- app/views/admin/transaction.html.erb | 2 +- .../show.html.erb | 4 +-- app/views/card_grants/show.html.erb | 2 +- app/views/comments/_comments.html.erb | 6 ++-- app/views/comments/_form.html.erb | 12 ++++---- app/views/comments/edit.html.erb | 2 +- app/views/comments/new.html.erb | 2 +- app/views/disbursements/show.html.erb | 4 +-- app/views/events/edit.html.erb | 2 +- app/views/events/settings/_admin.html.erb | 8 ++--- app/views/hcb_codes/_admin_tools.html.erb | 18 +++++------ .../_pending_transaction_history.html.erb | 6 ++-- .../hcb_codes/_transaction_history.html.erb | 6 ++-- app/views/hcb_codes/attach_receipt.html.erb | 2 +- app/views/hcb_codes/show.html.erb | 11 +++---- app/views/ledger/items/show.html.erb | 5 ++-- app/views/my/inbox.html.erb | 2 +- .../show.html.erb | 2 +- app/views/payments/show.html.erb | 4 +-- app/views/receipts/_form_v3.html.erb | 8 ++--- .../reimbursement/reports/_actions.html.erb | 4 +-- .../reports/_conversation.html.erb | 30 +++++++++---------- .../reimbursement/reports/_edit_form.html.erb | 28 ++++++++--------- app/views/reimbursement/reports/edit.html.erb | 2 +- app/views/reimbursement/reports/show.html.erb | 6 ++-- app/views/transactions/show.html.erb | 4 +-- app/views/users/edit_admin.html.erb | 2 +- 30 files changed, 99 insertions(+), 96 deletions(-) diff --git a/app/controllers/receipts_controller.rb b/app/controllers/receipts_controller.rb index becb3e5e17..cc3c73153b 100644 --- a/app/controllers/receipts_controller.rb +++ b/app/controllers/receipts_controller.rb @@ -140,7 +140,8 @@ def create include_spacing: params[:upload_method] != :receipt_center, success: "#{"Receipt".pluralize(params[file_param].length)} added!", global_paste: !@receiptable, - turbo: true + turbo: true, + ledger_instance: @ledger_instance } if @receiptable receipt_upload_form_config[:enable_linking] = true @@ -178,7 +179,7 @@ def create partial: "receipts/form_v3", locals: { upload_method: "receipt_center", restricted_dropzone: true, - error: e.message + error: e.message, ledger_instance: @ledger_instance } ) ) @@ -309,7 +310,7 @@ def generate_streams turbo_stream.replace( "action-wrapper", partial: "reimbursement/reports/actions", - locals: { report: @receiptable.report, user: @receiptable.report.user } + locals: { report: @receiptable.report, user: @receiptable.report.user, event: @event } ) ) end diff --git a/app/controllers/reimbursement/expenses_controller.rb b/app/controllers/reimbursement/expenses_controller.rb index a5c4b8997d..fc49fcba00 100644 --- a/app/controllers/reimbursement/expenses_controller.rb +++ b/app/controllers/reimbursement/expenses_controller.rb @@ -120,7 +120,7 @@ def blankslate_turbo_stream end def actions_turbo_stream - turbo_stream.replace("action-wrapper", partial: "reimbursement/reports/actions", locals: { report: @expense.report, user: @expense.report.user }) + turbo_stream.replace("action-wrapper", partial: "reimbursement/reports/actions", locals: { report: @expense.report, user: @expense.report.user, event: @event }) end EXPENSE_TYPE_MAP = [Reimbursement::Expense, Reimbursement::Expense::Mileage, Reimbursement::Expense::Fee].index_by(&:to_s).freeze diff --git a/app/views/admin/ledger_audits/tasks/show.html.erb b/app/views/admin/ledger_audits/tasks/show.html.erb index 313d316548..9ce403a467 100644 --- a/app/views/admin/ledger_audits/tasks/show.html.erb +++ b/app/views/admin/ledger_audits/tasks/show.html.erb @@ -133,7 +133,7 @@

HCB Code Comments

<%= render "comments/list", comments: @hcb_code.comments %> - <%= render "comments/form", commentable: @hcb_code %> + <%= render "comments/form", commentable: @hcb_code, comment: @comment, popover: @popover %>