Merge branch 'main' into production
2021-11-30-01
This commit is contained in:
commit
ef71419b24
103 changed files with 211 additions and 177 deletions
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class AdministrateurController < ApplicationController
|
||||
before_action :authenticate_administrateur!
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class AttestationTemplatesController < AdministrateurController
|
||||
before_action :retrieve_procedure
|
||||
|
||||
|
@ -33,7 +33,7 @@ module NewAdministrateur
|
|||
attestation = @procedure.attestation_template || AttestationTemplate.new
|
||||
@attestation = attestation.render_attributes_for({})
|
||||
|
||||
render 'new_administrateur/attestation_templates/show', formats: [:pdf]
|
||||
render 'administrateurs/attestation_templates/show', formats: [:pdf]
|
||||
end
|
||||
|
||||
private
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class ExpertsProceduresController < AdministrateurController
|
||||
before_action :retrieve_procedure
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class GroupeInstructeursController < AdministrateurController
|
||||
include ActiveSupport::NumberHelper
|
||||
ITEMS_PER_PAGE = 25
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class JetonParticulierController < AdministrateurController
|
||||
before_action :retrieve_procedure
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class MailTemplatesController < AdministrateurController
|
||||
include ActionView::Helpers::SanitizeHelper
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class ProcedureAdministrateursController < AdministrateurController
|
||||
before_action :retrieve_procedure, except: [:new]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class ProceduresController < AdministrateurController
|
||||
before_action :retrieve_procedure, only: [:champs, :annotations, :edit, :monavis, :update_monavis, :jeton, :update_jeton, :publication, :publish, :transfert, :allow_expert_review, :experts_require_administrateur_invitation]
|
||||
before_action :procedure_revisable?, only: [:champs, :annotations]
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class ServicesController < AdministrateurController
|
||||
def index
|
||||
@services = services.ordered
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class SourcesParticulierController < AdministrateurController
|
||||
before_action :retrieve_procedure
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module NewAdministrateur
|
||||
module Administrateurs
|
||||
class TypesDeChampController < AdministrateurController
|
||||
before_action :retrieve_procedure, only: [:create, :update, :move, :destroy]
|
||||
before_action :procedure_revisable?, only: [:create, :update, :move, :destroy]
|
|
@ -28,7 +28,7 @@ module Instructeurs
|
|||
def apercu_attestation
|
||||
@attestation = dossier.procedure.attestation_template.render_attributes_for(dossier: dossier)
|
||||
|
||||
render 'new_administrateur/attestation_templates/show', formats: [:pdf]
|
||||
render 'administrateurs/attestation_templates/show', formats: [:pdf]
|
||||
end
|
||||
|
||||
def bilans_bdf
|
||||
|
@ -134,6 +134,9 @@ module Instructeurs
|
|||
|
||||
def repasser_en_instruction
|
||||
begin
|
||||
if dossier.hidden_by_user_at.present?
|
||||
dossier.update!(hidden_by_user_at: nil)
|
||||
end
|
||||
flash.notice = "Le dossier #{dossier.id} a été repassé en instruction."
|
||||
dossier.repasser_en_instruction!(current_instructeur)
|
||||
rescue AASM::InvalidTransition => e
|
||||
|
|
|
@ -13,13 +13,14 @@ module Manager
|
|||
else
|
||||
flash[:error] = user.errors.full_messages.to_sentence
|
||||
end
|
||||
|
||||
redirect_to edit_manager_user_path(user)
|
||||
else
|
||||
targeted_user.merge(user)
|
||||
|
||||
flash[:notice] = "Le compte « #{targeted_email} » a absorbé le compte « #{user.email} »."
|
||||
redirect_to edit_manager_user_path(targeted_user)
|
||||
end
|
||||
|
||||
redirect_to edit_manager_user_path(user)
|
||||
end
|
||||
|
||||
def resend_confirmation_instructions
|
||||
|
|
|
@ -119,7 +119,7 @@ class AttestationTemplate < ApplicationRecord
|
|||
def build_pdf(dossier)
|
||||
attestation = render_attributes_for(dossier: dossier)
|
||||
attestation_view = ApplicationController.render(
|
||||
template: 'new_administrateur/attestation_templates/show',
|
||||
template: 'administrateurs/attestation_templates/show',
|
||||
formats: :pdf,
|
||||
assigns: { attestation: attestation }
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Attestation'] }
|
||||
|
@ -8,7 +8,7 @@
|
|||
.procedure-form#attestation-template-edit
|
||||
.procedure-form__columns.container
|
||||
= form_for @attestation_template,
|
||||
url: url_for({ controller: 'new_administrateur/attestation_templates', action: :update, id: @procedure.id }),
|
||||
url: url_for({ controller: 'administrateurs/attestation_templates', action: :update, id: @procedure.id }),
|
||||
multipart: true,
|
||||
html: { class: 'form procedure-form__column--form' } do |f|
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
|||
L’email d’accusé d’acceptation envoyé à l’usager comporte alors un lien vers l’attestation ;
|
||||
celle-ci est également disponible au téléchargement depuis l’espace personnel de l’usager.
|
||||
|
||||
= render partial: 'new_administrateur/attestation_templates/informations', locals: { f: f }
|
||||
= render partial: 'administrateurs/attestation_templates/informations', locals: { f: f }
|
||||
|
||||
.procedure-form__actions.sticky--bottom
|
||||
.actions-left
|
||||
|
@ -53,4 +53,4 @@
|
|||
.notice
|
||||
Cet aperçu est mis à jour après chaque sauvegarde.
|
||||
.procedure-preview
|
||||
= render partial: 'new_administrateur/attestation_templates/apercu', locals: { procedure: @procedure }
|
||||
= render partial: 'administrateurs/attestation_templates/apercu', locals: { procedure: @procedure }
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Liste des experts'] }
|
|
@ -20,7 +20,7 @@
|
|||
= f.text_field :label, placeholder: 'ex. Ville de Bordeaux', required: true
|
||||
= f.submit 'Ajouter le groupe', class: "button primary send"
|
||||
|
||||
- csv_max_size = NewAdministrateur::GroupeInstructeursController::CSV_MAX_SIZE
|
||||
- csv_max_size = Administrateurs::GroupeInstructeursController::CSV_MAX_SIZE
|
||||
= form_tag import_admin_procedure_groupe_instructeurs_path(procedure), method: :post, multipart: true, class: "mt-4 form" do
|
||||
= label_tag "Importer par fichier CSV"
|
||||
%p.notice Le fichier csv doit comporter 2 colonnes (Groupe, Email) et être séparé par des virgules. L'import n'écrase pas les groupes et les instructeurs existants.
|
|
@ -1,23 +1,22 @@
|
|||
- if @procedure.routee?
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Groupes d’instructeurs'] }
|
||||
- else
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Instructeurs'] }
|
||||
|
||||
.container.groupe-instructeur
|
||||
= render partial: 'new_administrateur/groupe_instructeurs/routing', locals: { procedure: @procedure }
|
||||
= render partial: 'administrateurs/groupe_instructeurs/routing', locals: { procedure: @procedure }
|
||||
|
||||
- if @procedure.routee?
|
||||
= render partial: 'new_administrateur/groupe_instructeurs/edit', locals: { procedure: @procedure, groupes_instructeurs: @groupes_instructeurs }
|
||||
= render partial: 'administrateurs/groupe_instructeurs/edit', locals: { procedure: @procedure, groupes_instructeurs: @groupes_instructeurs }
|
||||
- else
|
||||
= render partial: 'new_administrateur/groupe_instructeurs/instructeurs',
|
||||
= render partial: 'administrateurs/groupe_instructeurs/instructeurs',
|
||||
locals: { procedure: @procedure,
|
||||
groupe_instructeur: @procedure.defaut_groupe_instructeur,
|
||||
instructeurs: @instructeurs,
|
||||
available_instructeur_emails: @available_instructeur_emails }
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
link_to('Groupes d’instructeurs', admin_procedure_groupe_instructeurs_path(@procedure)),
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
link_to('Groupes d’instructeurs', admin_procedure_groupe_instructeurs_path(@procedure)),
|
||||
@groupe_instructeur.label] }
|
||||
|
||||
.container.groupe-instructeur
|
||||
= render partial: 'new_administrateur/groups_header'
|
||||
= render partial: 'new_administrateur/groupe_instructeurs/instructeurs',
|
||||
= render partial: 'administrateurs/groups_header'
|
||||
= render partial: 'administrateurs/groupe_instructeurs/instructeurs',
|
||||
locals: { procedure: @procedure,
|
||||
groupe_instructeur: @groupe_instructeur,
|
||||
instructeurs: @instructeurs,
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
Procedure.human_attribute_name(:jeton_api_particulier)] }
|
||||
|
@ -30,5 +30,5 @@
|
|||
%span.icon.accept
|
||||
%p.card-admin-status-accept= t('.already_configured')
|
||||
%div
|
||||
%p.card-admin-title= t('new_administrateur.sources_particulier.show.data_sources')
|
||||
%p.card-admin-title= t('administrateurs.sources_particulier.show.data_sources')
|
||||
%p.button= t('views.shared.actions.edit')
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
link_to(Procedure.human_attribute_name(:jeton_api_particulier), admin_procedure_api_particulier_path(@procedure)),
|
|
@ -2,7 +2,7 @@
|
|||
- if params[:id] == 'closed_mail'
|
||||
= render partial: 'admin/closed_mail_template_attestation_inconsistency_alert'
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
link_to("Emails", admin_procedure_mail_templates_path(@procedure)),
|
||||
|
@ -31,4 +31,3 @@
|
|||
Cet aperçu est mis à jour après chaque sauvegarde.
|
||||
.procedure-preview
|
||||
= render partial: 'apercu', locals: { procedure: @procedure }
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to("#{@procedure.libelle}", admin_procedure_path(@procedure)), "Configuration des emails"] }
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Administrateurs'], preview: false }
|
|
@ -0,0 +1,63 @@
|
|||
%ul.revision-changes
|
||||
- changes.each do |change|
|
||||
- postfix = change[:private] ? '_private' : ''
|
||||
- case change[:op]
|
||||
- when :add
|
||||
%li.mb-1= t("add#{postfix}", label: change[:label], scope: [:administrateurs, :revision_changes])
|
||||
- when :remove
|
||||
%li.mb-1= t("remove#{postfix}", label: change[:label], scope: [:administrateurs, :revision_changes])
|
||||
- when :update
|
||||
- case change[:attribute]
|
||||
- when :libelle
|
||||
%li.mb-1= t("update_libelle#{postfix}", label: change[:label], to: change[:to], scope: [:administrateurs, :revision_changes])
|
||||
- when :type_champ
|
||||
%li.mb-1= t("update_type_champ#{postfix}", label: change[:label], to: t("activerecord.attributes.type_de_champ.type_champs.#{change[:to]}"), scope: [:administrateurs, :revision_changes])
|
||||
- when :description
|
||||
%li.mb-1= t("update_description#{postfix}", label: change[:label], to: change[:to], scope: [:administrateurs, :revision_changes])
|
||||
- when :drop_down_secondary_libelle
|
||||
%li.mb-1= t("update_drop_down_secondary_libelle#{postfix}", label: change[:label], to: change[:to], scope: [:administrateurs, :revision_changes])
|
||||
- when :drop_down_secondary_description
|
||||
%li.mb-1= t("update_drop_down_secondary_description#{postfix}", label: change[:label], to: change[:to], scope: [:administrateurs, :revision_changes])
|
||||
- when :mandatory
|
||||
- if change[:from] == false
|
||||
-# i18n-tasks-use t('administrateurs.revision_changes.update_mandatory.enabled')
|
||||
-# i18n-tasks-use t('administrateurs.revision_changes.update_mandatory_private.enabled')
|
||||
%li.mb-1= t("administrateurs.revision_changes.update_mandatory#{postfix}.enabled", label: change[:label])
|
||||
- else
|
||||
-# i18n-tasks-use t('administrateurs.revision_changes.update_mandatory.disabled')
|
||||
-# i18n-tasks-use t('administrateurs.revision_changes.update_mandatory_private.disabled')
|
||||
%li.mb-1= t("administrateurs.revision_changes.update_mandatory#{postfix}.disabled", label: change[:label])
|
||||
- when :piece_justificative_template
|
||||
-# i18n-tasks-use t('administrateurs.revision_changes.update_piece_justificative_template')
|
||||
-# i18n-tasks-use t('administrateurs.revision_changes.update_piece_justificative_template_private')
|
||||
%li.mb-1= t("administrateurs.revision_changes.update_piece_justificative_template#{postfix}", label: change[:label])
|
||||
- when :drop_down_options
|
||||
- added = change[:to].sort - change[:from].sort
|
||||
- removed = change[:from].sort - change[:to].sort
|
||||
%li.mb-1
|
||||
= t("update_drop_down_options#{postfix}", scope: [:administrateurs, :revision_changes], label: change[:label])
|
||||
%ul
|
||||
- if added.present?
|
||||
%li= t(:add_option, scope: [:administrateurs, :revision_changes], items: added.map{ |term| "« #{term.strip} »" }.join(", "))
|
||||
- if removed.present?
|
||||
%li= t(:remove_option, scope: [:administrateurs, :revision_changes], items: removed.map{ |term| "« #{term.strip} »" }.join(", "))
|
||||
- when :drop_down_other
|
||||
- if change[:from] == false
|
||||
%li.mb-1= t("administrateurs.revision_changes.update_drop_down_other#{postfix}.enabled", label: change[:label])
|
||||
- else
|
||||
%li.mb-1= t("administrateurs.revision_changes.update_drop_down_other#{postfix}.disabled", label: change[:label])
|
||||
- when :carte_layers
|
||||
- added = change[:to].sort - change[:from].sort
|
||||
- removed = change[:from].sort - change[:to].sort
|
||||
%li.mb-1
|
||||
= t("update_carte_layers#{postfix}", scope: [:administrateurs, :revision_changes], label: change[:label])
|
||||
%ul
|
||||
- if added.present?
|
||||
%li= t(:add_option, scope: [:administrateurs, :revision_changes], items: added.map{ |term| "« #{t(term, scope: [:administrateurs, :carte_layers])} »" }.join(", "))
|
||||
- if removed.present?
|
||||
%li= t(:remove_option, scope: [:administrateurs, :revision_changes], items: removed.map{ |term| "« #{t(term, scope: [:administrateurs, :carte_layers])} »" }.join(", "))
|
||||
- move_changes, move_private_changes = changes.filter { |change| change[:op] == :move }.partition { |change| !change[:private] }
|
||||
- if move_changes.size != 0
|
||||
%li.mb-1= t(:move, scope: [:administrateurs, :revision_changes], count: move_changes.size)
|
||||
- if move_private_changes.size != 0
|
||||
%li.mb-1= t(:move_private, scope: [:administrateurs, :revision_changes], count: move_private_changes.size)
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Configuration des annotations privées'], preview: true }
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Configuration des champs'], preview: true }
|
|
@ -1,19 +1,19 @@
|
|||
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Description'] }
|
||||
.procedure-form
|
||||
.procedure-form__columns.container
|
||||
= form_for @procedure,
|
||||
url: url_for({ controller: 'new_administrateur/procedures', action: :update, id: @procedure.id }),
|
||||
url: url_for({ controller: 'administrateurs/procedures', action: :update, id: @procedure.id }),
|
||||
multipart: true,
|
||||
html: { class: 'form procedure-form__column--form' } do |f|
|
||||
|
||||
%h1.page-title Description
|
||||
|
||||
= render partial: 'new_administrateur/procedures/informations', locals: { f: f }
|
||||
= render partial: 'administrateurs/procedures/informations', locals: { f: f }
|
||||
|
||||
.procedure-form__actions.sticky--bottom
|
||||
.actions-right
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Jeton'] }
|
||||
|
@ -9,7 +9,7 @@
|
|||
|
||||
.container
|
||||
%h1
|
||||
= form_with model: @procedure, url: url_for({ controller: 'new_administrateur/procedures', action: :update_jeton }), html: { class: 'form' } do |f|
|
||||
= form_with model: @procedure, url: url_for({ controller: 'administrateurs/procedures', action: :update_jeton }), html: { class: 'form' } do |f|
|
||||
%p.explication
|
||||
Démarches Simplifiées utilise
|
||||
= link_to 'API Entreprise', "https://entreprise.api.gouv.fr/"
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'MonAvis'] }
|
||||
|
@ -9,7 +9,7 @@
|
|||
|
||||
.container
|
||||
%h1
|
||||
= form_for @procedure, url: url_for({ controller: 'new_administrateur/procedures', action: :update_monavis }), multipart: true, html: { class: 'form' } do |f|
|
||||
= form_for @procedure, url: url_for({ controller: 'administrateurs/procedures', action: :update_monavis }), multipart: true, html: { class: 'form' } do |f|
|
||||
= render partial: 'monavis', locals: { f: f }
|
||||
.text-right
|
||||
= f.button 'Enregistrer', class: 'button primary send'
|
|
@ -1,19 +1,19 @@
|
|||
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
'Nouvelle'] }
|
||||
|
||||
.procedure-form
|
||||
.procedure-form__columns.container
|
||||
= form_for @procedure,
|
||||
url: url_for({ controller: 'new_administrateur/procedures', action: :create, id: @procedure.id }),
|
||||
url: url_for({ controller: 'administrateurs/procedures', action: :create, id: @procedure.id }),
|
||||
multipart: true,
|
||||
html: { class: 'form procedure-form__column--form' } do |f|
|
||||
|
||||
%h1.page-title Nouvelle démarche
|
||||
|
||||
= render partial: 'new_administrateur/procedures/informations', locals: { f: f }
|
||||
= render partial: 'administrateurs/procedures/informations', locals: { f: f }
|
||||
|
||||
.procedure-form__actions.sticky--bottom
|
||||
.actions-right
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Publication'] }
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
"#{@procedure.libelle}", ],
|
||||
metadatas: ["Créée le #{@procedure.created_at.strftime('%d/%m/%Y')} - n° #{@procedure.id}", "#{@procedure.close? ? "Close le #{@procedure.closed_at.strftime('%d/%m/%Y')}" : @procedure.locked? ? "Publiée - #{procedure_lien(@procedure)}" : "Brouillon"}"] }
|
||||
|
@ -36,7 +36,7 @@
|
|||
.container
|
||||
.card.featured
|
||||
.card-title
|
||||
= t(:has_changes, scope: [:new_administrateur, :revision_changes])
|
||||
= t(:has_changes, scope: [:administrateurs, :revision_changes])
|
||||
= render partial: 'revision_changes', locals: { changes: @procedure.revision_changes }
|
||||
|
||||
.container
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'Transfert'] }
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
link_to('choix du service', admin_services_path(procedure_id: @procedure.id)),
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
'choix du service'] }
|
||||
|
@ -6,7 +6,7 @@
|
|||
#services-index.container
|
||||
%h1 Choix du service pour la démarche
|
||||
|
||||
= form_for @procedure, url: { controller: "new_administrateur/services", action: :add_to_procedure } , html: { class: 'form' } do |f|
|
||||
= form_for @procedure, url: { controller: "administrateurs/services", action: :add_to_procedure } , html: { class: 'form' } do |f|
|
||||
= f.label :service_id, "La démarche #{@procedure.libelle} est affectée au service"
|
||||
= f.select :service_id,
|
||||
@services.map { |s| [ s.nom, s.id ] },
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
link_to('choix du service', admin_services_path(procedure_id: @procedure.id)),
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||
link_to(Procedure.human_attribute_name(:jeton_api_particulier), admin_procedure_api_particulier_path(@procedure)),
|
|
@ -2,7 +2,7 @@
|
|||
Bonjour,
|
||||
|
||||
%p
|
||||
#{t('new_administrateur.groupe_instructeurs.add_instructeur.assignment', count: @new_instructeur_emails.count, value: @new_instructeur_emails.join(', '), groupe: @group.label).chomp('.')} par « #{@current_instructeur_email} », en charge de la démarche « #{@group.procedure.libelle} ».
|
||||
#{t('administrateurs.groupe_instructeurs.add_instructeur.assignment', count: @new_instructeur_emails.count, value: @new_instructeur_emails.join(', '), groupe: @group.label).chomp('.')} par « #{@current_instructeur_email} », en charge de la démarche « #{@group.procedure.libelle} ».
|
||||
|
||||
%p
|
||||
Cliquez sur le lien ci-dessous pour voir la liste des instructeurs de ce groupe :
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- content_for(:title, "Archives pour #{@procedure.libelle}")
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
|
||||
'Archives'] }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- content_for(:title, "Notifications pour #{@procedure.libelle}")
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
|
||||
'Groupes d’instructeurs'] }
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
- if @procedure.routee?
|
||||
- content_for(:title, "Instructeurs du groupe #{@groupe_instructeur.label}")
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
|
||||
link_to('Groupes d’instructeurs', instructeur_groupes_path(@procedure)),
|
||||
@groupe_instructeur.label] }
|
||||
|
@ -9,7 +9,7 @@
|
|||
- else
|
||||
- content_for(:title, "Instructeurs de la démarche #{@procedure.libelle}")
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)), 'Instructeurs'] }
|
||||
|
||||
.container.groupe-instructeur
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- content_for(:title, "Notifications pour #{@procedure.libelle}")
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
|
||||
'Notifications'] }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- content_for(:title, "Contacter les usagers pour #{@procedure.libelle}")
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
|
||||
'Contacter les usagers (brouillon)'] }
|
||||
.messagerie.container
|
||||
|
@ -28,4 +28,3 @@
|
|||
- else
|
||||
.page-title.center
|
||||
%h2 Il n'y a aucun dossier en brouillon dans vos groupes instructeurs
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
- title = "Statistiques · #{@procedure.libelle}"
|
||||
- content_for(:title, title)
|
||||
|
||||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to(@procedure.libelle, instructeur_procedure_path(@procedure)),
|
||||
'Statistiques'] }
|
||||
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
%ul.revision-changes
|
||||
- changes.each do |change|
|
||||
- postfix = change[:private] ? '_private' : ''
|
||||
- case change[:op]
|
||||
- when :add
|
||||
%li.mb-1= t("add#{postfix}", label: change[:label], scope: [:new_administrateur, :revision_changes])
|
||||
- when :remove
|
||||
%li.mb-1= t("remove#{postfix}", label: change[:label], scope: [:new_administrateur, :revision_changes])
|
||||
- when :update
|
||||
- case change[:attribute]
|
||||
- when :libelle
|
||||
%li.mb-1= t("update_libelle#{postfix}", label: change[:label], to: change[:to], scope: [:new_administrateur, :revision_changes])
|
||||
- when :type_champ
|
||||
%li.mb-1= t("update_type_champ#{postfix}", label: change[:label], to: t("activerecord.attributes.type_de_champ.type_champs.#{change[:to]}"), scope: [:new_administrateur, :revision_changes])
|
||||
- when :description
|
||||
%li.mb-1= t("update_description#{postfix}", label: change[:label], to: change[:to], scope: [:new_administrateur, :revision_changes])
|
||||
- when :drop_down_secondary_libelle
|
||||
%li.mb-1= t("update_drop_down_secondary_libelle#{postfix}", label: change[:label], to: change[:to], scope: [:new_administrateur, :revision_changes])
|
||||
- when :drop_down_secondary_description
|
||||
%li.mb-1= t("update_drop_down_secondary_description#{postfix}", label: change[:label], to: change[:to], scope: [:new_administrateur, :revision_changes])
|
||||
- when :mandatory
|
||||
- if change[:from] == false
|
||||
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory.enabled')
|
||||
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory_private.enabled')
|
||||
%li.mb-1= t("new_administrateur.revision_changes.update_mandatory#{postfix}.enabled", label: change[:label])
|
||||
- else
|
||||
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory.disabled')
|
||||
-# i18n-tasks-use t('new_administrateur.revision_changes.update_mandatory_private.disabled')
|
||||
%li.mb-1= t("new_administrateur.revision_changes.update_mandatory#{postfix}.disabled", label: change[:label])
|
||||
- when :piece_justificative_template
|
||||
-# i18n-tasks-use t('new_administrateur.revision_changes.update_piece_justificative_template')
|
||||
-# i18n-tasks-use t('new_administrateur.revision_changes.update_piece_justificative_template_private')
|
||||
%li.mb-1= t("new_administrateur.revision_changes.update_piece_justificative_template#{postfix}", label: change[:label])
|
||||
- when :drop_down_options
|
||||
- added = change[:to].sort - change[:from].sort
|
||||
- removed = change[:from].sort - change[:to].sort
|
||||
%li.mb-1
|
||||
= t("update_drop_down_options#{postfix}", scope: [:new_administrateur, :revision_changes], label: change[:label])
|
||||
%ul
|
||||
- if added.present?
|
||||
%li= t(:add_option, scope: [:new_administrateur, :revision_changes], items: added.map{ |term| "« #{term.strip} »" }.join(", "))
|
||||
- if removed.present?
|
||||
%li= t(:remove_option, scope: [:new_administrateur, :revision_changes], items: removed.map{ |term| "« #{term.strip} »" }.join(", "))
|
||||
- when :drop_down_other
|
||||
- if change[:from] == false
|
||||
%li.mb-1= t("new_administrateur.revision_changes.update_drop_down_other#{postfix}.enabled", label: change[:label])
|
||||
- else
|
||||
%li.mb-1= t("new_administrateur.revision_changes.update_drop_down_other#{postfix}.disabled", label: change[:label])
|
||||
- when :carte_layers
|
||||
- added = change[:to].sort - change[:from].sort
|
||||
- removed = change[:from].sort - change[:to].sort
|
||||
%li.mb-1
|
||||
= t("update_carte_layers#{postfix}", scope: [:new_administrateur, :revision_changes], label: change[:label])
|
||||
%ul
|
||||
- if added.present?
|
||||
%li= t(:add_option, scope: [:new_administrateur, :revision_changes], items: added.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "))
|
||||
- if removed.present?
|
||||
%li= t(:remove_option, scope: [:new_administrateur, :revision_changes], items: removed.map{ |term| "« #{t(term, scope: [:new_administrateur, :carte_layers])} »" }.join(", "))
|
||||
- move_changes, move_private_changes = changes.filter { |change| change[:op] == :move }.partition { |change| !change[:private] }
|
||||
- if move_changes.size != 0
|
||||
%li.mb-1= t(:move, scope: [:new_administrateur, :revision_changes], count: move_changes.size)
|
||||
- if move_private_changes.size != 0
|
||||
%li.mb-1= t(:move_private, scope: [:new_administrateur, :revision_changes], count: move_private_changes.size)
|
|
@ -1,4 +1,4 @@
|
|||
= render partial: 'new_administrateur/breadcrumbs',
|
||||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [link_to('Tableau de bord', tableau_de_bord_helper_path),
|
||||
'Profil'] }
|
||||
|
||||
|
|
|
@ -398,7 +398,7 @@ fr:
|
|||
identity_saved: "Identité enregistrée"
|
||||
attestation:
|
||||
no_longer_available: "L’attestation n'est plus disponible sur ce dossier."
|
||||
new_administrateur:
|
||||
administrateurs:
|
||||
procedures:
|
||||
show:
|
||||
ready: "Validé"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fr:
|
||||
new_administrateur:
|
||||
administrateurs:
|
||||
experts_procedures:
|
||||
wrong_address:
|
||||
one: "%{value} n’est pas une adresse email valide"
|
|
@ -1,5 +1,5 @@
|
|||
fr:
|
||||
new_administrateur:
|
||||
administrateurs:
|
||||
revision_changes:
|
||||
has_changes: Modifications en cours (appliqué à la prochaine publication)
|
||||
add: Le champ « %{label} » a été ajouté
|
|
@ -190,7 +190,7 @@ Rails.application.routes.draw do
|
|||
end
|
||||
|
||||
# order matters: we don't want those routes to match /admin/procedures/:id
|
||||
get 'admin/procedures/new' => 'new_administrateur/procedures#new', as: :new_admin_procedure
|
||||
get 'admin/procedures/new' => 'administrateurs/procedures#new', as: :new_admin_procedure
|
||||
|
||||
namespace :admin do
|
||||
get 'activate' => '/administrateurs/activate#new'
|
||||
|
@ -397,7 +397,7 @@ Rails.application.routes.draw do
|
|||
# Administrateur
|
||||
#
|
||||
|
||||
namespace :admin, module: 'new_administrateur' do
|
||||
scope module: 'administrateurs', path: 'admin', as: 'admin' do
|
||||
resources :procedures do
|
||||
collection do
|
||||
get 'new_from_existing'
|
||||
|
|
5
db/migrate/20211126150915_dropfeedbackstable.rb
Normal file
5
db/migrate/20211126150915_dropfeedbackstable.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Dropfeedbackstable < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
drop_table(:feedbacks, if_exists: true)
|
||||
end
|
||||
end
|
11
db/schema.rb
11
db/schema.rb
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_11_26_080118) do
|
||||
ActiveRecord::Schema.define(version: 2021_11_26_150915) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -433,14 +433,6 @@ ActiveRecord::Schema.define(version: 2021_11_26_080118) do
|
|||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "feedbacks", force: :cascade do |t|
|
||||
t.bigint "user_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "rating", null: false
|
||||
t.index ["user_id"], name: "index_feedbacks_on_user_id"
|
||||
end
|
||||
|
||||
create_table "flipper_features", force: :cascade do |t|
|
||||
t.string "key", null: false
|
||||
t.datetime "created_at", null: false
|
||||
|
@ -854,7 +846,6 @@ ActiveRecord::Schema.define(version: 2021_11_26_080118) do
|
|||
add_foreign_key "dossiers", "users"
|
||||
add_foreign_key "experts_procedures", "experts"
|
||||
add_foreign_key "experts_procedures", "procedures"
|
||||
add_foreign_key "feedbacks", "users"
|
||||
add_foreign_key "france_connect_informations", "users"
|
||||
add_foreign_key "geo_areas", "champs"
|
||||
add_foreign_key "groupe_instructeurs", "procedures"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
describe NewAdministrateur::AdministrateurController, type: :controller do
|
||||
describe Administrateurs::AdministrateurController, type: :controller do
|
||||
describe 'before actions: authenticate_administrateur!' do
|
||||
it 'is present' do
|
||||
before_actions = NewAdministrateur::AdministrateurController
|
||||
before_actions = Administrateurs::AdministrateurController
|
||||
._process_action_callbacks
|
||||
.filter { |process_action_callbacks| process_action_callbacks.kind == :before }
|
||||
.map(&:filter)
|
|
@ -1,6 +1,6 @@
|
|||
include ActionDispatch::TestProcess
|
||||
|
||||
describe NewAdministrateur::AttestationTemplatesController, type: :controller do
|
||||
describe Administrateurs::AttestationTemplatesController, type: :controller do
|
||||
let!(:attestation_template) { create(:attestation_template) }
|
||||
let(:admin) { create(:administrateur) }
|
||||
let!(:procedure) { create :procedure, administrateur: admin, attestation_template: attestation_template }
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::ExpertsProceduresController, type: :controller do
|
||||
describe Administrateurs::ExpertsProceduresController, type: :controller do
|
||||
let(:admin) { create(:administrateur) }
|
||||
let(:procedure) { create :procedure, administrateur: admin }
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::GroupeInstructeursController, type: :controller do
|
||||
describe Administrateurs::GroupeInstructeursController, type: :controller do
|
||||
render_views
|
||||
|
||||
let(:admin) { create(:administrateur) }
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::JetonParticulierController, type: :controller do
|
||||
describe Administrateurs::JetonParticulierController, type: :controller do
|
||||
let(:admin) { create(:administrateur) }
|
||||
let(:procedure) { create(:procedure, administrateur: admin) }
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::MailTemplatesController, type: :controller do
|
||||
describe Administrateurs::MailTemplatesController, type: :controller do
|
||||
render_views
|
||||
let(:procedure) { create :procedure }
|
||||
let(:initiated_mail) { Mails::InitiatedMail.default_for_procedure(procedure) }
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::ProceduresController, type: :controller do
|
||||
describe Administrateurs::ProceduresController, type: :controller do
|
||||
let(:admin) { create(:administrateur) }
|
||||
let(:bad_procedure_id) { 100000 }
|
||||
|
||||
|
@ -64,7 +64,7 @@ describe NewAdministrateur::ProceduresController, type: :controller do
|
|||
|
||||
describe 'GET #new_from_existing' do
|
||||
before do
|
||||
stub_const("NewAdministrateur::ProceduresController::SIGNIFICANT_DOSSIERS_THRESHOLD", 2)
|
||||
stub_const("Administrateurs::ProceduresController::SIGNIFICANT_DOSSIERS_THRESHOLD", 2)
|
||||
end
|
||||
|
||||
subject { get :new_from_existing }
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::ServicesController, type: :controller do
|
||||
describe Administrateurs::ServicesController, type: :controller do
|
||||
let(:admin) { create(:administrateur) }
|
||||
let(:procedure) { create(:procedure, administrateur: admin) }
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::SourcesParticulierController, type: :controller do
|
||||
describe Administrateurs::SourcesParticulierController, type: :controller do
|
||||
let(:admin) { create(:administrateur) }
|
||||
|
||||
before { sign_in(admin.user) }
|
||||
|
@ -53,7 +53,7 @@ describe NewAdministrateur::SourcesParticulierController, type: :controller do
|
|||
|
||||
it 'saves the source' do
|
||||
expect(procedure.api_particulier_sources).to eq("cnaf" => { "enfants" => ["nomPrenom"] })
|
||||
expect(flash.notice).to eq(I18n.t(".new_administrateur.sources_particulier.update.sources_ok"))
|
||||
expect(flash.notice).to eq(I18n.t(".administrateurs.sources_particulier.update.sources_ok"))
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,4 +1,4 @@
|
|||
describe NewAdministrateur::TypesDeChampController, type: :controller do
|
||||
describe Administrateurs::TypesDeChampController, type: :controller do
|
||||
let(:admin) { create(:administrateur) }
|
||||
|
||||
describe '#types_de_champs editor api' do
|
|
@ -160,20 +160,29 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
let(:dossier) { create(:dossier, :refuse, procedure: procedure) }
|
||||
let(:current_user) { instructeur.user }
|
||||
|
||||
before do
|
||||
sign_in current_user
|
||||
subject do
|
||||
post :repasser_en_instruction,
|
||||
params: { procedure_id: procedure.id, dossier_id: dossier.id },
|
||||
format: 'js'
|
||||
params: { procedure_id: procedure.id, dossier_id: dossier.id },
|
||||
format: 'js'
|
||||
end
|
||||
|
||||
it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction)) }
|
||||
it { expect(response).to have_http_status(:ok) }
|
||||
it { expect(response.body).to include('.header-actions') }
|
||||
before do
|
||||
sign_in current_user
|
||||
end
|
||||
|
||||
context 'when the dossier is refuse' do
|
||||
before { subject }
|
||||
|
||||
it { expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction)) }
|
||||
it { expect(response).to have_http_status(:ok) }
|
||||
it { expect(response.body).to include('.header-actions') }
|
||||
end
|
||||
|
||||
context 'when the dossier has already been put en_instruction' do
|
||||
let(:dossier) { create(:dossier, :en_instruction, procedure: procedure) }
|
||||
|
||||
before { subject }
|
||||
|
||||
it 'warns about the error' do
|
||||
expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction))
|
||||
expect(response).to have_http_status(:ok)
|
||||
|
@ -184,11 +193,27 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
context 'when the dossier is accepte' do
|
||||
let(:dossier) { create(:dossier, :accepte, procedure: procedure) }
|
||||
|
||||
before { subject }
|
||||
|
||||
it 'it is possible to go back to en_instruction as instructeur' do
|
||||
expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction))
|
||||
expect(response).to have_http_status(:ok)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the dossier is done and the user delete it' do
|
||||
let!(:dossier) { create(:dossier, :accepte, procedure: procedure, user: current_user) }
|
||||
|
||||
before do
|
||||
dossier.update!(hidden_by_user_at: Time.zone.now)
|
||||
subject
|
||||
end
|
||||
|
||||
it 'reveals the dossier' do
|
||||
expect(dossier.reload.state).to eq(Dossier.states.fetch(:en_instruction))
|
||||
expect(dossier.reload.hidden_by_user_at).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#terminer' do
|
||||
|
|
|
@ -29,6 +29,7 @@ describe Manager::UsersController, type: :controller do
|
|||
subject
|
||||
|
||||
expect(User.find_by(id: user.id).email).to eq(nouvel_email)
|
||||
expect(response).to redirect_to(edit_manager_user_path(user))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -54,6 +55,7 @@ describe Manager::UsersController, type: :controller do
|
|||
subject
|
||||
|
||||
expect(flash[:notice]).to match("Le compte « email.existant@domaine.fr » a absorbé le compte « ancien.email@domaine.fr ».")
|
||||
expect(response).to redirect_to(edit_manager_user_path(targeted_user))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -850,6 +850,16 @@ describe Users::DossiersController, type: :controller do
|
|||
end
|
||||
it { expect(assigns(:statut)).to eq('en-cours') }
|
||||
end
|
||||
|
||||
context 'when the instructeur archive the dossier' do
|
||||
before do
|
||||
own_dossier2.update!(archived: true)
|
||||
get(:index, params: { statut: 'en-cours' })
|
||||
end
|
||||
it { expect(assigns(:statut)).to eq('en-cours') }
|
||||
it { expect(assigns(:dossiers_traites).map(&:id)).to eq([own_dossier2.id]) }
|
||||
it { expect(own_dossier2.archived).to be_truthy }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'sort order' do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require 'system/admin/procedure_spec_helper'
|
||||
require 'system/administrateurs/procedure_spec_helper'
|
||||
|
||||
describe 'As an administrateur I wanna clone a procedure', js: true do
|
||||
include ProcedureSpecHelper
|
|
@ -1,4 +1,4 @@
|
|||
require 'system/admin/procedure_spec_helper'
|
||||
require 'system/administrateurs/procedure_spec_helper'
|
||||
|
||||
describe 'As an administrateur I wanna create a new procedure', js: true do
|
||||
include ProcedureSpecHelper
|
|
@ -1,4 +1,4 @@
|
|||
require 'system/admin/procedure_spec_helper'
|
||||
require 'system/administrateurs/procedure_spec_helper'
|
||||
|
||||
describe 'Publication de démarches', js: true do
|
||||
include ProcedureSpecHelper
|
|
@ -1,4 +1,4 @@
|
|||
require 'system/admin/procedure_spec_helper'
|
||||
require 'system/administrateurs/procedure_spec_helper'
|
||||
|
||||
describe 'Administrateurs can edit procedures', js: true do
|
||||
include ProcedureSpecHelper
|
|
@ -1,4 +1,4 @@
|
|||
describe 'new_administrateur/experts_procedures/index.html.haml', type: :view do
|
||||
describe 'administrateurs/experts_procedures/index.html.haml', type: :view do
|
||||
let!(:procedure) { create(:procedure, :published) }
|
||||
|
||||
before do
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue