fix(attachment): keep direct_upload behavior in poll url
Co-Authored-By: Christophe Robillard <christophe.robillard@beta.gouv.fr>
This commit is contained in:
parent
c121a8b2dc
commit
44578ba65c
3 changed files with 3 additions and 2 deletions
|
@ -83,7 +83,7 @@ class Attachment::EditComponent < ApplicationComponent
|
||||||
if champ.present?
|
if champ.present?
|
||||||
auto_attach_url
|
auto_attach_url
|
||||||
else
|
else
|
||||||
attachment_path(user_can_edit: true, view_as: @view_as, auto_attach_url: @auto_attach_url)
|
attachment_path(user_can_edit: true, view_as: @view_as, auto_attach_url: @auto_attach_url, direct_upload: @direct_upload)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ class AttachmentsController < ApplicationController
|
||||||
@attachment = @blob.attachments.find(params[:id])
|
@attachment = @blob.attachments.find(params[:id])
|
||||||
|
|
||||||
@user_can_edit = cast_bool(params[:user_can_edit])
|
@user_can_edit = cast_bool(params[:user_can_edit])
|
||||||
|
@direct_upload = cast_bool(params[:direct_upload])
|
||||||
@view_as = params[:view_as]&.to_sym
|
@view_as = params[:view_as]&.to_sym
|
||||||
@auto_attach_url = params[:auto_attach_url]
|
@auto_attach_url = params[:auto_attach_url]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
= turbo_stream.replace dom_id(@attachment, :edit) do
|
= turbo_stream.replace dom_id(@attachment, :edit) do
|
||||||
- if @user_can_edit
|
- if @user_can_edit
|
||||||
= render Attachment::EditComponent.new(attachment: @attachment, attached_file: @attachment.record.public_send(@attachment.name), auto_attach_url: @auto_attach_url, view_as: @view_as)
|
= render Attachment::EditComponent.new(attachment: @attachment, attached_file: @attachment.record.public_send(@attachment.name), auto_attach_url: @auto_attach_url, view_as: @view_as, direct_upload: @direct_upload)
|
||||||
- else
|
- else
|
||||||
= render Attachment::ShowComponent.new(attachment: @attachment)
|
= render Attachment::ShowComponent.new(attachment: @attachment)
|
||||||
|
|
Loading…
Reference in a new issue