Merge pull request #5916 from betagouv/5911-allonge-conservation-dossiers

5911 allonge conservation dossiers
This commit is contained in:
Paul Chavard 2021-02-17 18:02:15 +01:00 committed by GitHub
commit c343fd432e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 22 deletions

View file

@ -188,7 +188,7 @@ class Procedure < ApplicationRecord
validate :check_juridique validate :check_juridique
validates :path, presence: true, format: { with: /\A[a-z0-9_\-]{3,200}\z/ }, uniqueness: { scope: [:path, :closed_at, :hidden_at, :unpublished_at], case_sensitive: false } validates :path, presence: true, format: { with: /\A[a-z0-9_\-]{3,200}\z/ }, uniqueness: { scope: [:path, :closed_at, :hidden_at, :unpublished_at], case_sensitive: false }
validates :duree_conservation_dossiers_dans_ds, allow_nil: false, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: MAX_DUREE_CONSERVATION } validates :duree_conservation_dossiers_dans_ds, allow_nil: false, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: MAX_DUREE_CONSERVATION }
validates :duree_conservation_dossiers_hors_ds, allow_nil: false, numericality: { only_integer: true, greater_than_or_equal_to: 0 } validates :duree_conservation_dossiers_hors_ds, allow_nil: true, numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates_with MonAvisEmbedValidator validates_with MonAvisEmbedValidator
validates :notice, content_type: [ validates :notice, content_type: [
"application/msword", "application/msword",

View file

@ -16,20 +16,14 @@
%h3.header-subsection Logo de la démarche %h3.header-subsection Logo de la démarche
= image_upload_and_render f, @procedure.logo = image_upload_and_render f, @procedure.logo
- if !@procedure.locked?
%h3.header-subsection Conservation des données %h3.header-subsection Conservation des données
= f.label :duree_conservation_dossiers_dans_ds do = f.label :duree_conservation_dossiers_dans_ds do
Sur #{APPLICATION_NAME} Sur #{APPLICATION_NAME}
%span.mandatory * %span.mandatory *
%p.notice (durée en mois après le début de linstruction) %p.notice (durée en mois après le début de linstruction)
= f.number_field :duree_conservation_dossiers_dans_ds, class: 'form-control', placeholder: '6', required: true = f.number_field :duree_conservation_dossiers_dans_ds, class: 'form-control', placeholder: '6', required: true
= f.label :duree_conservation_dossiers_hors_ds do
Hors #{APPLICATION_NAME}
%span.mandatory *
%p.notice (durée en mois après la fin de l'instruction)
= f.number_field :duree_conservation_dossiers_hors_ds, class: 'form-control', placeholder: '6', required: true
- if @procedure.created_at.present? - if @procedure.created_at.present?
= f.label :lien_site_web do = f.label :lien_site_web do
Où les usagers trouveront-ils le lien vers la démarche ? Où les usagers trouveront-ils le lien vers la démarche ?

View file

@ -8,7 +8,6 @@ FactoryBot.define do
cadre_juridique { "un cadre juridique important" } cadre_juridique { "un cadre juridique important" }
published_at { nil } published_at { nil }
duree_conservation_dossiers_dans_ds { 3 } duree_conservation_dossiers_dans_ds { 3 }
duree_conservation_dossiers_hors_ds { 6 }
ask_birthday { false } ask_birthday { false }
lien_site_web { "https://mon-site.gouv" } lien_site_web { "https://mon-site.gouv" }
path { SecureRandom.uuid } path { SecureRandom.uuid }

View file

@ -38,7 +38,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
expect(find('#procedure_for_individual_true')).to be_checked expect(find('#procedure_for_individual_true')).to be_checked
expect(find('#procedure_for_individual_false')).not_to be_checked expect(find('#procedure_for_individual_false')).not_to be_checked
fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3' fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3'
fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6'
click_on 'Créer la démarche' click_on 'Créer la démarche'
expect(page).to have_text('Libelle doit être rempli') expect(page).to have_text('Libelle doit être rempli')

View file

@ -4,6 +4,5 @@ module ProcedureSpecHelper
fill_in 'procedure_description', with: 'description de la procedure' fill_in 'procedure_description', with: 'description de la procedure'
fill_in 'procedure_cadre_juridique', with: 'cadre juridique' fill_in 'procedure_cadre_juridique', with: 'cadre juridique'
fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3' fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3'
fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6'
end end
end end

View file

@ -271,12 +271,6 @@ describe Procedure do
it_behaves_like 'duree de conservation' it_behaves_like 'duree de conservation'
end end
describe 'duree de conservation hors ds' do
let(:field_name) { :duree_conservation_dossiers_hors_ds }
it_behaves_like 'duree de conservation'
end
end end
describe 'active' do describe 'active' do