feat(instructeur): pending correction blocks passer en instruction

Closes #9731
This commit is contained in:
Colin Darie 2023-12-07 17:32:39 +01:00
parent ecc3638d81
commit c26b59722d
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
9 changed files with 60 additions and 18 deletions

View file

@ -44,9 +44,15 @@
- if Dossier.states[:en_construction] == state
%li{ 'data-turbo': turbo ? 'true' : 'false' }
= button_to passer_en_instruction_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: 'fr-btn fr-icon-edit-line' do
Passer en instruction
= button_to passer_en_instruction_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: 'fr-btn fr-icon-edit-line',
disabled: has_pending_correction, "aria-describedby" => has_pending_correction ? "tooltip-passer-en-instruction" : nil do
= t('views.instructeurs.dossiers.passer_en_instruction')
- if has_pending_correction
%span#tooltip-passer-en-instruction.fr-tooltip.fr-placement{ role: :tooltip, "aria-hidden" => "true" }
= t('views.instructeurs.dossiers.passer_en_instruction_blocked_by_pending_correction')
- elsif Dossier.states[:en_instruction] == state && !with_menu && !sva_svr
%li{ 'data-turbo': turbo ? 'true' : 'false' }
= button_to repasser_en_construction_instructeur_dossier_path(procedure_id, dossier_id), method: :post, class: 'fr-btn fr-btn--secondary fr-icon-draft-line' do
Repasser en construction
= t('views.instructeurs.dossiers.repasser_en_construction')

View file

@ -189,6 +189,7 @@
close_to_expiration: @statut == 'expirant',
hidden_by_administration: @statut == 'supprimes_recemment',
sva_svr: @procedure.sva_svr_enabled?,
has_pending_correction: p.pending_correction?,
turbo: false,
with_menu: false }