diff --git a/app/views/instructeurs/dossiers/show.html.haml b/app/views/instructeurs/dossiers/show.html.haml index cb5a2a4a3..501ca340a 100644 --- a/app/views/instructeurs/dossiers/show.html.haml +++ b/app/views/instructeurs/dossiers/show.html.haml @@ -2,4 +2,17 @@ = render partial: "header", locals: { dossier: @dossier } + +- if @dossier.etablissement&.as_degraded_mode? + .container + = render Dsfr::CalloutComponent.new(title: "Données de l’entreprise non vérifiées", theme: :warning, icon: "fr-icon-feedback-fill") do |c| + - c.with_body do + %p + Les services de l’INSEE sont indisponibles, nous ne pouvons pas + vérifier les informations liées à l’établissement de ce dossier. + %strong Il n’est pas possible d’accepter ou de refuser un dossier sans cette étape. + %br + %br + Les informations sur l'entreprise arriveront d’ici quelques heures. + = render partial: "shared/dossiers/demande", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at, profile: 'instructeur' } diff --git a/app/views/shared/dossiers/_identite_entreprise.html.haml b/app/views/shared/dossiers/_identite_entreprise.html.haml index 0922c9fef..54b2b0557 100644 --- a/app/views/shared/dossiers/_identite_entreprise.html.haml +++ b/app/views/shared/dossiers/_identite_entreprise.html.haml @@ -2,7 +2,7 @@ %table.table.vertical.dossier-champs %tbody %tr - %td.libelle{ colspan: 2 } ⚠ LʼINSEE est indisponible, les informations sur lʼentreprise arriveront dʼici quelques jours. + %td.libelle{ colspan: 2 } ⚠ LʼINSEE est indisponible, les informations sur lʼentreprise arriveront dʼici quelques heures. %tr %td.libelle SIRET : %td= etablissement.siret diff --git a/spec/views/instructeur/dossiers/show.html.haml_spec.rb b/spec/views/instructeur/dossiers/show.html.haml_spec.rb index 7eb30ba0a..4e624ada0 100644 --- a/spec/views/instructeur/dossiers/show.html.haml_spec.rb +++ b/spec/views/instructeur/dossiers/show.html.haml_spec.rb @@ -33,4 +33,22 @@ describe 'instructeurs/dossiers/show.html.haml', type: :view do expect(rendered).to have_text("Le dossier a été déposé par le compte de #{france_connect_information.given_name} #{france_connect_information.family_name}, authentifié par France Connect le #{france_connect_information.updated_at.strftime('%d/%m/%Y')}") end end + + describe 'entreprise degraded mode' do + context 'etablissement complete' do + let(:dossier) { create(:dossier, :en_construction, :with_entreprise, as_degraded_mode: false) } + + it 'contains no warning' do + expect(rendered).not_to have_text("Les services de l’INSEE sont indisponibles") + end + end + + context 'etablissement in degraded mode' do + let(:dossier) { create(:dossier, :en_construction, :with_entreprise, as_degraded_mode: true) } + + it 'warns the instructeur' do + expect(rendered).to have_text("Les services de l’INSEE sont indisponibles") + end + end + end end