amelioration(delai.traitement): revoie l'affichage du delais d'instruction
Co-authored-by: Colin Darie <colin@darie.eu>
This commit is contained in:
parent
474fde3380
commit
f26a4bc041
8 changed files with 60 additions and 20 deletions
14
app/components/procedure/estimated_delay_component.rb
Normal file
14
app/components/procedure/estimated_delay_component.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
class Procedure::EstimatedDelayComponent < ApplicationComponent
|
||||
def initialize(procedure:)
|
||||
@procedure = procedure
|
||||
@fastest, @mean, @slow = procedure.usual_traitement_time_for_recent_dossiers(ProcedureStatsConcern::NB_DAYS_RECENT_DOSSIERS)
|
||||
end
|
||||
|
||||
def estimation_present?
|
||||
@fastest && @mean && @slow
|
||||
end
|
||||
|
||||
def render?
|
||||
estimation_present?
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
en:
|
||||
explanation: "Based on %{pencentile}% during the last %{nb_recent_dossiers} days, the instruction time is :"
|
||||
fast_html: "<strong>In the best cast scenario</strong> : <strong>%{estimation}</strong>."
|
||||
mean_html: "If your file <strong>requires minor adjustments</strong>, the instruction time is <strong>%{estimation}</strong>."
|
||||
slow_html: "If you file <strong>is missing some information</strong> which requires a lot of exchanges with the administration, the instruction time is around <strong>%{estimation}</strong>."
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
fr:
|
||||
explanation: Selon nos estimations, à partir des délais d’instruction constatés sur %{percentile}% des demandes qui ont été traitées lors des %{nb_recent_dossiers} derniers jours, les délais d’instruction sont les suivants
|
||||
fast_html: "<strong>Dans le meilleur des cas</strong>, le délai d’instruction est : <strong>%{estimation}</strong>."
|
||||
mean_html: "Les <strong>dossiers demandant quelques échanges</strong> le délai d’instruction est d‘environ : <strong>%{estimation}</strong>."
|
||||
slow_html: "Si votre <strong>dossier est incomplet</strong> ou qu’il faut beaucoup d’échanges avec l’administration, le délai d’instruction est d’environ <strong>%{estimation}</strong>."
|
|
@ -0,0 +1,10 @@
|
|||
- cache(@procedure.id, expires_in: 1.day) do
|
||||
- if estimation_present?
|
||||
= render Dsfr::AlertComponent.new(state: :info, size: :sm, extra_class_names: 'fr-mb-2w') do |c|
|
||||
- c.body do
|
||||
%p= t('.explanation', percentile: ProcedureStatsConcern::USUAL_TRAITEMENT_TIME_PERCENTILE, nb_recent_dossiers: ProcedureStatsConcern::NB_DAYS_RECENT_DOSSIERS)
|
||||
%ul
|
||||
%li= t('.fast_html', estimation: distance_of_time_in_words(@fastest))
|
||||
%li= t('.mean_html', estimation: distance_of_time_in_words(@mean))
|
||||
%li= t('.slow_html', estimation: distance_of_time_in_words(@slow))
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
- cache(procedure.id, expires_in: 1.day) do
|
||||
- if procedure.usual_traitement_time_for_recent_dossiers(ProcedureStatsConcern::NB_DAYS_RECENT_DOSSIERS)
|
||||
%p
|
||||
Habituellement, les dossiers de cette démarche sont traités dans un délai de #{distance_of_time_in_words(procedure.usual_traitement_time_for_recent_dossiers(ProcedureStatsConcern::NB_DAYS_RECENT_DOSSIERS))}.
|
||||
%p
|
||||
Cette estimation est calculée automatiquement à partir des délais d’instruction constatés sur #{ProcedureStatsConcern::USUAL_TRAITEMENT_TIME_PERCENTILE}% des demandes qui ont été traitées lors des #{ProcedureStatsConcern::NB_DAYS_RECENT_DOSSIERS} derniers jours. Le délai réel peut être différent, en fonction du type de démarche (par exemple pour un appel à projet avec date de décision fixe).
|
|
@ -33,8 +33,7 @@
|
|||
%p{ role: 'status' }
|
||||
= t('views.users.dossiers.show.status_overview.en_construction_html')
|
||||
|
||||
= render partial: 'users/dossiers/show/estimated_delay', locals: { procedure: dossier.procedure }
|
||||
|
||||
= render Procedure::EstimatedDelayComponent.new(procedure: dossier.procedure)
|
||||
%p
|
||||
= t('views.users.dossiers.show.status_overview.use_mailbox_for_questions_html', mailbox_url: messagerie_dossier_url(dossier))
|
||||
|
||||
|
@ -50,7 +49,7 @@
|
|||
%p
|
||||
= t('views.users.dossiers.show.status_overview.delay_text_sva_svr', date: l(dossier.sva_svr_decision_on, format: :long))
|
||||
|
||||
= render partial: 'users/dossiers/show/estimated_delay', locals: { procedure: dossier.procedure }
|
||||
= render Procedure::EstimatedDelayComponent.new(procedure: dossier.procedure)
|
||||
|
||||
%p
|
||||
= t('views.users.dossiers.show.status_overview.use_mailbox_for_questions_html', mailbox_url: messagerie_dossier_url(dossier))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue