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 automatic_email: Automatic email
you: You you: You
deleted_body: Message deleted deleted_body: Message deleted
flagged_pending_corrections: Modification requested

View file

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

View file

@ -6,9 +6,8 @@
= commentaire_issuer = commentaire_issuer
- if commentaire_from_guest? - if commentaire_from_guest?
%span.fr-text--xs.fr-text-mention--grey.font-weight-normal= t('.guest') %span.fr-text--xs.fr-text-mention--grey.font-weight-normal= t('.guest')
- if commentaire.flagged_pending_corrections? - if commentaire.flagged_pending_correction?
%span.fr-badge.fr-badge--sm.fr-badge--info = helpers.pending_correction_badge(connected_user.is_a?(Instructeur) ? :for_instructeur : :for_user)
= t('.flagged_pending_corrections')
%span.date{ class: ["fr-text--xs", "fr-text-mention--grey", "font-weight-normal", highlight_if_unseen_class], data: scroll_to_target } %span.date{ class: ["fr-text--xs", "fr-text-mention--grey", "font-weight-normal", highlight_if_unseen_class], data: scroll_to_target }
= commentaire_date = commentaire_date
.rich-text .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] 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_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_avis_as_read, only: [:avis, :create_avis]
after_action :mark_annotations_privees_as_read, only: [:annotations_privees, :update_annotations] after_action :mark_annotations_privees_as_read, only: [:annotations_privees, :update_annotations]
@ -223,11 +223,11 @@ module Instructeurs
render :change_state render :change_state
end end
def pending_corrections def pending_correction
message, piece_jointe = params.require(:dossier).permit(:motivation, :justificatif_motivation).values message, piece_jointe = params.require(:dossier).permit(:motivation, :justificatif_motivation).values
if message.empty? 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? 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." flash.alert = dossier.termine? ? "Impossible de demander de corriger un dossier terminé." : "Le dossier est déjà en attente de correction."
else else

View file

@ -1,7 +1,7 @@
- if dossier.en_instruction? || (dossier.en_construction? && dossier.may_flag_as_pending_correction?) - 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| = 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 - 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? - if dossier.en_instruction?
- menu.with_item do - menu.with_item do
@ -37,18 +37,18 @@
- if dossier.may_flag_as_pending_correction? - if dossier.may_flag_as_pending_correction?
- menu.with_item do - 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" } %span.fr-icon.fr-icon-error-warning-line.fr-text-default--info{ "aria-hidden": "true" }
.dropdown-description .dropdown-description
%h4 Demander une modification %h4 Demander une correction
Lusager sera informé que des modifications sont attendues Lusager sera informé que des modifications sont attendues
- menu.with_item(class: class_names("inactive form-inside": true, hidden: dossier.en_instruction?)) do - 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, = render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier,
visible: !dossier.en_instruction?, visible: !dossier.en_instruction?,
form_path: pending_corrections_instructeur_dossier_path(dossier.procedure, dossier), form_path: pending_correction_instructeur_dossier_path(dossier.procedure, dossier),
placeholder: 'Expliquez au demandeur quelles modifications sont attendues', placeholder: 'Expliquez au demandeur quelle(s) correction(s) sont attendues',
popup_class: 'pending_corrections', popup_class: 'pending_correction',
button_justificatif_label: "Ajouter une pièce jointe (facultatif)", button_justificatif_label: "Ajouter une pièce jointe (facultatif)",
process_button: dossier.en_construction? ? 'Valider' : 'Valider et repasser en construction', process_button: dossier.en_construction? ? 'Valider' : 'Valider et repasser en construction',
process_action: nil, process_action: nil,

View file

@ -4,7 +4,7 @@ en:
notify_pending_correction: notify_pending_correction:
subject: You need to modify your file no. %{dossier_id} « %{libelle_demarche} » subject: You need to modify your file no. %{dossier_id} « %{libelle_demarche} »
explanation_html: explanation_html:
In order to continue its instruction, <strong>an instructor asks you to edit information</strong> to your file no. %{dossier_id} of the « %{libelle_demarche} » procedure. In order to continue its instruction, <strong>an instructor requested you to edit information</strong> to your file no. %{dossier_id} of the « %{libelle_demarche} » procedure.
link: link:
Check your file's mailbox to see what changes need to be made, then edit the file directly on the website. Check your file's mailbox to see what changes need to be made, then edit the file directly on the website.
access_message: Open the mailbox access_message: Open the mailbox

View file

@ -445,7 +445,7 @@ Rails.application.routes.draw do
post 'repasser-en-construction' => 'dossiers#repasser_en_construction' post 'repasser-en-construction' => 'dossiers#repasser_en_construction'
post 'repasser-en-instruction' => 'dossiers#repasser_en_instruction' post 'repasser-en-instruction' => 'dossiers#repasser_en_instruction'
post 'terminer' post 'terminer'
post 'pending_corrections' post 'pending_correction'
post 'send-to-instructeurs' => 'dossiers#send_to_instructeurs' post 'send-to-instructeurs' => 'dossiers#send_to_instructeurs'
post 'avis' => 'dossiers#create_avis' post 'avis' => 'dossiers#create_avis'
get 'print' => 'dossiers#print' get 'print' => 'dossiers#print'

View file

@ -496,12 +496,12 @@ describe Instructeurs::DossiersController, type: :controller do
end end
end end
describe '#pending_corrections' do describe '#pending_correction' do
let(:message) { 'do that' } let(:message) { 'do that' }
let(:justificatif) { nil } let(:justificatif) { nil }
subject do subject do
post :pending_corrections, params: { post :pending_correction, params: {
procedure_id: procedure.id, dossier_id: dossier.id, procedure_id: procedure.id, dossier_id: dossier.id,
dossier: { motivation: message, justificatif_motivation: justificatif } dossier: { motivation: message, justificatif_motivation: justificatif }
}, format: :turbo_stream }, format: :turbo_stream
@ -528,7 +528,7 @@ describe Instructeurs::DossiersController, type: :controller do
it 'pass en_construction and create a pending correction' do it 'pass en_construction and create a pending correction' do
expect(response).to have_http_status(:ok) expect(response).to have_http_status(:ok)
expect(response.body).to include('en attente de modifications') expect(response.body).to include('en attente de correction')
expect(dossier.reload).to be_en_construction expect(dossier.reload).to be_en_construction
expect(dossier).to be_pending_correction expect(dossier).to be_pending_correction
@ -536,7 +536,7 @@ describe Instructeurs::DossiersController, type: :controller do
it 'create a comment with text body' do it 'create a comment with text body' do
expect(dossier.commentaires.last.body).to eq("do that") expect(dossier.commentaires.last.body).to eq("do that")
expect(dossier.commentaires.last).to be_flagged_pending_corrections expect(dossier.commentaires.last).to be_flagged_pending_correction
end end
context 'with an attachment' do context 'with an attachment' do
@ -578,7 +578,7 @@ describe Instructeurs::DossiersController, type: :controller do
it 'can create a pending correction' do it 'can create a pending correction' do
subject subject
expect(dossier.reload).to be_pending_correction expect(dossier.reload).to be_pending_correction
expect(dossier.commentaires.last).to be_flagged_pending_corrections expect(dossier.commentaires.last).to be_flagged_pending_correction
end end
end end

View file

@ -1,5 +0,0 @@
require 'rails_helper'
RSpec.describe DossierCorrection, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View file

@ -249,7 +249,7 @@ describe DossierProjectionService do
end end
end end
context 'for dossier reolutions table' do context 'for dossier corrections table' do
let(:table) { 'dossier_corrections' } let(:table) { 'dossier_corrections' }
let(:column) { 'resolved_at' } let(:column) { 'resolved_at' }
let(:dossier) { create(:dossier, :en_construction) } let(:dossier) { create(:dossier, :en_construction) }

View file

@ -33,7 +33,7 @@ describe 'instructeurs/dossiers/instruction_button', type: :view do
let(:dossier) { create(:dossier, :en_construction) } let(:dossier) { create(:dossier, :en_construction) }
it 'renders a dropdown' do it 'renders a dropdown' do
expect(rendered).to have_dropdown_title('Demander une modification') expect(rendered).to have_dropdown_title('Demander une correction')
expect(rendered).to have_dropdown_items(count: 2) # form is already expanded so we have 2 visible items expect(rendered).to have_dropdown_items(count: 2) # form is already expanded so we have 2 visible items
end end
end end
@ -47,7 +47,7 @@ describe 'instructeurs/dossiers/instruction_button', type: :view do
expect(rendered).to have_dropdown_item('Accepter') expect(rendered).to have_dropdown_item('Accepter')
expect(rendered).to have_dropdown_item('Classer sans suite') expect(rendered).to have_dropdown_item('Classer sans suite')
expect(rendered).to have_dropdown_item('Refuser') expect(rendered).to have_dropdown_item('Refuser')
expect(rendered).to have_dropdown_item('Demander une modification') expect(rendered).to have_dropdown_item('Demander une correction')
end end
end end
end end

View file

@ -61,7 +61,7 @@ describe 'instructeurs/dossiers/show', type: :view do
within("form[action=\"#{follow_instructeur_dossier_path(dossier.procedure, dossier)}\"]") do within("form[action=\"#{follow_instructeur_dossier_path(dossier.procedure, dossier)}\"]") do
expect(subject).to have_button('Suivre le dossier') expect(subject).to have_button('Suivre le dossier')
end end
expect(subject).to have_button('Demander une modification') expect(subject).to have_button('Demander une correction')
expect(subject).to have_selector('.header-actions ul:first-child > li.instruction-button', count: 1) expect(subject).to have_selector('.header-actions ul:first-child > li.instruction-button', count: 1)
end end
end end