mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 15:15:01 +00:00
* fix: enable and persist notes on split child transactions (#1535) * fix: enable tags on split child transactions and new tests for split child notes + tags * Update app/components/DS/dialog_controller.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xing Hong <39619359+xingxing21@users.noreply.github.com> * fix(transactions): only stream notes frame when notes params are submitted * fix(transactions): address PR review issues in notes stream and tests --------- Signed-off-by: Xing Hong <39619359+xingxing21@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -134,6 +134,8 @@ class TransactionsController < ApplicationController
|
||||
@entry.transaction.lock_attr!(:tag_ids) if @entry.transaction.tags.any?
|
||||
@entry.sync_account_later
|
||||
|
||||
notes_changed = @entry.saved_change_to_notes?
|
||||
|
||||
# Reload to ensure fresh state for turbo stream rendering
|
||||
@entry.reload
|
||||
|
||||
@@ -151,9 +153,14 @@ class TransactionsController < ApplicationController
|
||||
partial: "entries/protection_indicator",
|
||||
locals: { entry: @entry, unlock_path: unlock_transaction_path(@entry.transaction) }
|
||||
),
|
||||
(turbo_stream.replace(
|
||||
dom_id(@entry, :notes),
|
||||
partial: "transactions/notes",
|
||||
locals: { entry: @entry, can_annotate: can_annotate_entry? }
|
||||
) if params[:entry]&.key?(:notes) && notes_changed),
|
||||
turbo_stream.replace(@entry),
|
||||
*flash_notification_stream_items
|
||||
]
|
||||
].compact
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user