Rend plus facile de créer un autre dossier (#4062)

Usager : rend plus facile de déposer un autre dossier sur la même démarche
This commit is contained in:
Pierre de La Morinerie 2019-07-09 15:42:09 +02:00 committed by GitHub
commit 64df0a2e07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 20 deletions

View file

@ -265,7 +265,7 @@ class Admin::ProceduresController < AdminController
end
def procedure_params
editable_params = [:libelle, :description, :organisation, :direction, :lien_site_web, :cadre_juridique, :deliberation, :notice, :expects_multiple_submissions, :web_hook_url, :euro_flag, :logo, :auto_archive_on]
editable_params = [:libelle, :description, :organisation, :direction, :lien_site_web, :cadre_juridique, :deliberation, :notice, :web_hook_url, :euro_flag, :logo, :auto_archive_on]
if @procedure&.locked?
params.require(:procedure).permit(*editable_params)
else

View file

@ -1,6 +1,8 @@
class Dossier < ApplicationRecord
include DossierFilteringConcern
self.ignored_columns = [:expects_multiple_submissions]
enum state: {
brouillon: 'brouillon',
en_construction: 'en_construction',

View file

@ -127,15 +127,6 @@
.col-md-6
%h4 Options avancées
= f.label :expects_multiple_submissions do
= f.check_box :expects_multiple_submissions
Ajuster pour le dépôt récurrent de dossiers
%p.help-block
%i.fa.fa-info-circle
Si cette démarche est conçue pour quune même personne y dépose régulièrement plusieurs
dossiers, linterface est ajustée pour rendre plus facile la création de plusieurs dossiers
à la suite.
- if Flipflop.web_hook?
%label{ for: :web_hook_url } Lien de rappel HTTP (webhook)
= f.text_field :web_hook_url, class: 'form-control', placeholder: 'https://callback.exemple.fr/'

View file

@ -1,5 +1,5 @@
- has_delete_action = dossier.can_be_deleted_by_user?
- has_new_dossier_action = dossier.procedure.expects_multiple_submissions? && dossier.procedure.accepts_new_dossiers?
- has_new_dossier_action = dossier.procedure.accepts_new_dossiers?
- has_actions = has_delete_action || has_new_dossier_action

View file

@ -20,4 +20,6 @@
et
%b échanger avec un instructeur.
.flex.column.align-center
= link_to 'Accéder à votre dossier', dossier_path(@dossier), class: 'button large primary'
= link_to 'Déposer un autre dossier', procedure_lien(@dossier.procedure)

View file

@ -1,5 +1,5 @@
describe 'users/dossiers/dossier_actions.html.haml', type: :view do
let(:procedure) { create(:procedure, :published, expects_multiple_submissions: true) }
let(:procedure) { create(:procedure, :published) }
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
subject { render 'users/dossiers/dossier_actions.html.haml', dossier: dossier }
@ -12,18 +12,13 @@ describe 'users/dossiers/dossier_actions.html.haml', type: :view do
it { is_expected.not_to have_link('Supprimer le dossier') }
end
context 'when the procedure doesnt expect multiple submissions' do
let(:procedure) { create(:procedure, :published, expects_multiple_submissions: false) }
it { is_expected.not_to have_link('Commencer un autre dossier') }
end
context 'when the procedure is closed' do
let(:procedure) { create(:procedure, :archived, expects_multiple_submissions: true) }
let(:procedure) { create(:procedure, :archived) }
it { is_expected.not_to have_link('Commencer un autre dossier') }
end
context 'when there are no actions to display' do
let(:procedure) { create(:procedure, :published, expects_multiple_submissions: false) }
let(:procedure) { create(:procedure, :archived) }
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
it 'doesnt render the menu at all' do