refactor(attachment): bring batch user_can_destroy, update tests

This commit is contained in:
Colin Darie 2022-11-21 18:32:17 +01:00
parent df135b080b
commit b609c3dae4
9 changed files with 152 additions and 89 deletions

View file

@ -3,10 +3,10 @@
- each_attachment do |attachment, index|
%div{ id: dom_id(attachment) }
= render Attachment::EditComponent.new(champ:, attached_file:, attachment:, index:, as_multiple: true)
= render Attachment::EditComponent.new(champ:, attached_file:, attachment:, index:, as_multiple: true, user_can_destroy:)
%div{ id: empty_component_id, class: class_names("hidden": !can_attach_next?) }
= render Attachment::EditComponent.new(champ:, attached_file:, attachment: nil, index: attachments_count)
= render Attachment::EditComponent.new(champ:, attached_file:, attachment: nil, index: attachments_count, user_can_destroy:)
// single poll and refresh message for all attachments
- if in_progress?