Merge pull request #5916 from betagouv/5911-allonge-conservation-dossiers
5911 allonge conservation dossiers
This commit is contained in:
commit
c343fd432e
6 changed files with 7 additions and 22 deletions
|
@ -188,7 +188,7 @@ class Procedure < ApplicationRecord
|
|||
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 :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 :notice, content_type: [
|
||||
"application/msword",
|
||||
|
|
|
@ -16,20 +16,14 @@
|
|||
%h3.header-subsection Logo de la démarche
|
||||
= image_upload_and_render f, @procedure.logo
|
||||
|
||||
- if !@procedure.locked?
|
||||
%h3.header-subsection Conservation des données
|
||||
= f.label :duree_conservation_dossiers_dans_ds do
|
||||
Sur #{APPLICATION_NAME}
|
||||
%span.mandatory *
|
||||
|
||||
%p.notice (durée en mois après le début de l’instruction)
|
||||
= 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?
|
||||
= f.label :lien_site_web do
|
||||
Où les usagers trouveront-ils le lien vers la démarche ?
|
||||
|
|
|
@ -8,7 +8,6 @@ FactoryBot.define do
|
|||
cadre_juridique { "un cadre juridique important" }
|
||||
published_at { nil }
|
||||
duree_conservation_dossiers_dans_ds { 3 }
|
||||
duree_conservation_dossiers_hors_ds { 6 }
|
||||
ask_birthday { false }
|
||||
lien_site_web { "https://mon-site.gouv" }
|
||||
path { SecureRandom.uuid }
|
||||
|
|
|
@ -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_false')).not_to be_checked
|
||||
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'
|
||||
|
||||
expect(page).to have_text('Libelle doit être rempli')
|
||||
|
|
|
@ -4,6 +4,5 @@ module ProcedureSpecHelper
|
|||
fill_in 'procedure_description', with: 'description de la procedure'
|
||||
fill_in 'procedure_cadre_juridique', with: 'cadre juridique'
|
||||
fill_in 'procedure_duree_conservation_dossiers_dans_ds', with: '3'
|
||||
fill_in 'procedure_duree_conservation_dossiers_hors_ds', with: '6'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -271,12 +271,6 @@ describe Procedure do
|
|||
|
||||
it_behaves_like 'duree de conservation'
|
||||
end
|
||||
|
||||
describe 'duree de conservation hors ds' do
|
||||
let(:field_name) { :duree_conservation_dossiers_hors_ds }
|
||||
|
||||
it_behaves_like 'duree de conservation'
|
||||
end
|
||||
end
|
||||
|
||||
describe 'active' do
|
||||
|
|
Loading…
Reference in a new issue