fix(exports): force regenerate export with same statut filter

Co-Authored-By: Lisa Durand <lisa.c.durand@gmail.com>
This commit is contained in:
Colin Darie 2023-09-13 13:06:50 +02:00
parent edb030bb4c
commit 99f5b39dbb
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
2 changed files with 5 additions and 5 deletions

View file

@ -14,11 +14,11 @@ class Dossiers::ExportLinkComponent < ApplicationComponent
item.fetch(:format) != :json || @procedure.active_revision.carte?
end
def download_export_path(export_format:, force_export: false, no_progress_notification: nil)
def download_export_path(export_format:, statut:, force_export: false, no_progress_notification: nil)
@export_url.call(@procedure,
export_format: export_format,
statut: @statut,
force_export: force_export,
statut: statut,
no_progress_notification: no_progress_notification)
end
@ -54,7 +54,7 @@ class Dossiers::ExportLinkComponent < ApplicationComponent
def poll_controller_options(export)
{
controller: 'turbo-poll',
turbo_poll_url_value: download_export_path(export_format: export.format, no_progress_notification: true),
turbo_poll_url_value: download_export_path(export_format: export.format, statut: export.statut, no_progress_notification: true),
turbo_poll_interval_value: 6000,
turbo_poll_max_checks_value: 10
}

View file

@ -5,11 +5,11 @@
= link_to ready_link_label(export), export.file.url, target: "_blank", rel: "noopener", role: 'menuitem'
%span= ready_link_label_extra_infos(export)
- if export.old?
= button_to refresh_button_options(export)[:title], download_export_path(export_format: export.format, force_export: true), refresh_button_options(export).merge(role: 'menuitem')
= button_to refresh_button_options(export)[:title], download_export_path(export_format: export.format, statut: export.statut, force_export: true), refresh_button_options(export).merge(role: 'menuitem')
- elsif export.failed?
%li.fr-mb-2w
= failed_label(export)
= button_to refresh_button_options(export)[:title], download_export_path(export_format: export.format, force_export: true), refresh_button_options(export).merge(role: 'menuitem')
= button_to refresh_button_options(export)[:title], download_export_path(export_format: export.format, statut: export.statut, force_export: true), refresh_button_options(export).merge(role: 'menuitem')
- else
%li.fr-mb-2w
%span{ data: poll_controller_options(export) }