fix(pending-correction): wording alignement

This commit is contained in:
Colin Darie 2023-04-13 19:10:09 +02:00
parent a32014d4fd
commit 734d88d80d
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
12 changed files with 22 additions and 30 deletions

View file

@ -7,4 +7,3 @@ en:
automatic_email: Automatic email
you: You
deleted_body: Message deleted
flagged_pending_corrections: Modification requested

View file

@ -7,4 +7,3 @@ fr:
automatic_email: Email automatique
you: Vous
deleted_body: Message supprimé
flagged_pending_corrections: Modification demandée

View file

@ -6,9 +6,8 @@
= commentaire_issuer
- if commentaire_from_guest?
%span.fr-text--xs.fr-text-mention--grey.font-weight-normal= t('.guest')
- if commentaire.flagged_pending_corrections?
%span.fr-badge.fr-badge--sm.fr-badge--info
= t('.flagged_pending_corrections')
- if commentaire.flagged_pending_correction?
= helpers.pending_correction_badge(connected_user.is_a?(Instructeur) ? :for_instructeur : :for_user)
%span.date{ class: ["fr-text--xs", "fr-text-mention--grey", "font-weight-normal", highlight_if_unseen_class], data: scroll_to_target }
= commentaire_date
.rich-text

View file

@ -13,7 +13,7 @@ module Instructeurs
before_action :redirect_on_dossier_in_batch_operation, only: [:archive, :unarchive, :follow, :unfollow, :passer_en_instruction, :repasser_en_construction, :repasser_en_instruction, :terminer, :restore, :destroy, :extend_conservation]
after_action :mark_demande_as_read, only: :show
after_action :mark_messagerie_as_read, only: [:messagerie, :create_commentaire, :pending_corrections]
after_action :mark_messagerie_as_read, only: [:messagerie, :create_commentaire, :pending_correction]
after_action :mark_avis_as_read, only: [:avis, :create_avis]
after_action :mark_annotations_privees_as_read, only: [:annotations_privees, :update_annotations]
@ -223,11 +223,11 @@ module Instructeurs
render :change_state
end
def pending_corrections
def pending_correction
message, piece_jointe = params.require(:dossier).permit(:motivation, :justificatif_motivation).values
if message.empty?
flash.alert = "Vous devez préciser quelle modification est attendue."
flash.alert = "Vous devez préciser quelle correction est attendue."
elsif !dossier.may_flag_as_pending_correction?
flash.alert = dossier.termine? ? "Impossible de demander de corriger un dossier terminé." : "Le dossier est déjà en attente de correction."
else

View file

@ -1,7 +1,7 @@
- if dossier.en_instruction? || (dossier.en_construction? && dossier.may_flag_as_pending_correction?)
= render Dropdown::MenuComponent.new(wrapper: :div, wrapper_options: { data: { turbo_force: :server } }, button_options: { class: [button_or_label_class(dossier)]}, role: dossier.en_instruction? ? :region : :menu) do |menu|
- menu.with_button_inner_html do
= dossier.en_instruction? ? "Instruire le dossier" : "Demander une modification"
= dossier.en_instruction? ? "Instruire le dossier" : "Demander une correction"
- if dossier.en_instruction?
- menu.with_item do
@ -37,18 +37,18 @@
- if dossier.may_flag_as_pending_correction?
- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'pending_corrections');", role: 'menuitem') do
= link_to('#', onclick: "DS.showMotivation(event, 'pending_correction');", role: 'menuitem') do
%span.fr-icon.fr-icon-error-warning-line.fr-text-default--info{ "aria-hidden": "true" }
.dropdown-description
%h4 Demander une modification
%h4 Demander une correction
Lusager sera informé que des modifications sont attendues
- menu.with_item(class: class_names("inactive form-inside": true, hidden: dossier.en_instruction?)) do
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier,
visible: !dossier.en_instruction?,
form_path: pending_corrections_instructeur_dossier_path(dossier.procedure, dossier),
placeholder: 'Expliquez au demandeur quelles modifications sont attendues',
popup_class: 'pending_corrections',
form_path: pending_correction_instructeur_dossier_path(dossier.procedure, dossier),
placeholder: 'Expliquez au demandeur quelle(s) correction(s) sont attendues',
popup_class: 'pending_correction',
button_justificatif_label: "Ajouter une pièce jointe (facultatif)",
process_button: dossier.en_construction? ? 'Valider' : 'Valider et repasser en construction',
process_action: nil,