feat(manager): add procedure_expires_when_termine_enabled to administrate

This commit is contained in:
Martin 2021-12-06 06:12:40 +01:00
parent 2778b42f1a
commit a9413f9b12
4 changed files with 11 additions and 7 deletions

View file

@ -34,7 +34,8 @@ class ProcedureDashboard < Administrate::BaseDashboard
closed_mail_template: MailTemplateField, closed_mail_template: MailTemplateField,
refused_mail_template: MailTemplateField, refused_mail_template: MailTemplateField,
without_continuation_mail_template: MailTemplateField, without_continuation_mail_template: MailTemplateField,
attestation_template: AttestationTemplateField attestation_template: AttestationTemplateField,
procedure_expires_when_termine_enabled: Field::Boolean
}.freeze }.freeze
# COLLECTION_ATTRIBUTES # COLLECTION_ATTRIBUTES
@ -79,13 +80,16 @@ class ProcedureDashboard < Administrate::BaseDashboard
:closed_mail_template, :closed_mail_template,
:refused_mail_template, :refused_mail_template,
:without_continuation_mail_template, :without_continuation_mail_template,
:attestation_template :attestation_template,
:procedure_expires_when_termine_enabled
].freeze ].freeze
# FORM_ATTRIBUTES # FORM_ATTRIBUTES
# an array of attributes that will be displayed # an array of attributes that will be displayed
# on the model's form (`new` and `edit`) pages. # on the model's form (`new` and `edit`) pages.
FORM_ATTRIBUTES = [].freeze FORM_ATTRIBUTES = [
:procedure_expires_when_termine_enabled
].freeze
# Overwrite this method to customize how procedures are displayed # Overwrite this method to customize how procedures are displayed
# across all pages of the admin dashboard. # across all pages of the admin dashboard.

View file

@ -3,7 +3,7 @@ en:
dossiers: dossiers:
header: header:
banner: banner:
expiration_date_extended: " la date de conservation a déjà été etendue" expiration_date_extended: " the expiration date had already been extended"
title: This file will expire title: This file will expire
states: states:
brouillon: "" # not applicable, instructeur does not see brouillons brouillon: "" # not applicable, instructeur does not see brouillons

View file

@ -10,7 +10,7 @@ Rails.application.routes.draw do
# #
namespace :manager do namespace :manager do
resources :procedures, only: [:index, :show] do resources :procedures, only: [:index, :show, :edit, :update] do
post 'whitelist', on: :member post 'whitelist', on: :member
post 'draft', on: :member post 'draft', on: :member
post 'discard', on: :member post 'discard', on: :member

View file

@ -719,8 +719,8 @@ describe Instructeur, type: :model do
it { expect(subject['a_suivre']).to eq(0) } it { expect(subject['a_suivre']).to eq(0) }
it { expect(subject['suivis']).to eq(0) } it { expect(subject['suivis']).to eq(0) }
it { expect(subject['traites']).to eq(1) } it { expect(subject['traites']).to eq(2) }
it { expect(subject['tous']).to eq(1) } it { expect(subject['tous']).to eq(2) }
it { expect(subject['archives']).to eq(0) } it { expect(subject['archives']).to eq(0) }
it { expect(subject['expirant']).to eq(0) } it { expect(subject['expirant']).to eq(0) }
end end