-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ETQ instructeur, j'ai besoin d'un accès très facile à mondernier export #9855
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour le bug sur les exports en échec: je pense que ça vient du fait que le poll appelle download_export
qui fait un .find_or_create_fresh_export
, qui finit par un create car le dernier export a été en échec. Ce qui veut dire qu'en l'état, on créé un nouvel export dès le premier poll, et le last_export renvoyé est donc en pending
export = Export.where(instructeur_id: current_instructeur.id, statut: statut).last | ||
if export.present? | ||
return nil if export.updated_at < 1.hour.ago | ||
end | ||
export |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
petite simplification :
export = Export.where(instructeur_id: current_instructeur.id, statut: statut).last | |
if export.present? | |
return nil if export.updated_at < 1.hour.ago | |
end | |
export | |
Export.where(instructeur_id: current_instructeur.id, statut: statut, updated_at: 1.hour.ago..).last |
9d10a4a
to
d948009
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dernier petit truc, pour le reste ça me paraît OK!
@@ -0,0 +1,11 @@ | |||
- if export.present? | |||
%div{ data: export.pending? ? { controller: "turbo-poll", turbo_poll_url_value: polling_last_export_instructeur_procedure_path(export_format: export.format, statut: @statut), turbo_poll_interval_value: 5_000, turbo_poll_max_checks_value: 6 } : {} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je l'avais pas vue avant, mais dans ce partial utilise une variable d'instance @statut
. Comme pour l'export ce serait mieux de la passer en variable locale
@@ -6,3 +6,6 @@ | |||
- else | |||
= turbo_stream.update_all '.dossiers-export' do | |||
= render Dossiers::ExportDropdownComponent.new(procedure: @procedure, statut: @statut, count: @dossiers_count, export_url: method(:download_export_instructeur_procedure_path)) | |||
|
|||
= turbo_stream.update "last-export-alert" do | |||
= render partial: "last_export_alert", locals: {export: @last_export} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vu que tu vas modifier les locals, il manque les espaces autour des {}
(d'ailleurs en principe haml-lint est censé les voir ?)
d948009
to
3e79278
Compare
3e79278
to
e6a4459
Compare
closes #9736