Use page refreshes with morphing to avoid flickering
Replacing the card container will reload the frame. Also, see https://github.com/basecamp/fizzy/commit/5b70320a6b64adf2d1e0be4bd7dc221a5ba80c95
This commit is contained in:
@@ -5,11 +5,11 @@ class Cards::TriagesController < ApplicationController
|
||||
column = @card.collection.columns.find(params[:column_id])
|
||||
@card.triage_into(column)
|
||||
|
||||
render_card_replacement
|
||||
redirect_to @card
|
||||
end
|
||||
|
||||
def destroy
|
||||
@card.send_back_to_triage
|
||||
render_card_replacement
|
||||
redirect_to @card
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ class Cards::TriagesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
assert_changes -> { card.reload.column }, from: original_column, to: column do
|
||||
post card_triage_path(card, column_id: column.id)
|
||||
assert_card_container_rerendered(card)
|
||||
assert_redirected_to card
|
||||
end
|
||||
end
|
||||
|
||||
@@ -20,8 +20,8 @@ class Cards::TriagesControllerTest < ActionDispatch::IntegrationTest
|
||||
card = cards(:shipping)
|
||||
|
||||
assert_changes -> { card.reload.column }, to: nil do
|
||||
delete card_triage_path(card)
|
||||
assert_card_container_rerendered(card)
|
||||
delete card_triage_path(card), as: :turbo_stream
|
||||
assert_redirected_to card
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user