feat(correction): badge Corrigé when a correction has been resolved
Closes #9928
This commit is contained in:
parent
261932b56f
commit
8e6a1c58b2
7 changed files with 35 additions and 4 deletions
|
@ -103,8 +103,8 @@ module DossierHelper
|
|||
tag.span(Dossier.human_attribute_name("pending_correction.#{for_profile}"), class: ['fr-badge fr-badge--sm fr-badge--warning super', html_class], role: 'status')
|
||||
end
|
||||
|
||||
def correction_resolved_badge
|
||||
tag.span(Dossier.human_attribute_name("pending_correction.resolved"), class: ['fr-badge fr-badge--sm fr-badge--success super'], role: 'status')
|
||||
def correction_resolved_badge(html_class: nil)
|
||||
tag.span(Dossier.human_attribute_name("pending_correction.resolved"), class: ['fr-badge fr-badge--sm fr-badge--success super', html_class], role: 'status')
|
||||
end
|
||||
|
||||
def demandeur_dossier(dossier)
|
||||
|
|
|
@ -40,6 +40,10 @@ module DossierCorrectableConcern
|
|||
pending_corrections.exists?
|
||||
end
|
||||
|
||||
def last_correction_resolved?
|
||||
corrections.last&.resolved?
|
||||
end
|
||||
|
||||
def resolve_pending_correction
|
||||
pending_correction&.resolve
|
||||
end
|
||||
|
|
|
@ -5,6 +5,12 @@ class DossierProjectionService
|
|||
|
||||
corrections.any? { _1[:resolved_at].nil? }
|
||||
end
|
||||
|
||||
def resolved_corrections?
|
||||
return false if corrections.blank?
|
||||
|
||||
corrections.all? { _1[:resolved_at].present? }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,10 @@
|
|||
= procedure_badge(dossier.procedure)
|
||||
|
||||
= status_badge(dossier.state)
|
||||
= pending_correction_badge(:for_instructeur) if dossier.pending_correction?
|
||||
- if dossier.pending_correction?
|
||||
= pending_correction_badge(:for_instructeur)
|
||||
- elsif dossier.en_construction? && dossier.last_correction_resolved?
|
||||
= correction_resolved_badge
|
||||
= render Instructeurs::SVASVRDecisionBadgeComponent.new(projection_or_dossier: dossier, procedure: dossier.procedure, with_label: true)
|
||||
|
||||
|
||||
|
|
|
@ -175,7 +175,10 @@
|
|||
|
||||
%td.status-col
|
||||
- status = [status_badge(p.state)]
|
||||
- status << pending_correction_badge(:for_instructeur, html_class: "fr-mt-1v") if p.pending_correction?
|
||||
- if p.pending_correction?
|
||||
- status << pending_correction_badge(:for_instructeur, html_class: "fr-mt-1v")
|
||||
- elsif p.state.to_sym == :en_construction && p.resolved_corrections?
|
||||
- status << correction_resolved_badge(html_class: "fr-mt-1v")
|
||||
= link_to_if(p.hidden_by_administration_at.blank?, safe_join(status), path, class: class_names("cell-link": true, "fr-py-0": status.many?))
|
||||
|
||||
- if @procedure.sva_svr_enabled?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue