fix(pending-correction): wording alignement
This commit is contained in:
parent
a32014d4fd
commit
734d88d80d
12 changed files with 22 additions and 30 deletions
|
@ -7,4 +7,3 @@ en:
|
|||
automatic_email: Automatic email
|
||||
you: You
|
||||
deleted_body: Message deleted
|
||||
flagged_pending_corrections: Modification requested
|
||||
|
|
|
@ -7,4 +7,3 @@ fr:
|
|||
automatic_email: Email automatique
|
||||
you: Vous
|
||||
deleted_body: Message supprimé
|
||||
flagged_pending_corrections: Modification demandée
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
L’usager 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,
|
||||
|
|
|
@ -4,7 +4,7 @@ en:
|
|||
notify_pending_correction:
|
||||
subject: You need to modify your file no. %{dossier_id} « %{libelle_demarche} »
|
||||
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:
|
||||
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
|
||||
|
|
|
@ -445,7 +445,7 @@ Rails.application.routes.draw do
|
|||
post 'repasser-en-construction' => 'dossiers#repasser_en_construction'
|
||||
post 'repasser-en-instruction' => 'dossiers#repasser_en_instruction'
|
||||
post 'terminer'
|
||||
post 'pending_corrections'
|
||||
post 'pending_correction'
|
||||
post 'send-to-instructeurs' => 'dossiers#send_to_instructeurs'
|
||||
post 'avis' => 'dossiers#create_avis'
|
||||
get 'print' => 'dossiers#print'
|
||||
|
|
|
@ -496,12 +496,12 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#pending_corrections' do
|
||||
describe '#pending_correction' do
|
||||
let(:message) { 'do that' }
|
||||
let(:justificatif) { nil }
|
||||
|
||||
subject do
|
||||
post :pending_corrections, params: {
|
||||
post :pending_correction, params: {
|
||||
procedure_id: procedure.id, dossier_id: dossier.id,
|
||||
dossier: { motivation: message, justificatif_motivation: justificatif }
|
||||
}, format: :turbo_stream
|
||||
|
@ -528,7 +528,7 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
|
||||
it 'pass en_construction and create a pending correction' do
|
||||
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).to be_pending_correction
|
||||
|
@ -536,7 +536,7 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
|
||||
it 'create a comment with text body' do
|
||||
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
|
||||
|
||||
context 'with an attachment' do
|
||||
|
@ -578,7 +578,7 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
it 'can create a pending correction' do
|
||||
subject
|
||||
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
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe DossierCorrection, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
|
@ -249,7 +249,7 @@ describe DossierProjectionService do
|
|||
end
|
||||
end
|
||||
|
||||
context 'for dossier reolutions table' do
|
||||
context 'for dossier corrections table' do
|
||||
let(:table) { 'dossier_corrections' }
|
||||
let(:column) { 'resolved_at' }
|
||||
let(:dossier) { create(:dossier, :en_construction) }
|
||||
|
|
|
@ -33,7 +33,7 @@ describe 'instructeurs/dossiers/instruction_button', type: :view do
|
|||
let(:dossier) { create(:dossier, :en_construction) }
|
||||
|
||||
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
|
||||
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('Classer sans suite')
|
||||
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
|
||||
|
|
|
@ -61,7 +61,7 @@ describe 'instructeurs/dossiers/show', type: :view do
|
|||
within("form[action=\"#{follow_instructeur_dossier_path(dossier.procedure, dossier)}\"]") do
|
||||
expect(subject).to have_button('Suivre le dossier')
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue