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:
commit
64df0a2e07
6 changed files with 10 additions and 20 deletions
|
@ -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
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
class Dossier < ApplicationRecord
|
||||
include DossierFilteringConcern
|
||||
|
||||
self.ignored_columns = [:expects_multiple_submissions]
|
||||
|
||||
enum state: {
|
||||
brouillon: 'brouillon',
|
||||
en_construction: 'en_construction',
|
||||
|
|
|
@ -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 qu’une même personne y dépose régulièrement plusieurs
|
||||
dossiers, l’interface 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/'
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -20,4 +20,6 @@
|
|||
et
|
||||
%b échanger avec un instructeur.
|
||||
|
||||
= link_to 'Accéder à votre dossier', dossier_path(@dossier), class: 'button large primary'
|
||||
.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)
|
||||
|
|
|
@ -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 doesn’t 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 'doesn’t render the menu at all' do
|
||||
|
|
Loading…
Reference in a new issue