From c4e78be77e14053696e5628c899f95ff3566f9b9 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 14:46:45 +0100 Subject: [PATCH 01/21] form: increase hr visibility --- app/assets/stylesheets/new_design/forms.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index 62d37cb09..450cb1aa6 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -18,7 +18,7 @@ margin-top: $default-padding; margin-bottom: 2 * $default-padding; border: none; - border-bottom: 1px solid $border-grey; + border-bottom: 2px solid $border-grey; } @mixin notice-text-style { From 44e3a70db5a197bc2730570142a31280518e7c5a Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 13:47:00 +0000 Subject: [PATCH 02/21] form: increase section title visibility --- app/assets/stylesheets/new_design/forms.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index 450cb1aa6..a943b2d82 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -304,10 +304,11 @@ } .header-section { + display: inline-block; color: $blue; - font-weight: bold; - font-size: 20px; + font-size: 30px; margin-bottom: 2 * $default-padding; + border-bottom: 3px solid $blue; } .explication-libelle { From 469f4dc6f720b3e5701a9cbc0e077c1572c48aa4 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 15:33:40 +0100 Subject: [PATCH 03/21] form: remove dead code --- app/assets/stylesheets/new_design/forms.scss | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index a943b2d82..78f82d67d 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -389,15 +389,4 @@ margin-right: 0; } } - - .pj-input { - input[type=file] { - margin: $default-padding 0 (2 * $default-padding); - padding: 2px; - } - - .piece-description { - margin-bottom: $default-padding; - } - } } From 25320913021bb6c8e7e46940ba605915ca7181d0 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 15:43:21 +0100 Subject: [PATCH 04/21] form: improve wording of repetition blocks controls --- app/views/champs/repetition/_show.html.haml | 5 +++-- .../shared/dossiers/editable_champs/_repetition.html.haml | 8 ++++---- spec/features/users/brouillon_spec.rb | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/champs/repetition/_show.html.haml b/app/views/champs/repetition/_show.html.haml index 8b3240829..045f82cbd 100644 --- a/app/views/champs/repetition/_show.html.haml +++ b/app/views/champs/repetition/_show.html.haml @@ -7,5 +7,6 @@ = render partial: "shared/dossiers/editable_champs/editable_champ", locals: { champ: champ, form: form } = form.hidden_field :id = form.hidden_field :_destroy, disabled: true - %button.button.danger.remove-row - Supprimer + .flex.row-reverse + %button.button.danger.remove-row + Supprimer l’élément diff --git a/app/views/shared/dossiers/editable_champs/_repetition.html.haml b/app/views/shared/dossiers/editable_champs/_repetition.html.haml index f2e890c9e..8fd77e177 100644 --- a/app/views/shared/dossiers/editable_champs/_repetition.html.haml +++ b/app/views/shared/dossiers/editable_champs/_repetition.html.haml @@ -8,16 +8,16 @@ .flex.row-reverse - if champ.persisted? %button.button.danger.remove-row{ type: :button } - Supprimer + Supprimer l’élément - else %button.button.danger{ type: :button } - Supprimer + Supprimer l’élément - if champ.persisted? = link_to champs_repetition_path(form.index), class: 'button add-row', data: { remote: true, method: 'POST', params: { champ_id: champ&.id }.to_query } do %span.icon.add - Ajouter une ligne pour « #{champ.libelle} » + Ajouter un élément pour « #{champ.libelle} » - else %a.button.add-row %span.icon.add - Ajouter une ligne pour « #{champ.libelle} » + Ajouter un élément pour « #{champ.libelle} » diff --git a/spec/features/users/brouillon_spec.rb b/spec/features/users/brouillon_spec.rb index f74f6c4f4..3acd1adc2 100644 --- a/spec/features/users/brouillon_spec.rb +++ b/spec/features/users/brouillon_spec.rb @@ -107,7 +107,7 @@ feature 'The user' do fill_in('text', with: 'super texte') expect(page).to have_field('text', with: 'super texte') - click_on 'Ajouter une ligne pour' + click_on 'Ajouter un élément pour' within '.row-1' do fill_in('text', with: 'un autre texte') @@ -120,7 +120,7 @@ feature 'The user' do expect(page).to have_content('Supprimer', count: 2) within '.row-1' do - click_on 'Supprimer' + click_on 'Supprimer l’élément' end click_on 'Enregistrer le brouillon' From 58b4c2e53bd88ae1a09dfc46b78bd7e593f6145e Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 14:59:00 +0000 Subject: [PATCH 05/21] form: add a $default-fields-spacer constant --- app/assets/stylesheets/new_design/_constants.scss | 1 + app/assets/stylesheets/new_design/forms.scss | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/new_design/_constants.scss b/app/assets/stylesheets/new_design/_constants.scss index dfc87c788..548028022 100644 --- a/app/assets/stylesheets/new_design/_constants.scss +++ b/app/assets/stylesheets/new_design/_constants.scss @@ -3,6 +3,7 @@ $small-page-width: 840px; $default-spacer: 8px; $default-padding: 2 * $default-spacer; +$default-fields-spacer: 4 * $default-spacer; // layouts $two-columns-padding: 60px; diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index 78f82d67d..591e8a432 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -16,7 +16,7 @@ width: 100%; height: 0; margin-top: $default-padding; - margin-bottom: 2 * $default-padding; + margin-bottom: $default-fields-spacer; border: none; border-bottom: 2px solid $border-grey; } @@ -109,7 +109,7 @@ select, .attachment { display: block; - margin-bottom: 2 * $default-padding; + margin-bottom: $default-fields-spacer; &.small-margin { margin-bottom: $default-padding / 2; @@ -117,7 +117,7 @@ } .add-row { - margin-bottom: 2 * $default-padding; + margin-bottom: $default-fields-spacer; } input[type=checkbox] { @@ -184,7 +184,7 @@ margin-left: 5px; margin-right: 4px; - margin-bottom: 2 * $default-padding; + margin-bottom: $default-fields-spacer; } input[type=checkbox] { @@ -234,7 +234,7 @@ .select2-container { display: block; - margin-bottom: 2 * $default-padding; + margin-bottom: $default-fields-spacer; &.select2-container--focus { .select2-selection { @@ -307,7 +307,7 @@ display: inline-block; color: $blue; font-size: 30px; - margin-bottom: 2 * $default-padding; + margin-bottom: $default-fields-spacer; border-bottom: 3px solid $blue; } From 00b1eaff410539f24f84098d47cccfc641d73b6d Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 15:59:36 +0100 Subject: [PATCH 06/21] form: increase spacing between fields --- app/assets/stylesheets/new_design/_constants.scss | 2 +- app/assets/stylesheets/new_design/forms.scss | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/new_design/_constants.scss b/app/assets/stylesheets/new_design/_constants.scss index 548028022..02558f175 100644 --- a/app/assets/stylesheets/new_design/_constants.scss +++ b/app/assets/stylesheets/new_design/_constants.scss @@ -3,7 +3,7 @@ $small-page-width: 840px; $default-spacer: 8px; $default-padding: 2 * $default-spacer; -$default-fields-spacer: 4 * $default-spacer; +$default-fields-spacer: 5 * $default-spacer; // layouts $two-columns-padding: 60px; diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index 591e8a432..04e7c5f42 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -86,6 +86,14 @@ left: 0px; } } + + // When the (eventual) notice is displayed after the input, give it some bottom margin + &.editable-champ-checkbox, + &.editable-champ-engagement { + .notice { + margin-bottom: $default-fields-spacer; + } + } } .radios { @@ -307,7 +315,7 @@ display: inline-block; color: $blue; font-size: 30px; - margin-bottom: $default-fields-spacer; + margin-bottom: 3 * $default-padding; border-bottom: 3px solid $blue; } @@ -318,7 +326,7 @@ } .explication { - margin-bottom: $default-padding; + margin-bottom: $default-fields-spacer; padding: $default-padding / 2; background-color: $light-grey; From 8693ca3e3a1a7af8457ca3451574ae7704a08f94 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 15:00:01 +0000 Subject: [PATCH 07/21] form: increase the font size of labels and notices --- app/assets/stylesheets/new_design/forms.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index 04e7c5f42..4b87c329c 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -22,7 +22,7 @@ } @mixin notice-text-style { - font-size: 14px; + font-size: 16px; color: $grey; } @@ -31,6 +31,7 @@ } label { + font-size: 18px; margin-bottom: $default-padding; display: block; font-weight: bold; @@ -45,7 +46,6 @@ .notice { @include notice-text-style; - font-weight: bold; margin-top: - $default-spacer; margin-bottom: $default-padding; @@ -82,7 +82,7 @@ input[type=checkbox], input[type=radio] { position: absolute; - top: 1px; + top: 3px; left: 0px; } } From 005ff4bed551422ecccf830819c2564e160ece72 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 16:44:37 +0100 Subject: [PATCH 08/21] form: fix the bottom margin of the siret element --- app/assets/stylesheets/new_design/forms.scss | 7 +++++++ app/views/shared/dossiers/editable_champs/_siret.html.haml | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index 4b87c329c..dba44beca 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -335,6 +335,13 @@ } } + .siret-info { + margin-top: -$default-fields-spacer; + margin-bottom: $default-fields-spacer; + // Ensure the bottom-margin is not collapsed when the element is empty + min-height: 1px; + } + .send-wrapper { display: flex; width: 100%; diff --git a/app/views/shared/dossiers/editable_champs/_siret.html.haml b/app/views/shared/dossiers/editable_champs/_siret.html.haml index a2c27ad80..b62efa342 100644 --- a/app/views/shared/dossiers/editable_champs/_siret.html.haml +++ b/app/views/shared/dossiers/editable_champs/_siret.html.haml @@ -1,11 +1,10 @@ = form.text_field :value, placeholder: champ.libelle, - class: 'small-margin', data: { remote: true, debounce: true, url: champs_siret_path(form.index), params: { champ_id: champ&.id }.to_query, spinner: true }, required: champ.mandatory?, pattern: "[0-9]{14}", title: "Le numéro de SIRET doit comporter exactement 14 chiffres" .spinner.right.hidden -%div{ class: "siret-info-#{form.index}" } +.siret-info{ class: "siret-info-#{form.index}" } - if champ.etablissement.present? = render partial: 'shared/dossiers/editable_champs/etablissement_titre', locals: { etablissement: champ.etablissement } From 2b470137984ca9a85212c7cd976a0bc44c145507 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 17:42:49 +0000 Subject: [PATCH 09/21] form: improve the appearance of the repetitions header --- app/assets/stylesheets/new_design/forms.scss | 6 ++++++ .../dossiers/editable_champs/_editable_champ.html.haml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index dba44beca..b400aed14 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -319,6 +319,12 @@ border-bottom: 3px solid $blue; } + .header-subsection { + font-size: 22px; + color: $blue; + margin-bottom: $default-padding; + } + .explication-libelle { font-weight: bold; font-size: 20px; diff --git a/app/views/shared/dossiers/editable_champs/_editable_champ.html.haml b/app/views/shared/dossiers/editable_champs/_editable_champ.html.haml index 156fd5699..1d7b79355 100644 --- a/app/views/shared/dossiers/editable_champs/_editable_champ.html.haml +++ b/app/views/shared/dossiers/editable_champs/_editable_champ.html.haml @@ -1,9 +1,9 @@ .editable-champ{ class: "editable-champ-#{champ.type_champ}" } - if champ.repetition? - = render partial: 'shared/dossiers/editable_champs/header_section', locals: { champ: champ } - + %h3.header-subsection= champ.libelle - if champ.description.present? %p.notice= string_to_html(champ.description, false) + - elsif has_label?(champ) = render partial: 'shared/dossiers/editable_champs/champ_label', locals: { form: form, champ: champ, seen_at: defined?(seen_at) ? seen_at : nil } From f42977e40a269a45a53a09e726ddb7ee825983fe Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 19:15:42 +0100 Subject: [PATCH 10/21] form: add number to section headers --- app/models/champs/header_section_champ.rb | 7 +++++ .../editable_champs/_header_section.html.haml | 4 +++ .../champs/header_section_champ_spec.rb | 26 +++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 spec/models/champs/header_section_champ_spec.rb diff --git a/app/models/champs/header_section_champ.rb b/app/models/champs/header_section_champ.rb index 95df5d03d..47ec93eb4 100644 --- a/app/models/champs/header_section_champ.rb +++ b/app/models/champs/header_section_champ.rb @@ -2,4 +2,11 @@ class Champs::HeaderSectionChamp < Champ def search_terms # The user cannot enter any information here so it doesn’t make much sense to search end + + def section_index + dossier + .champs + .filter { |c| c.type_champ == TypeDeChamp.type_champs.fetch(:header_section) } + .index(self) + 1 + end end diff --git a/app/views/shared/dossiers/editable_champs/_header_section.html.haml b/app/views/shared/dossiers/editable_champs/_header_section.html.haml index 16c6c6c9f..108300647 100644 --- a/app/views/shared/dossiers/editable_champs/_header_section.html.haml +++ b/app/views/shared/dossiers/editable_champs/_header_section.html.haml @@ -1,2 +1,6 @@ +- section_index = champ.section_index + %h2.header-section + - if section_index + = "#{section_index}." = champ.libelle diff --git a/spec/models/champs/header_section_champ_spec.rb b/spec/models/champs/header_section_champ_spec.rb new file mode 100644 index 000000000..99b678241 --- /dev/null +++ b/spec/models/champs/header_section_champ_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe Champs::CheckboxChamp do + let(:types_de_champ) do + [ + create(:type_de_champ_header_section), + create(:type_de_champ_civilite), + create(:type_de_champ_text), + create(:type_de_champ_header_section), + create(:type_de_champ_email) + ] + end + + let(:procedure) { create(:procedure, types_de_champ: types_de_champ) } + let(:dossier) { create(:dossier, procedure: procedure) } + + describe '#section_index' do + let(:first_header) { dossier.champs[0] } + let(:second_header) { dossier.champs[3] } + + it 'returns the index of the section (starting from 1)' do + expect(first_header.section_index).to eq 1 + expect(second_header.section_index).to eq 2 + end + end +end From 1531b69f5af5508bca3c279de98a726e8bbe75e7 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 10 Feb 2020 18:16:00 +0000 Subject: [PATCH 11/21] form: make the radio button larger and hoverable As a bonus, the implementation of vertical radio buttons is now closer from the default horizontal one. --- app/assets/stylesheets/new_design/forms.scss | 72 ++++++++++++++----- .../procedures/_informations.html.haml | 13 ++-- app/views/root/patron.html.haml | 20 +++--- 3 files changed, 71 insertions(+), 34 deletions(-) diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/new_design/forms.scss index b400aed14..b4dc35d07 100644 --- a/app/assets/stylesheets/new_design/forms.scss +++ b/app/assets/stylesheets/new_design/forms.scss @@ -70,26 +70,21 @@ visibility: visible; } - // Align checkboxes on the top-left side of the label + // Move checkbox to the top-left side of the label &.editable-champ-checkbox, - &.editable-champ-radio.vertical, &.editable-champ-engagement { p, label { padding-left: 28px; } - input[type=checkbox], - input[type=radio] { + input[type=checkbox] { position: absolute; top: 3px; left: 0px; } - } - // When the (eventual) notice is displayed after the input, give it some bottom margin - &.editable-champ-checkbox, - &.editable-champ-engagement { + // When an (eventual) notice is displayed after the input, give it some bottom margin. .notice { margin-bottom: $default-fields-spacer; } @@ -97,13 +92,58 @@ } .radios { + display: flex; + + // Horizontal layout (default) + flex-direction: row; + align-items: flex-start; + label { - display: inline; - margin-left: $default-padding; + margin-right: $default-padding; + } + + // Vertical layout + &.vertical { + flex-direction: column; + align-items: stretch; + + label { + margin-right: 0; + } + } + + label { + padding: $default-padding $default-padding $default-padding $default-spacer; + border: 1px solid $border-grey; + border-radius: 4px; + font-weight: normal; + background: $white; + user-select: none; + + &:last-of-type { + margin-bottom: $default-fields-spacer; + } + + &:hover { + background: $light-grey; + cursor: pointer; + } + + &:active { + border-color: darken($border-grey, 10); + } &:first-child { margin-left: 0; } + + input[type=radio] { + margin-bottom: 0; + } + + .notice { + margin: 4px 0 0 27px; + } } } @@ -190,16 +230,14 @@ input[type=radio] { @extend %outline; - margin-left: 5px; - margin-right: 4px; - margin-bottom: $default-fields-spacer; - } - - input[type=checkbox] { - // Firefox tends to display checkbox controls smaller than other browsers. + // Firefox tends to display some controls smaller than other browsers. // Ensure a consistency of size between browsers. width: 16px; height: 16px; + + margin-left: 5px; + margin-right: 4px; + margin-bottom: $default-fields-spacer; } input[type=date] { diff --git a/app/views/new_administrateur/procedures/_informations.html.haml b/app/views/new_administrateur/procedures/_informations.html.haml index 2906bf359..be435258a 100644 --- a/app/views/new_administrateur/procedures/_informations.html.haml +++ b/app/views/new_administrateur/procedures/_informations.html.haml @@ -78,18 +78,17 @@ - if !@procedure.locked? %h2.header-section À qui s’adresse ma démarche ? - .editable-champ.editable-champ-radio.vertical + .radios.vertical = f.label :for_individual, value: true do + = f.radio_button :for_individual, true Ma démarche s’adresse à un particulier - %p.notice En choisissant cette option, l’usager devra renseigner son nom et prénom avant d’accéder au formulaire - = f.radio_button :for_individual, true + %p.notice En choisissant cette option, l’usager devra renseigner son nom et prénom avant d’accéder au formulaire - .editable-champ.editable-champ-radio.vertical = f.label :for_individual, value: false do + = f.radio_button :for_individual, false Ma démarche s’adresse à une personne morale - %p.notice - En choisissant cette option, l’usager devra renseigner son n° SIRET.
Grâce à l’API Entreprise, les informations sur la personne morale (raison sociale, adresse du siège, etc.) seront automatiquement renseignées. - = f.radio_button :for_individual, false + %p.notice + En choisissant cette option, l’usager devra renseigner son n° SIRET.
Grâce à l’API Entreprise, les informations sur la personne morale (raison sociale, adresse du siège, etc.) seront automatiquement renseignées. %p.explication Si votre démarche s’adresse indifféremment à une personne morale ou un particulier, choisissez l'option « Particuliers ». Vous pourrez ajouter un champ SIRET directement dans le formulaire. diff --git a/app/views/root/patron.html.haml b/app/views/root/patron.html.haml index 55112f50f..507cb1ee1 100644 --- a/app/views/root/patron.html.haml +++ b/app/views/root/patron.html.haml @@ -52,16 +52,16 @@ %label Mot de passe %input{ type: "password", value: "12345678" } - %h2.header-section Bouton radio verticaux - .editable-champ.editable-champ-radio.vertical - = f.label :archived, 'Option A', value: true - %p.notice Une option tout à fait valable. - = f.radio_button :archived, true - - .editable-champ.editable-champ-radio.vertical - = f.label :archived, 'Option B', value: false - %p.notice Une autre option, pas mal non plus. - = f.radio_button :archived, false + %h3.header-subsection Bouton radio verticaux + .radios.vertical + = f.label :archived, value: true do + = f.radio_button :archived, true + Option A + %p.notice Une option tout à fait valable. + = f.label :archived, value: false do + = f.radio_button :archived, false + Option B + %p.notice Une autre option, pas mal non plus. .send-wrapper = f.submit 'Enregistrer un brouillon (formnovalidate)', formnovalidate: true, class: 'button send' From c517d22369913878152546dcfe84aa081cd2eec2 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 11 Feb 2020 13:56:06 +0100 Subject: [PATCH 12/21] form: avoid outlining disabled controls on click --- app/assets/stylesheets/new_design/_placeholders.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/new_design/_placeholders.scss b/app/assets/stylesheets/new_design/_placeholders.scss index 2dc8cbaad..41c1d3f8b 100644 --- a/app/assets/stylesheets/new_design/_placeholders.scss +++ b/app/assets/stylesheets/new_design/_placeholders.scss @@ -20,7 +20,7 @@ } %outline { - &:active, + &:active:not(:disabled), &:focus { outline: 3px solid $blue; } From 8a514e07137ac2c44ae467e95c4d0b7f480cc890 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 5 Feb 2020 17:30:06 +0100 Subject: [PATCH 13/21] Fix avis linked dossiers invitation checkbox fix #4678 --- app/views/instructeurs/shared/avis/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/instructeurs/shared/avis/_form.html.haml b/app/views/instructeurs/shared/avis/_form.html.haml index 1588633e3..b86172d8b 100644 --- a/app/views/instructeurs/shared/avis/_form.html.haml +++ b/app/views/instructeurs/shared/avis/_form.html.haml @@ -7,7 +7,7 @@ = f.text_area :introduction, rows: 3, value: avis.introduction || 'Bonjour, merci de me donner votre avis sur ce dossier.', required: true - if linked_dossiers.present? - = f.check_box :invite_linked_dossiers, value: false + = f.check_box :invite_linked_dossiers, {}, true, false = f.label :invite_linked_dossiers, t('helpers.label.invite_linked_dossiers', count: linked_dossiers.length, ids: linked_dossiers.map(&:id).to_sentence) .flex.justify-between.align-baseline From f0ea96772d8acf32deac7d9d992ab558c914be76 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 5 Feb 2020 17:38:24 +0100 Subject: [PATCH 14/21] Only invite experts to dossiers instructeur have access to --- .../concerns/create_avis_concern.rb | 2 +- app/models/dossier.rb | 4 +++ .../instructeurs/avis/instruction.html.haml | 2 +- .../instructeurs/dossiers/avis.html.haml | 2 +- .../instructeurs/avis_controller_spec.rb | 26 ++++++++++++++----- spec/factories/dossier.rb | 2 +- spec/features/instructeurs/expert_spec.rb | 3 +++ 7 files changed, 31 insertions(+), 10 deletions(-) diff --git a/app/controllers/concerns/create_avis_concern.rb b/app/controllers/concerns/create_avis_concern.rb index 81c7dd3a9..e12f007ef 100644 --- a/app/controllers/concerns/create_avis_concern.rb +++ b/app/controllers/concerns/create_avis_concern.rb @@ -14,7 +14,7 @@ module CreateAvisConcern allowed_dossiers = [dossier] if create_avis_params[:invite_linked_dossiers].present? - allowed_dossiers += dossier.linked_dossiers + allowed_dossiers += dossier.linked_dossiers_for(current_instructeur) end create_results = Avis.create( diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 8a9b41352..e582f31ca 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -588,6 +588,10 @@ class Dossier < ApplicationRecord Dossier.where(id: champs.filter(&:dossier_link?).map(&:value).compact) end + def linked_dossiers_for(instructeur) + instructeur.dossiers.where(id: champs.filter(&:dossier_link?).map(&:value).compact) + end + def hash_for_deletion_mail { id: self.id, procedure_libelle: self.procedure.libelle } end diff --git a/app/views/instructeurs/avis/instruction.html.haml b/app/views/instructeurs/avis/instruction.html.haml index 713082704..62344dcc9 100644 --- a/app/views/instructeurs/avis/instruction.html.haml +++ b/app/views/instructeurs/avis/instruction.html.haml @@ -31,7 +31,7 @@ = f.submit 'Envoyer votre avis', class: 'button send' - if !@dossier.termine? - = render partial: "instructeurs/shared/avis/form", locals: { url: avis_instructeur_avis_path(@avis), linked_dossiers: @dossier.linked_dossiers, must_be_confidentiel: @avis.confidentiel?, avis: @new_avis } + = render partial: "instructeurs/shared/avis/form", locals: { url: avis_instructeur_avis_path(@avis), linked_dossiers: @dossier.linked_dossiers_for(current_instructeur), must_be_confidentiel: @avis.confidentiel?, avis: @new_avis } - if @dossier.avis_for(current_instructeur).present? = render partial: 'instructeurs/shared/avis/list', locals: { avis: @dossier.avis_for(current_instructeur), avis_seen_at: nil } diff --git a/app/views/instructeurs/dossiers/avis.html.haml b/app/views/instructeurs/dossiers/avis.html.haml index 65d661582..6b84208ce 100644 --- a/app/views/instructeurs/dossiers/avis.html.haml +++ b/app/views/instructeurs/dossiers/avis.html.haml @@ -4,7 +4,7 @@ .container - if !@dossier.termine? - = render partial: "instructeurs/shared/avis/form", locals: { url: avis_instructeur_dossier_path(@dossier.procedure, @dossier), linked_dossiers: @dossier.linked_dossiers, must_be_confidentiel: false, avis: @avis } + = render partial: "instructeurs/shared/avis/form", locals: { url: avis_instructeur_dossier_path(@dossier.procedure, @dossier), linked_dossiers: @dossier.linked_dossiers_for(current_instructeur), must_be_confidentiel: false, avis: @avis } - if @dossier.avis.present? = render partial: 'instructeurs/shared/avis/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at } diff --git a/spec/controllers/instructeurs/avis_controller_spec.rb b/spec/controllers/instructeurs/avis_controller_spec.rb index 1c7c9d007..a071a0cef 100644 --- a/spec/controllers/instructeurs/avis_controller_spec.rb +++ b/spec/controllers/instructeurs/avis_controller_spec.rb @@ -196,16 +196,30 @@ describe Instructeurs::AvisController, type: :controller do context 'checked' do let(:invite_linked_dossiers) { true } - let(:created_avis) { Avis.last(2).first } - let(:linked_avis) { Avis.last } - let(:linked_dossier) { dossier.reload.linked_dossiers.first } - it do + context 'and can access linked dossiers' do + let(:created_avis) { Avis.last(2).first } + let(:linked_avis) { Avis.last } + let(:linked_dossier) { dossier.reload.linked_dossiers.first } + let(:invite_linked_dossiers) do + instructeur.assign_to_procedure(linked_dossier.procedure) + true + end + + it 'sends two avis invitations' do + expect(flash.notice).to eq("Une demande d'avis a été envoyée à a@b.com") + expect(Avis.count).to eq(old_avis_count + 2) + expect(created_avis.email).to eq("a@b.com") + expect(created_avis.dossier).to eq(dossier) + expect(linked_avis.dossier).to eq(linked_dossier) + end + end + + it 'and can not access linked dossiers' do expect(flash.notice).to eq("Une demande d'avis a été envoyée à a@b.com") - expect(Avis.count).to eq(old_avis_count + 2) + expect(Avis.count).to eq(old_avis_count + 1) expect(created_avis.email).to eq("a@b.com") expect(created_avis.dossier).to eq(dossier) - expect(linked_avis.dossier).to eq(linked_dossier) end end end diff --git a/spec/factories/dossier.rb b/spec/factories/dossier.rb index c0b563521..1316e8d81 100644 --- a/spec/factories/dossier.rb +++ b/spec/factories/dossier.rb @@ -68,7 +68,7 @@ FactoryBot.define do trait :with_dossier_link do after(:create) do |dossier, _evaluator| # create linked dossier - linked_dossier = create(:dossier) + linked_dossier = create(:dossier, :en_construction) # find first type de champ dossier_link type_de_champ = dossier.procedure.types_de_champ.find do |t| diff --git a/spec/features/instructeurs/expert_spec.rb b/spec/features/instructeurs/expert_spec.rb index abb43423e..0ba386e4f 100644 --- a/spec/features/instructeurs/expert_spec.rb +++ b/spec/features/instructeurs/expert_spec.rb @@ -12,6 +12,9 @@ feature 'Inviting an expert:' do context 'as an Instructeur' do scenario 'I can invite an expert' do + # assign instructeur to linked dossier + instructeur.assign_to_procedure(dossier.reload.linked_dossiers.first.procedure) + login_as instructeur.user, scope: :user visit instructeur_dossier_path(procedure, dossier) From 5d0a8b567fb27d8ff175f8de5a4bf0c47e134ccc Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 11 Feb 2020 17:18:49 +0100 Subject: [PATCH 15/21] specs: improve description of Avis creation test cases --- .../instructeurs/avis_controller_spec.rb | 37 ++++++++----- .../instructeurs/dossiers_controller_spec.rb | 54 ++++++++++++++++++- 2 files changed, 76 insertions(+), 15 deletions(-) diff --git a/spec/controllers/instructeurs/avis_controller_spec.rb b/spec/controllers/instructeurs/avis_controller_spec.rb index a071a0cef..490668834 100644 --- a/spec/controllers/instructeurs/avis_controller_spec.rb +++ b/spec/controllers/instructeurs/avis_controller_spec.rb @@ -187,17 +187,21 @@ describe Instructeurs::AvisController, type: :controller do let(:previous_avis_confidentiel) { false } let(:dossier) { create(:dossier, :en_construction, :with_dossier_link, procedure: procedure) } - it do - expect(flash.notice).to eq("Une demande d'avis a été envoyée à a@b.com") - expect(Avis.count).to eq(old_avis_count + 1) - expect(created_avis.email).to eq("a@b.com") - expect(created_avis.dossier).to eq(dossier) + context 'when the expert doesn’t share linked dossiers' do + let(:invite_linked_dossiers) { false } + + it 'sends a single avis for the main dossier, but doesn’t give access to the linked dossiers' do + expect(flash.notice).to eq("Une demande d'avis a été envoyée à a@b.com") + expect(Avis.count).to eq(old_avis_count + 1) + expect(created_avis.email).to eq("a@b.com") + expect(created_avis.dossier).to eq(dossier) + end end - context 'checked' do + context 'when the expert also shares the linked dossiers' do let(:invite_linked_dossiers) { true } - context 'and can access linked dossiers' do + context 'and the expert can access the linked dossiers' do let(:created_avis) { Avis.last(2).first } let(:linked_avis) { Avis.last } let(:linked_dossier) { dossier.reload.linked_dossiers.first } @@ -206,20 +210,25 @@ describe Instructeurs::AvisController, type: :controller do true end - it 'sends two avis invitations' do + it 'sends one avis for the main dossier' do expect(flash.notice).to eq("Une demande d'avis a été envoyée à a@b.com") - expect(Avis.count).to eq(old_avis_count + 2) expect(created_avis.email).to eq("a@b.com") expect(created_avis.dossier).to eq(dossier) + end + + it 'sends another avis for the linked dossiers' do + expect(Avis.count).to eq(old_avis_count + 2) expect(linked_avis.dossier).to eq(linked_dossier) end end - it 'and can not access linked dossiers' do - expect(flash.notice).to eq("Une demande d'avis a été envoyée à a@b.com") - expect(Avis.count).to eq(old_avis_count + 1) - expect(created_avis.email).to eq("a@b.com") - expect(created_avis.dossier).to eq(dossier) + context 'but the expert can’t access the linked dossier' do + it 'sends a single avis for the main dossier, but doesn’t give access to the linked dossiers' do + expect(flash.notice).to eq("Une demande d'avis a été envoyée à a@b.com") + expect(Avis.count).to eq(old_avis_count + 1) + expect(created_avis.email).to eq("a@b.com") + expect(created_avis.dossier).to eq(dossier) + end end end end diff --git a/spec/controllers/instructeurs/dossiers_controller_spec.rb b/spec/controllers/instructeurs/dossiers_controller_spec.rb index f080ab548..032c986cb 100644 --- a/spec/controllers/instructeurs/dossiers_controller_spec.rb +++ b/spec/controllers/instructeurs/dossiers_controller_spec.rb @@ -430,6 +430,7 @@ describe Instructeurs::DossiersController, type: :controller do end describe "#create_avis" do + let(:invite_linked_dossiers) { false } let(:saved_avis) { dossier.avis.first } let!(:old_avis_count) { Avis.count } @@ -437,7 +438,7 @@ describe Instructeurs::DossiersController, type: :controller do post :create_avis, params: { procedure_id: procedure.id, dossier_id: dossier.id, - avis: { emails: emails, introduction: 'intro', confidentiel: true } + avis: { emails: emails, introduction: 'intro', confidentiel: true, invite_linked_dossiers: invite_linked_dossiers } } end @@ -471,6 +472,57 @@ describe Instructeurs::DossiersController, type: :controller do it { expect(Avis.count).to eq(old_avis_count + 1) } it { expect(saved_avis.email).to eq("titi@titimail.com") } end + + context 'with linked dossiers' do + let(:asked_confidentiel) { false } + let(:previous_avis_confidentiel) { false } + let(:dossier) { create(:dossier, :en_construction, :with_dossier_link, procedure: procedure) } + + context 'when the expert doesn’t share linked dossiers' do + let(:invite_linked_dossiers) { false } + + it 'sends a single avis for the main dossier, but doesn’t give access to the linked dossiers' do + expect(flash.notice).to eq("Une demande d'avis a été envoyée à email@a.com") + expect(Avis.count).to eq(old_avis_count + 1) + expect(saved_avis.email).to eq("email@a.com") + expect(saved_avis.dossier).to eq(dossier) + end + end + + context 'when the expert also shares the linked dossiers' do + let(:invite_linked_dossiers) { true } + + context 'and the expert can access the linked dossiers' do + let(:saved_avis) { Avis.last(2).first } + let(:linked_avis) { Avis.last } + let(:linked_dossier) { dossier.reload.linked_dossiers.first } + let(:invite_linked_dossiers) do + instructeur.assign_to_procedure(linked_dossier.procedure) + true + end + + it 'sends one avis for the main dossier' do + expect(flash.notice).to eq("Une demande d'avis a été envoyée à email@a.com") + expect(saved_avis.email).to eq("email@a.com") + expect(saved_avis.dossier).to eq(dossier) + end + + it 'sends another avis for the linked dossiers' do + expect(Avis.count).to eq(old_avis_count + 2) + expect(linked_avis.dossier).to eq(linked_dossier) + end + end + + context 'but the expert can’t access the linked dossier' do + it 'sends a single avis for the main dossier, but doesn’t give access to the linked dossiers' do + expect(flash.notice).to eq("Une demande d'avis a été envoyée à email@a.com") + expect(Avis.count).to eq(old_avis_count + 1) + expect(saved_avis.email).to eq("email@a.com") + expect(saved_avis.dossier).to eq(dossier) + end + end + end + end end describe "#show" do From 0d55743d9f6410215e1d79cd304987b28f160773 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 11 Feb 2020 17:30:21 +0100 Subject: [PATCH 16/21] linked_dossiers_for should include dossiers_from_avis --- app/models/dossier.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index e582f31ca..ec032c52a 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -589,7 +589,8 @@ class Dossier < ApplicationRecord end def linked_dossiers_for(instructeur) - instructeur.dossiers.where(id: champs.filter(&:dossier_link?).map(&:value).compact) + dossier_ids = champs.filter(&:dossier_link?).map(&:value).compact + (instructeur.dossiers.where(id: dossier_ids) + instructeur.dossiers_from_avis.where(id: dossier_ids)).uniq end def hash_for_deletion_mail From 7afeae14083f0237dddd9df1e52d04a60ece2b79 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 11 Feb 2020 17:38:04 +0100 Subject: [PATCH 17/21] remove dossier.linked_dossiers --- app/models/dossier.rb | 4 ---- spec/controllers/instructeurs/avis_controller_spec.rb | 2 +- spec/controllers/instructeurs/dossiers_controller_spec.rb | 2 +- spec/features/instructeurs/expert_spec.rb | 3 ++- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index ec032c52a..83de9b532 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -584,10 +584,6 @@ class Dossier < ApplicationRecord !PiecesJustificativesService.liste_pieces_justificatives(self).empty? && PiecesJustificativesService.pieces_justificatives_total_size(self) < Dossier::TAILLE_MAX_ZIP end - def linked_dossiers - Dossier.where(id: champs.filter(&:dossier_link?).map(&:value).compact) - end - def linked_dossiers_for(instructeur) dossier_ids = champs.filter(&:dossier_link?).map(&:value).compact (instructeur.dossiers.where(id: dossier_ids) + instructeur.dossiers_from_avis.where(id: dossier_ids)).uniq diff --git a/spec/controllers/instructeurs/avis_controller_spec.rb b/spec/controllers/instructeurs/avis_controller_spec.rb index 490668834..e0ea52292 100644 --- a/spec/controllers/instructeurs/avis_controller_spec.rb +++ b/spec/controllers/instructeurs/avis_controller_spec.rb @@ -204,7 +204,7 @@ describe Instructeurs::AvisController, type: :controller do context 'and the expert can access the linked dossiers' do let(:created_avis) { Avis.last(2).first } let(:linked_avis) { Avis.last } - let(:linked_dossier) { dossier.reload.linked_dossiers.first } + let(:linked_dossier) { Dossier.find_by(id: dossier.reload.champs.filter(&:dossier_link?).map(&:value).compact) } let(:invite_linked_dossiers) do instructeur.assign_to_procedure(linked_dossier.procedure) true diff --git a/spec/controllers/instructeurs/dossiers_controller_spec.rb b/spec/controllers/instructeurs/dossiers_controller_spec.rb index 032c986cb..80e0afe42 100644 --- a/spec/controllers/instructeurs/dossiers_controller_spec.rb +++ b/spec/controllers/instructeurs/dossiers_controller_spec.rb @@ -495,7 +495,7 @@ describe Instructeurs::DossiersController, type: :controller do context 'and the expert can access the linked dossiers' do let(:saved_avis) { Avis.last(2).first } let(:linked_avis) { Avis.last } - let(:linked_dossier) { dossier.reload.linked_dossiers.first } + let(:linked_dossier) { Dossier.find_by(id: dossier.reload.champs.filter(&:dossier_link?).map(&:value).compact) } let(:invite_linked_dossiers) do instructeur.assign_to_procedure(linked_dossier.procedure) true diff --git a/spec/features/instructeurs/expert_spec.rb b/spec/features/instructeurs/expert_spec.rb index 0ba386e4f..75dbc8bec 100644 --- a/spec/features/instructeurs/expert_spec.rb +++ b/spec/features/instructeurs/expert_spec.rb @@ -9,11 +9,12 @@ feature 'Inviting an expert:' do let(:expert_password) { 'mot de passe d’expert' } let(:procedure) { create(:procedure, :published, instructeurs: [instructeur]) } let(:dossier) { create(:dossier, :en_construction, :with_dossier_link, procedure: procedure) } + let(:linked_dossier) { Dossier.find_by(id: dossier.reload.champs.filter(&:dossier_link?).map(&:value).compact) } context 'as an Instructeur' do scenario 'I can invite an expert' do # assign instructeur to linked dossier - instructeur.assign_to_procedure(dossier.reload.linked_dossiers.first.procedure) + instructeur.assign_to_procedure(linked_dossier.procedure) login_as instructeur.user, scope: :user visit instructeur_dossier_path(procedure, dossier) From 7ba76c6658e879dd57d47046854ac0e03cc14e8c Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 27 Jan 2020 13:28:23 +0000 Subject: [PATCH 18/21] dossier: add a notice when some attachments of the dossier were lost On the 22/01/2020, a technical error on the demarches-simplifees.fr instance made us delete some files attached to some dossiers. This PR adds a warning when browsing a dossier containing attachments that were deleted. --- app/assets/stylesheets/new_design/card.scss | 12 + app/helpers/dossier_helper.rb | 23 + app/views/shared/dossiers/_demande.html.haml | 2 + .../dossiers/_lost_attachments.html.haml | 27 + config/dossiers-with-lost-attachments.yml | 946 ++++++++++++++++++ spec/helpers/dossier_helper_spec.rb | 29 + .../dossiers/_demande.html.haml_spec.rb | 34 +- 7 files changed, 1061 insertions(+), 12 deletions(-) create mode 100644 app/views/shared/dossiers/_lost_attachments.html.haml create mode 100644 config/dossiers-with-lost-attachments.yml diff --git a/app/assets/stylesheets/new_design/card.scss b/app/assets/stylesheets/new_design/card.scss index 9d2300b16..5506635af 100644 --- a/app/assets/stylesheets/new_design/card.scss +++ b/app/assets/stylesheets/new_design/card.scss @@ -46,6 +46,18 @@ } } + ul { + list-style-type: disc; + list-style-position: inside; + padding-left: $default-padding; + } + + ol { + list-style-type: decimal; + list-style-position: inside; + padding-left: $default-padding; + } + p:not(:last-of-type) { margin-bottom: $default-spacer; } diff --git a/app/helpers/dossier_helper.rb b/app/helpers/dossier_helper.rb index f4dabce51..bd1e6d95f 100644 --- a/app/helpers/dossier_helper.rb +++ b/app/helpers/dossier_helper.rb @@ -69,4 +69,27 @@ module DossierHelper dossier.state end end + + # On the 22/01/2020, a technical error on the demarches-simplifees.fr + # instance caused some files attached to some dossiers to be deleted. + # + # This method returns true if the dossier contained attachments + # whose files were deleted during this incident. + def has_lost_attachments(dossier) + if dinum_instance? + dossiers_with_lost_attachments_ids.include?(dossier.id) + else + false + end + end + + private + + def dinum_instance? + ENV['APP_HOST']&.ends_with?('demarches-simplifiees.fr') + end + + def dossiers_with_lost_attachments_ids + @@ids ||= YAML.load_file(Rails.root.join('config', 'dossiers-with-lost-attachments.yml')) + end end diff --git a/app/views/shared/dossiers/_demande.html.haml b/app/views/shared/dossiers/_demande.html.haml index 55870541c..d8a96eaae 100644 --- a/app/views/shared/dossiers/_demande.html.haml +++ b/app/views/shared/dossiers/_demande.html.haml @@ -24,5 +24,7 @@ .tab-title Formulaire - champs = dossier.champs.includes(:type_de_champ) - if champs.any? || dossier.procedure.routee? + - if has_lost_attachments(dossier) + = render partial: "shared/dossiers/lost_attachments", locals: { dossier: dossier } .card = render partial: "shared/dossiers/champs", locals: { champs: champs, dossier: dossier, demande_seen_at: demande_seen_at, profile: profile } diff --git a/app/views/shared/dossiers/_lost_attachments.html.haml b/app/views/shared/dossiers/_lost_attachments.html.haml new file mode 100644 index 000000000..1195d8edc --- /dev/null +++ b/app/views/shared/dossiers/_lost_attachments.html.haml @@ -0,0 +1,27 @@ +/# FIXME: add a specific wording for Usagers +.card.warning + .card-title Des pièces jointes de ce dossier peuvent être manquantes. + %p + Suite à un incident survenu le 21 janvier, demarche-simplifiees.fr a perdu par erreur une partie des pièces jointes de ce dossier. + + - if dossier.en_construction? + %p + Si une ou plusieurs pièces jointes manquent, nous vous invitons à + = succeed ',' do + = link_to 'contacter le demandeur', messagerie_instructeur_dossier_path(dossier.procedure, dossier) + pour lui demander de + = succeed '.' do + %strong renvoyer les pièces jointes nécessaires + + - else + %p + Si une ou plusieurs pièces jointes essentielles manquent, nous vous invitons à : + %ol + %li repasser ce dossier en construction ; + %li< + = link_to 'contacter le demandeur ', messagerie_instructeur_dossier_path(dossier.procedure, dossier) + pour lui demander de + = succeed '.' do + %strong renvoyer les pièces jointes nécessaires + + %p Le demandeur de ce dossier a également été prévenu. Nous nous excusons pour la gêne occasionnée. diff --git a/config/dossiers-with-lost-attachments.yml b/config/dossiers-with-lost-attachments.yml new file mode 100644 index 000000000..7b0243429 --- /dev/null +++ b/config/dossiers-with-lost-attachments.yml @@ -0,0 +1,946 @@ +# On the 22/01/2020, a technical error on the demarches-simplifees.fr +# instance made us delete some files attached to some dossiers. +# +# This list contains the ids of all dossiers where some attached +# file was mistakenly deleted during this incident. +- 22 +- 9224 +- 9244 +- 9489 +- 9495 +- 11045 +- 14311 +- 14530 +- 14553 +- 14569 +- 14616 +- 14619 +- 15325 +- 15331 +- 16448 +- 17848 +- 18190 +- 18308 +- 18855 +- 18929 +- 18946 +- 18965 +- 19284 +- 19697 +- 19698 +- 19872 +- 20334 +- 20663 +- 20931 +- 21015 +- 21024 +- 21620 +- 21753 +- 21782 +- 21865 +- 21871 +- 21876 +- 21938 +- 21963 +- 21971 +- 22011 +- 22042 +- 22045 +- 22063 +- 22068 +- 22108 +- 22279 +- 22434 +- 22488 +- 22523 +- 24277 +- 25275 +- 26223 +- 26228 +- 27069 +- 27213 +- 29366 +- 29386 +- 29486 +- 31179 +- 31983 +- 32004 +- 32323 +- 32325 +- 32492 +- 32497 +- 35072 +- 35074 +- 35193 +- 35232 +- 35308 +- 35323 +- 35357 +- 35442 +- 35486 +- 35496 +- 35554 +- 35644 +- 36659 +- 38984 +- 39026 +- 39099 +- 39158 +- 39287 +- 39314 +- 39352 +- 39359 +- 39371 +- 39380 +- 39390 +- 39403 +- 39493 +- 39526 +- 41106 +- 41111 +- 43566 +- 43570 +- 43571 +- 43572 +- 43578 +- 43741 +- 43785 +- 43791 +- 43884 +- 43928 +- 43935 +- 43937 +- 44013 +- 44035 +- 45123 +- 48500 +- 48690 +- 52921 +- 53029 +- 53067 +- 53097 +- 53118 +- 53147 +- 53152 +- 53153 +- 53154 +- 53155 +- 53159 +- 53171 +- 53176 +- 53178 +- 53207 +- 53208 +- 53218 +- 53472 +- 53981 +- 54002 +- 56253 +- 57216 +- 57689 +- 58003 +- 58411 +- 58721 +- 59445 +- 59925 +- 61917 +- 62547 +- 62551 +- 62552 +- 62956 +- 63035 +- 63607 +- 63615 +- 65154 +- 66268 +- 66379 +- 66963 +- 67066 +- 68688 +- 68705 +- 68710 +- 68737 +- 68929 +- 68943 +- 69023 +- 69026 +- 69510 +- 69521 +- 69546 +- 70148 +- 70224 +- 72653 +- 76114 +- 79303 +- 79863 +- 79929 +- 79951 +- 79976 +- 80032 +- 84640 +- 93404 +- 98647 +- 99294 +- 101868 +- 103748 +- 104097 +- 107096 +- 109146 +- 113137, +- 113690 +- 113707 +- 113711 +- 113722 +- 113743 +- 117270 +- 118003 +- 119395 +- 120824 +- 121498 +- 124009 +- 125430 +- 127024 +- 130735 +- 132389 +- 132942 +- 133317 +- 133697 +- 137347 +- 137374 +- 137427 +- 137525 +- 137900 +- 138272 +- 138436 +- 138466 +- 138515 +- 138550 +- 138631 +- 138703 +- 138990 +- 139296 +- 139371 +- 140604 +- 140811 +- 141142 +- 141227 +- 148609 +- 153917 +- 156644 +- 157401 +- 184400 +- 190035 +- 191350 +- 193213 +- 193783 +- 194088 +- 198497 +- 200002 +- 200005 +- 200017 +- 200041 +- 200048 +- 200060 +- 200061 +- 200062 +- 200081 +- 200086 +- 200089 +- 200094 +- 200098 +- 200100 +- 200108 +- 200109 +- 200113 +- 200128 +- 200138 +- 200140 +- 200143 +- 200154 +- 200158 +- 200161 +- 200163 +- 200169 +- 200182 +- 200186 +- 200195 +- 200202 +- 200208 +- 200211 +- 200263 +- 200267 +- 200448 +- 200685 +- 200757 +- 200784 +- 200787 +- 201021 +- 201315 +- 201576 +- 201921 +- 201986 +- 202015 +- 203553 +- 203630 +- 204737 +- 204866 +- 204924 +- 204982 +- 205021 +- 205265 +- 205424 +- 205655 +- 205659 +- 205847 +- 205940 +- 205954 +- 205987 +- 206013 +- 206089 +- 206108 +- 206170 +- 206179 +- 206217 +- 206237 +- 206285 +- 206288 +- 206290 +- 206300 +- 206374 +- 206472 +- 206490 +- 206494 +- 206515 +- 206532 +- 206589 +- 206612 +- 206734 +- 206741 +- 206782 +- 206807 +- 206828 +- 206835 +- 206856 +- 206887 +- 206904 +- 206909 +- 206913 +- 206931 +- 206964 +- 206972 +- 206977 +- 206979 +- 206992 +- 207004 +- 207006 +- 207032 +- 207061 +- 207078 +- 207103 +- 207104 +- 207118 +- 207181 +- 207183 +- 207197 +- 207207 +- 207236 +- 207537 +- 207734 +- 207773 +- 208009 +- 208153 +- 208186 +- 208199 +- 208379 +- 208422 +- 208545 +- 208549 +- 208873 +- 208903 +- 209151 +- 209392 +- 209397 +- 209873 +- 210103 +- 210175 +- 210959 +- 211018 +- 211144 +- 211197 +- 211852 +- 212322 +- 212359 +- 212493 +- 212503 +- 212955 +- 212986 +- 213596 +- 213598 +- 213612 +- 213625 +- 213694 +- 213712 +- 213749 +- 214123 +- 214592 +- 215503 +- 215510 +- 215742 +- 215756 +- 216263 +- 216360 +- 216620 +- 217131 +- 217159 +- 217215 +- 217320 +- 217361 +- 217373 +- 217487 +- 217507 +- 217518 +- 217587 +- 217677 +- 217714 +- 217790 +- 217796 +- 217850 +- 217859 +- 217871 +- 217875 +- 218370 +- 218419 +- 219341 +- 220675 +- 221967 +- 222266 +- 222801 +- 222868 +- 222875 +- 222946 +- 222949 +- 222965 +- 223154 +- 223303 +- 223329 +- 223368 +- 224064 +- 224290 +- 225117 +- 227153 +- 227161 +- 227816 +- 227931 +- 228074 +- 228666 +- 228703 +- 228776 +- 228918 +- 228926 +- 229050 +- 229086 +- 229109 +- 229114 +- 229553 +- 230338 +- 230353 +- 230479 +- 230539 +- 230574 +- 230582 +- 231261 +- 232521 +- 232740 +- 232916 +- 232934 +- 232958 +- 233008 +- 233047 +- 233160 +- 233197 +- 233211 +- 233556 +- 233605 +- 233712 +- 235322 +- 236625 +- 237371 +- 237439 +- 237605 +- 238276 +- 239412 +- 239500 +- 239603 +- 239777 +- 239805 +- 239829 +- 239850 +- 239858 +- 241496 +- 241557 +- 241598 +- 241788 +- 241824 +- 241858 +- 241879 +- 241910 +- 241927 +- 241934 +- 241936 +- 241939 +- 241950 +- 241952 +- 241955 +- 241956 +- 241959 +- 241969 +- 241970 +- 241985 +- 241987 +- 241991 +- 241996 +- 242414 +- 242725 +- 242800 +- 242808 +- 242814 +- 242820 +- 242840 +- 242845 +- 242937 +- 242942 +- 242972 +- 242973 +- 242975 +- 242997 +- 243133 +- 243234 +- 243237 +- 243240 +- 243273 +- 243290 +- 243335 +- 243339 +- 243429 +- 245309 +- 245460 +- 247557 +- 248202 +- 248537 +- 248567 +- 248592 +- 248726 +- 248776 +- 249018 +- 249342 +- 249352 +- 249563 +- 250149 +- 250471 +- 250489 +- 250502 +- 250504 +- 250509 +- 250511 +- 250530 +- 251386 +- 252994 +- 254055 +- 254211 +- 254972 +- 255013 +- 255078 +- 255082 +- 255329 +- 255925 +- 255990 +- 256083 +- 256084 +- 256296 +- 256472 +- 257228 +- 258640 +- 258982 +- 259131 +- 259147 +- 259204 +- 261038 +- 261117 +- 261118 +- 261170 +- 261452 +- 263654 +- 264489 +- 265036 +- 265333 +- 265983 +- 266034 +- 266057 +- 266062 +- 266069 +- 266071 +- 266205 +- 267145 +- 267322 +- 267404 +- 267708 +- 268223 +- 268652 +- 268654 +- 268678 +- 268728 +- 268731 +- 268764 +- 268885 +- 269421 +- 269444 +- 269518 +- 269560 +- 269574 +- 269575 +- 270213 +- 272346 +- 272891 +- 273169 +- 274183 +- 274478 +- 274634 +- 274730 +- 275900 +- 279329 +- 279348 +- 280975 +- 281779 +- 281804 +- 282877 +- 283362 +- 283378 +- 283392 +- 283395 +- 283495 +- 283845 +- 284616 +- 284622 +- 284675 +- 284687 +- 284774 +- 284838 +- 284880 +- 285060 +- 285230 +- 285575 +- 285603 +- 287488 +- 288210 +- 289529 +- 289530 +- 289811 +- 289844 +- 289859 +- 290754 +- 291018 +- 291621 +- 293625 +- 293634 +- 296214 +- 298172 +- 298355 +- 298942 +- 299000 +- 306186 +- 310318 +- 310544 +- 310730 +- 311019 +- 311728 +- 312509 +- 312531 +- 313699 +- 330729 +- 337282 +- 344150 +- 351128 +- 360286 +- 374944 +- 386682 +- 386850 +- 409245 +- 410749 +- 429085 +- 453060 +- 473146 +- 473183 +- 477625 +- 482733 +- 485936 +- 486996 +- 501423 +- 524299 +- 525738 +- 525916 +- 525932 +- 525936 +- 529745 +- 529870 +- 542902 +- 546362 +- 546394 +- 546406 +- 546416 +- 546519 +- 551264 +- 551276 +- 552058 +- 555081 +- 571316 +- 574190 +- 574209 +- 591896 +- 600483 +- 600501 +- 600863 +- 601157 +- 619683 +- 620774 +- 627219 +- 628388 +- 628633 +- 628675 +- 628701 +- 628743 +- 628746 +- 628763 +- 631292 +- 635784 +- 639656 +- 640229 +- 642227 +- 654699 +- 656113 +- 665439 +- 666028 +- 666790 +- 670294 +- 671241 +- 671245 +- 671259 +- 671268 +- 671458 +- 677528 +- 679414 +- 690281 +- 690749 +- 692168 +- 695653 +- 695727 +- 695768 +- 695791 +- 696013 +- 696428 +- 715997 +- 719236 +- 726969 +- 726981 +- 727014 +- 727551 +- 756386 +- 756402 +- 762500 +- 766726 +- 767963 +- 771492 +- 773982 +- 775235 +- 777837 +- 780557 +- 781158 +- 781502 +- 781503 +- 784077 +- 784298 +- 784403 +- 792304 +- 794024 +- 794606 +- 795345 +- 796814 +- 798434 +- 798893 +- 799196 +- 799200 +- 800093 +- 802666 +- 802679 +- 802707 +- 802709 +- 802716 +- 808711 +- 808740 +- 808742 +- 808766 +- 808767 +- 808784 +- 808797 +- 808876 +- 808926 +- 808935 +- 808937 +- 808939 +- 808940 +- 808943 +- 808947 +- 808958 +- 808963 +- 808967 +- 808982 +- 808983 +- 808994 +- 809002 +- 809004 +- 809007 +- 811190 +- 818427 +- 818724 +- 819171 +- 819725 +- 828064 +- 828292 +- 828535 +- 828577 +- 828607 +- 828641 +- 828705 +- 828741 +- 828778 +- 828782 +- 828788 +- 828819 +- 829128 +- 829239 +- 832186 +- 839927 +- 841809 +- 842330 +- 845358 +- 846642 +- 853954 +- 855891 +- 859844 +- 860016 +- 860043 +- 860050 +- 860059 +- 860062 +- 860067 +- 860520 +- 860555 +- 861195 +- 861222 +- 863696 +- 888447 +- 898772 +- 910362 +- 916218 +- 920528 +- 924844 +- 931770 +- 933988 +- 934004 +- 934005 +- 934008 +- 934009 +- 934010 +- 934013 +- 934014 +- 934019 +- 934029 +- 934033 +- 934046 +- 934058 +- 934060 +- 938750 +- 946941 +- 949162 +- 951110 +- 951227 +- 955534 +- 959860 +- 960038 +- 962441 +- 962443 +- 962515 +- 962547 +- 962560 +- 962664 +- 963634 +- 966627 +- 969062 +- 985102 +- 990079 +- 990281 +- 991542 +- 999193 +- 1009535 +- 1016896 +- 1018675 +- 1019395 +- 1020295 +- 1020509 +- 1020960 +- 1020969 +- 1020982 +- 1021109 +- 1023811 +- 1027181 +- 1028190 +- 1035967 +- 1036338 +- 1038182 +- 1047230 +- 1048403 +- 1048429 +- 1048938 +- 1049968 +- 1050075 +- 1063901 +- 1063941 +- 1063942 +- 1079027 +- 1079344 +- 1083246 +- 1086139 +- 1088337 +- 1092801 +- 1102942 +- 1110614 +- 1110620 +- 1112775 +- 1116822 +- 1121711 +- 1140138 +- 1143324 +- 1145406 +- 1153823 +- 1157409 +- 1164993 +- 1165566 +- 1168238 +- 1169529 +- 1174555 +- 1182043 +- 1184647 +- 1187042 +- 1188538 +- 1206673 +- 1206824 +- 1206939 +- 1206954 +- 1206967 +- 1206969 +- 1249330 +- 1249377 +- 1249815 +- 1263647 +- 1279054 +- 1280300 +- 1280341 diff --git a/spec/helpers/dossier_helper_spec.rb b/spec/helpers/dossier_helper_spec.rb index 2296235f9..aea4f92de 100644 --- a/spec/helpers/dossier_helper_spec.rb +++ b/spec/helpers/dossier_helper_spec.rb @@ -183,4 +183,33 @@ RSpec.describe DossierHelper, type: :helper do it { is_expected.to eq('without_continuation') } end end + + describe '.has_lost_attachments' do + let(:procedure) { create(:procedure, :published) } + let(:dossier_with_lost_attachments) { create(:dossier, procedure: procedure) } + let(:dossier_without_lost_attachments) { create(:dossier, procedure: procedure) } + + before do + expect(ENV).to receive(:[]).with('APP_HOST').at_least(:once).and_return(app_host) + allow(helper).to receive(:dossiers_with_lost_attachments_ids).and_return([dossier_with_lost_attachments.id]) + end + + context 'on the DINUM instance' do + let(:app_host) { 'demarches-simplifiees.fr' } + + it 'returns true for dossiers that lost attachments' do + expect(helper.has_lost_attachments(dossier_with_lost_attachments)).to be(true) + expect(helper.has_lost_attachments(dossier_without_lost_attachments)).to be(false) + end + end + + context 'on another instance' do + let(:app_host) { 'polynesie-francaise.pref.gouv.fr' } + + it 'returns false for all dossiers' do + expect(helper.has_lost_attachments(dossier_with_lost_attachments)).to be(false) + expect(helper.has_lost_attachments(dossier_without_lost_attachments)).to be(false) + end + end + end end diff --git a/spec/views/shared/dossiers/_demande.html.haml_spec.rb b/spec/views/shared/dossiers/_demande.html.haml_spec.rb index 701e078e4..fbf5d4e4a 100644 --- a/spec/views/shared/dossiers/_demande.html.haml_spec.rb +++ b/spec/views/shared/dossiers/_demande.html.haml_spec.rb @@ -9,24 +9,24 @@ describe 'shared/dossiers/demande.html.haml', type: :view do sign_in(current_instructeur.user) end - subject! { render 'shared/dossiers/demande.html.haml', dossier: dossier, demande_seen_at: nil, profile: 'usager' } + subject { render 'shared/dossiers/demande.html.haml', dossier: dossier, demande_seen_at: nil, profile: 'usager' } context 'when dossier was created by an etablissement' do let(:etablissement) { create(:etablissement) } it 'renders the etablissement infos' do - expect(rendered).to include(etablissement.entreprise_raison_sociale) - expect(rendered).to include(etablissement.entreprise_siret_siege_social) - expect(rendered).to include(etablissement.entreprise_forme_juridique) + expect(subject).to include(etablissement.entreprise_raison_sociale) + expect(subject).to include(etablissement.entreprise_siret_siege_social) + expect(subject).to include(etablissement.entreprise_forme_juridique) end context 'and entreprise is an association' do let(:etablissement) { create(:etablissement, :is_association) } it 'renders the association infos' do - expect(rendered).to include(etablissement.association_rna) - expect(rendered).to include(etablissement.association_titre) - expect(rendered).to include(etablissement.association_objet) + expect(subject).to include(etablissement.association_rna) + expect(subject).to include(etablissement.association_titre) + expect(subject).to include(etablissement.association_objet) end end end @@ -35,10 +35,10 @@ describe 'shared/dossiers/demande.html.haml', type: :view do let(:individual) { create(:individual) } it 'renders the individual identity infos' do - expect(rendered).to include(individual.gender) - expect(rendered).to include(individual.nom) - expect(rendered).to include(individual.prenom) - expect(rendered).to include(I18n.l(individual.birthdate)) + expect(subject).to include(individual.gender) + expect(subject).to include(individual.nom) + expect(subject).to include(individual.prenom) + expect(subject).to include(I18n.l(individual.birthdate)) end end @@ -47,7 +47,17 @@ describe 'shared/dossiers/demande.html.haml', type: :view do it 'renders the champs' do dossier.champs.each do |champ| - expect(rendered).to include(champ.libelle) + expect(subject).to include(champ.libelle) + end + end + + context 'when the dossier lost some attachments' do + before do + expect(view).to receive(:has_lost_attachments).and_return(true) + end + + it 'displays a warning message' do + expect(subject).to include('Des pièces jointes de votre dossier peuvent être manquantes.') end end end From d4574bade1f56a4ed050aa5bed30ffaf72732e16 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 27 Jan 2020 13:55:52 +0000 Subject: [PATCH 19/21] dossier: add a custom message for the dossier owner --- app/views/shared/dossiers/_demande.html.haml | 2 +- .../dossiers/_lost_attachments.html.haml | 68 ++++++++++++------- .../_lost_attachments.html.haml_spec.rb | 40 +++++++++++ 3 files changed, 86 insertions(+), 24 deletions(-) create mode 100644 spec/views/shared/dossiers/_lost_attachments.html.haml_spec.rb diff --git a/app/views/shared/dossiers/_demande.html.haml b/app/views/shared/dossiers/_demande.html.haml index d8a96eaae..a6c5ccee8 100644 --- a/app/views/shared/dossiers/_demande.html.haml +++ b/app/views/shared/dossiers/_demande.html.haml @@ -25,6 +25,6 @@ - champs = dossier.champs.includes(:type_de_champ) - if champs.any? || dossier.procedure.routee? - if has_lost_attachments(dossier) - = render partial: "shared/dossiers/lost_attachments", locals: { dossier: dossier } + = render partial: "shared/dossiers/lost_attachments", locals: { dossier: dossier, profile: profile } .card = render partial: "shared/dossiers/champs", locals: { champs: champs, dossier: dossier, demande_seen_at: demande_seen_at, profile: profile } diff --git a/app/views/shared/dossiers/_lost_attachments.html.haml b/app/views/shared/dossiers/_lost_attachments.html.haml index 1195d8edc..c06b237f9 100644 --- a/app/views/shared/dossiers/_lost_attachments.html.haml +++ b/app/views/shared/dossiers/_lost_attachments.html.haml @@ -1,27 +1,49 @@ -/# FIXME: add a specific wording for Usagers -.card.warning - .card-title Des pièces jointes de ce dossier peuvent être manquantes. - %p - Suite à un incident survenu le 21 janvier, demarche-simplifiees.fr a perdu par erreur une partie des pièces jointes de ce dossier. - - - if dossier.en_construction? +- if profile == 'usager' + /# Message for Usager + .card.warning + .card-title Des pièces jointes de votre dossier peuvent être manquantes. %p - Si une ou plusieurs pièces jointes manquent, nous vous invitons à - = succeed ',' do - = link_to 'contacter le demandeur', messagerie_instructeur_dossier_path(dossier.procedure, dossier) - pour lui demander de - = succeed '.' do - %strong renvoyer les pièces jointes nécessaires + Suite à un incident survenu le 21 janvier, demarche-simplifiees.fr a perdu par erreur une partie des pièces jointes de votre dossier. L’administration en charge de votre dossier a été prévenue. - - else - %p - Si une ou plusieurs pièces jointes essentielles manquent, nous vous invitons à : - %ol - %li repasser ce dossier en construction ; - %li< - = link_to 'contacter le demandeur ', messagerie_instructeur_dossier_path(dossier.procedure, dossier) - pour lui demander de + - if dossier.read_only? + %p + Si nécessaire, + = succeed '.' do + %strong + l’administration vous contactera pour renvoyer les pièces jointes en question + - else + %p + Si une ou plusieurs pièces jointes manquent, nous vous invitons à + = link_to modifier_dossier_path(dossier) do = succeed '.' do - %strong renvoyer les pièces jointes nécessaires + %strong renvoyer les pièces jointes manquantes - %p Le demandeur de ce dossier a également été prévenu. Nous nous excusons pour la gêne occasionnée. + %p Nous nous excusons pour la gêne occasionnée. + +- else + /# Message for Instructeurs + .card.warning + .card-title Des pièces jointes de ce dossier peuvent être manquantes. + %p + Suite à un incident survenu le 21 janvier, demarche-simplifiees.fr a perdu par erreur une partie des pièces jointes de ce dossier. + + - if dossier.read_only? + %p + Si une ou plusieurs pièces jointes essentielles manquent, nous vous invitons à : + %ol + %li repasser ce dossier en construction ; + %li< + = link_to 'contacter le demandeur ', messagerie_instructeur_dossier_path(dossier.procedure, dossier) + pour lui demander de + = succeed '.' do + %strong renvoyer les pièces jointes nécessaires + - else + %p + Si une ou plusieurs pièces jointes manquent, nous vous invitons à + = succeed ',' do + = link_to 'contacter le demandeur', messagerie_instructeur_dossier_path(dossier.procedure, dossier) + pour lui demander de + = succeed '.' do + %strong renvoyer les pièces jointes nécessaires + + %p Le demandeur de ce dossier a également été prévenu. Nous nous excusons pour la gêne occasionnée. diff --git a/spec/views/shared/dossiers/_lost_attachments.html.haml_spec.rb b/spec/views/shared/dossiers/_lost_attachments.html.haml_spec.rb new file mode 100644 index 000000000..4c970034e --- /dev/null +++ b/spec/views/shared/dossiers/_lost_attachments.html.haml_spec.rb @@ -0,0 +1,40 @@ +describe 'shared/dossiers/lost_attachments.html.haml', type: :view do + let(:procedure) { create(:procedure, :published) } + let(:dossier) { create(:dossier, :en_construction, procedure: procedure) } + + subject { render 'shared/dossiers/lost_attachments.html.haml', dossier: dossier, profile: profile } + + context 'when viewed by an Usager' do + let(:profile) { 'usager' } + + it 'displays a warning message' do + expect(subject).to include('Des pièces jointes de votre dossier peuvent être manquantes') + expect(subject).to have_link('renvoyer les pièces jointes manquantes', href: modifier_dossier_path(dossier)) + end + + context 'when the user can’t edit the dossier' do + let(:dossier) { create(:dossier, :en_instruction, procedure: procedure) } + + it 'suggest to wait' do + expect(subject).to include('l’administration vous contactera') + end + end + end + + context 'when viewed by an Instructeur' do + let(:profile) { 'instructeur' } + + it 'displays a warning message' do + expect(subject).to include('Des pièces jointes de ce dossier peuvent être manquantes') + expect(subject).to have_link('contacter le demandeur') + end + + context 'when the user can’t edit the dossier' do + let(:dossier) { create(:dossier, :en_instruction, procedure: procedure) } + + it 'suggest to make the dossier editable again' do + expect(subject).to include('repasser ce dossier en construction') + end + end + end +end From 66112eb14ea502f643d2f74e7453b94f490a4175 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Mon, 3 Feb 2020 11:47:57 +0100 Subject: [PATCH 20/21] dossier: add a link to the incident post-mortem --- app/views/shared/dossiers/_lost_attachments.html.haml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/shared/dossiers/_lost_attachments.html.haml b/app/views/shared/dossiers/_lost_attachments.html.haml index c06b237f9..e5b099102 100644 --- a/app/views/shared/dossiers/_lost_attachments.html.haml +++ b/app/views/shared/dossiers/_lost_attachments.html.haml @@ -1,9 +1,12 @@ +- post_mortem_url = 'https://demarches-simplifiees.gitbook.io/articles-demarches-simplifiees-fr/2020/incident-de-production-du-21-janvier-2020' - if profile == 'usager' /# Message for Usager .card.warning .card-title Des pièces jointes de votre dossier peuvent être manquantes. %p - Suite à un incident survenu le 21 janvier, demarche-simplifiees.fr a perdu par erreur une partie des pièces jointes de votre dossier. L’administration en charge de votre dossier a été prévenue. + Suite à un + = link_to 'incident', post_mortem_url, target: '_blank' + survenu le 21 janvier, demarches-simplifiees.fr a perdu par erreur une partie des pièces jointes de votre dossier. L’administration en charge de votre dossier a été prévenue. - if dossier.read_only? %p @@ -25,7 +28,9 @@ .card.warning .card-title Des pièces jointes de ce dossier peuvent être manquantes. %p - Suite à un incident survenu le 21 janvier, demarche-simplifiees.fr a perdu par erreur une partie des pièces jointes de ce dossier. + Suite à un + = link_to 'incident', post_mortem_url, target: '_blank' + survenu le 21 janvier, demarches-simplifiees.fr a perdu par erreur une partie des pièces jointes de ce dossier. - if dossier.read_only? %p From 3e1ba4eebc97cb8f15ed592ef826cd296e472242 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Wed, 12 Feb 2020 13:26:29 +0100 Subject: [PATCH 21/21] specs: fix test failing because of unspecified types_de_champ order --- spec/models/champs/header_section_champ_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/models/champs/header_section_champ_spec.rb b/spec/models/champs/header_section_champ_spec.rb index 99b678241..34f3a5602 100644 --- a/spec/models/champs/header_section_champ_spec.rb +++ b/spec/models/champs/header_section_champ_spec.rb @@ -3,11 +3,11 @@ require 'spec_helper' describe Champs::CheckboxChamp do let(:types_de_champ) do [ - create(:type_de_champ_header_section), - create(:type_de_champ_civilite), - create(:type_de_champ_text), - create(:type_de_champ_header_section), - create(:type_de_champ_email) + create(:type_de_champ_header_section, order_place: 1), + create(:type_de_champ_civilite, order_place: 2), + create(:type_de_champ_text, order_place: 3), + create(:type_de_champ_header_section, order_place: 4), + create(:type_de_champ_email, order_place: 5) ] end