7f65f4aabd
The hidden "Assign to me" button on the card detail view baked
Current.user.id into the form action at render time. When served from
fragment cache, a stale user ID could be embedded, assigning cards to
the wrong person.
Switch to card_self_assignment_path which resolves the current user at
request time via SelfAssignmentsController, matching the fix already
applied to the board view in 2527f073.
ref: https://app.fizzy.do/5986089/cards/3722
23 lines
1.3 KiB
Plaintext
23 lines
1.3 KiB
Plaintext
<div id="<%= dom_id(card, :assignees) %>" class="position-relative"
|
|
data-controller="dialog"
|
|
data-action="keydown.esc->dialog#close click@document->dialog#closeOnClickOutside mouseenter->dialog#loadLazyFrames" <%= "hidden" if card.closed? %>>
|
|
<button class="card__assignees-trigger" data-action="click->dialog#open:stop keydown.a@document->hotkey#click" data-controller="tooltip hotkey" tabindex=<%= (local_assigns.key?(:preview) && local_assigns[:preview]) ? -1 : 0 %>>
|
|
<% card.assignees.each do |assignee| %>
|
|
<%= avatar_preview_tag assignee, tabindex: (local_assigns.key?(:preview) && local_assigns[:preview]) ? -1 : 0 %>
|
|
<% end %>
|
|
|
|
<span class="btn card__hide-on-index" style="--btn-background: var(--card-bg-color);">
|
|
<%= icon_tag "person-add" %>
|
|
<span class="for-screen-reader">Assign</span>
|
|
</span>
|
|
</button>
|
|
|
|
<% unless local_assigns[:preview] %>
|
|
<%= button_to "Assign to me", card_self_assignment_path(card), method: :post, data: {controller: "hotkey", action: "keydown.m@document->hotkey#click" }, hidden: true %>
|
|
<% end %>
|
|
|
|
<dialog class="popup panel flex-column align-start gap-half fill-white shadow" data-dialog-target="dialog" data-action="turbo:before-morph-attribute->dialog#preventCloseOnMorphing turbo:submit-end->dialog#close">
|
|
<%= yield %>
|
|
</dialog>
|
|
</div>
|