feat(correction): user can mark dossier en_construction as resolved

This commit is contained in:
Colin Darie 2023-04-11 18:31:16 +02:00
parent 8839ac7f76
commit a32014d4fd
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
7 changed files with 28 additions and 3 deletions

View file

@ -30,7 +30,7 @@
color: $dark-red;
}
label,
label:not(.fr-label),
legend.form-label {
font-size: 18px;
margin-bottom: $default-padding;

View file

@ -27,7 +27,8 @@ class Dossiers::EditFooterComponent < ApplicationComponent
{
class: 'fr-btn fr-btn--sm',
method: :post,
data: { 'disable-with': t('.submitting'), controller: 'autosave-submit' }
data: { 'disable-with': t('.submitting'), controller: 'autosave-submit' },
form: { id: "form-submit-en-construction" }
}
end

View file

@ -227,6 +227,10 @@ module Users
editing_fork_origin.merge_fork(@dossier)
RoutingEngine.compute(editing_fork_origin)
if cast_bool(params.dig(:dossier, :pending_correction_confirm))
editing_fork_origin.resolve_pending_correction!
end
redirect_to dossier_path(editing_fork_origin)
else
flash.now.alert = errors

View file

@ -39,6 +39,12 @@
dossier.procedure.groupe_instructeurs.active.map { |gi| [gi.label, gi.id] },
{ include_blank: dossier.brouillon? }
= render EditableChamp::SectionComponent.new(champs: dossier_for_editing.champs_public)
- if dossier.pending_correction?
.fr-checkbox-group.fr-my-3w
= check_box_tag field_name(:dossier, :pending_correction_confirm), "1", false, form: "form-submit-en-construction"
%label.fr-label{ for: :dossier_pending_correction_confirm }= t('views.shared.dossiers.edit.pending_correction.confirm_label')
= render Dossiers::EditFooterComponent.new(dossier: dossier_for_editing, annotation: false)