Merge pull request #2492 from betagouv/frederic/fix-1946/show-retention-time-to-users

[#1946] Show data retention time in footer
This commit is contained in:
Frederic Merizen 2018-08-30 18:14:51 +02:00 committed by GitHub
commit acfbba69c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

View file

@ -22,6 +22,7 @@ footer {
.footer-columns {
@extend %horizontal-list;
justify-content: flex-start;
margin: 0 -20px;
}
.footer-column {
@ -29,7 +30,9 @@ footer {
font-size: 14px;
vertical-align: top;
flex-grow: 1;
min-width: 320px;
min-width: 280px;
margin: 0 20px;
margin-bottom: 20px;
@media (max-width: 1000px) {
width: 100%;

View file

@ -7,13 +7,13 @@ module ConservationDeDonneesHelper
def conservation_dans_ds(procedure)
if procedure.duree_conservation_dossiers_dans_ds.present?
"dans demarches-simplifiees.fr #{procedure.duree_conservation_dossiers_dans_ds} mois après le début de linstruction du dossier"
"Dans demarches-simplifiees.fr : #{procedure.duree_conservation_dossiers_dans_ds} mois"
end
end
def conservation_hors_ds(procedure)
if procedure.duree_conservation_dossiers_hors_ds.present?
"hors demarches-simplifiees.fr pendant #{procedure.duree_conservation_dossiers_hors_ds} mois"
"Par ladministration : #{procedure.duree_conservation_dossiers_hors_ds} mois"
end
end
end

View file

@ -29,6 +29,13 @@
%p
Horaires : #{ service.horaires.sub(/\S/, &:downcase) }
- politiques = politiques_conservation_de_donnees(dossier.procedure)
- if politiques.present?
%li.footer-column
%h3.footer-header Conservation des données :
- politiques.each do |politique|
%p= politique
.footer-bottom-line
= link_to "Accessibilité", accessibilite_index_path, :class => "footer-link"

View file

@ -10,21 +10,21 @@ RSpec.describe ConservationDeDonneesHelper, type: :helper do
let(:dans_ds) { 3 }
let(:hors_ds) { 6 }
it { is_expected.to eq([ "dans demarches-simplifiees.fr 3 mois après le début de linstruction du dossier", "hors demarches-simplifiees.fr pendant 6 mois" ]) }
it { is_expected.to eq([ "Dans demarches-simplifiees.fr : 3 mois", "Par ladministration : 6 mois" ]) }
end
context "when only in-app retention time is set" do
let(:dans_ds) { 3 }
let(:hors_ds) { nil }
it { is_expected.to eq([ "dans demarches-simplifiees.fr 3 mois après le début de linstruction du dossier" ]) }
it { is_expected.to eq([ "Dans demarches-simplifiees.fr : 3 mois" ]) }
end
context "when only out of app retention time is set" do
let(:dans_ds) { nil }
let(:hors_ds) { 6 }
it { is_expected.to eq([ "hors demarches-simplifiees.fr pendant 6 mois" ]) }
it { is_expected.to eq([ "Par ladministration : 6 mois" ]) }
end
context "when the retention time is not set" do