diff --git a/app/controllers/new_administrateur/administrateur_controller.rb b/app/controllers/administrateurs/administrateur_controller.rb similarity index 97% rename from app/controllers/new_administrateur/administrateur_controller.rb rename to app/controllers/administrateurs/administrateur_controller.rb index f4c4a1b0f..f9d3ffdef 100644 --- a/app/controllers/new_administrateur/administrateur_controller.rb +++ b/app/controllers/administrateurs/administrateur_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class AdministrateurController < ApplicationController before_action :authenticate_administrateur! diff --git a/app/controllers/new_administrateur/attestation_templates_controller.rb b/app/controllers/administrateurs/attestation_templates_controller.rb similarity index 95% rename from app/controllers/new_administrateur/attestation_templates_controller.rb rename to app/controllers/administrateurs/attestation_templates_controller.rb index 68a06e3a8..aff0bb793 100644 --- a/app/controllers/new_administrateur/attestation_templates_controller.rb +++ b/app/controllers/administrateurs/attestation_templates_controller.rb @@ -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 diff --git a/app/controllers/new_administrateur/experts_procedures_controller.rb b/app/controllers/administrateurs/experts_procedures_controller.rb similarity index 98% rename from app/controllers/new_administrateur/experts_procedures_controller.rb rename to app/controllers/administrateurs/experts_procedures_controller.rb index 11f3bf364..1a59bcba5 100644 --- a/app/controllers/new_administrateur/experts_procedures_controller.rb +++ b/app/controllers/administrateurs/experts_procedures_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class ExpertsProceduresController < AdministrateurController before_action :retrieve_procedure diff --git a/app/controllers/new_administrateur/groupe_instructeurs_controller.rb b/app/controllers/administrateurs/groupe_instructeurs_controller.rb similarity index 99% rename from app/controllers/new_administrateur/groupe_instructeurs_controller.rb rename to app/controllers/administrateurs/groupe_instructeurs_controller.rb index 594b6587e..db171b450 100644 --- a/app/controllers/new_administrateur/groupe_instructeurs_controller.rb +++ b/app/controllers/administrateurs/groupe_instructeurs_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class GroupeInstructeursController < AdministrateurController include ActiveSupport::NumberHelper ITEMS_PER_PAGE = 25 diff --git a/app/controllers/new_administrateur/jeton_particulier_controller.rb b/app/controllers/administrateurs/jeton_particulier_controller.rb similarity index 97% rename from app/controllers/new_administrateur/jeton_particulier_controller.rb rename to app/controllers/administrateurs/jeton_particulier_controller.rb index bc3e3fb3e..cb03f5251 100644 --- a/app/controllers/new_administrateur/jeton_particulier_controller.rb +++ b/app/controllers/administrateurs/jeton_particulier_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class JetonParticulierController < AdministrateurController before_action :retrieve_procedure diff --git a/app/controllers/new_administrateur/mail_templates_controller.rb b/app/controllers/administrateurs/mail_templates_controller.rb similarity index 98% rename from app/controllers/new_administrateur/mail_templates_controller.rb rename to app/controllers/administrateurs/mail_templates_controller.rb index 872f76ae5..bb1ac0988 100644 --- a/app/controllers/new_administrateur/mail_templates_controller.rb +++ b/app/controllers/administrateurs/mail_templates_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class MailTemplatesController < AdministrateurController include ActionView::Helpers::SanitizeHelper diff --git a/app/controllers/new_administrateur/procedure_administrateurs_controller.rb b/app/controllers/administrateurs/procedure_administrateurs_controller.rb similarity index 98% rename from app/controllers/new_administrateur/procedure_administrateurs_controller.rb rename to app/controllers/administrateurs/procedure_administrateurs_controller.rb index 60e1c5b98..c03c5c4a9 100644 --- a/app/controllers/new_administrateur/procedure_administrateurs_controller.rb +++ b/app/controllers/administrateurs/procedure_administrateurs_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class ProcedureAdministrateursController < AdministrateurController before_action :retrieve_procedure, except: [:new] diff --git a/app/controllers/new_administrateur/procedures_controller.rb b/app/controllers/administrateurs/procedures_controller.rb similarity index 99% rename from app/controllers/new_administrateur/procedures_controller.rb rename to app/controllers/administrateurs/procedures_controller.rb index f08aabc7e..f01c15556 100644 --- a/app/controllers/new_administrateur/procedures_controller.rb +++ b/app/controllers/administrateurs/procedures_controller.rb @@ -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] diff --git a/app/controllers/new_administrateur/services_controller.rb b/app/controllers/administrateurs/services_controller.rb similarity index 99% rename from app/controllers/new_administrateur/services_controller.rb rename to app/controllers/administrateurs/services_controller.rb index a7c9edf46..08835eb96 100644 --- a/app/controllers/new_administrateur/services_controller.rb +++ b/app/controllers/administrateurs/services_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class ServicesController < AdministrateurController def index @services = services.ordered diff --git a/app/controllers/new_administrateur/sources_particulier_controller.rb b/app/controllers/administrateurs/sources_particulier_controller.rb similarity index 97% rename from app/controllers/new_administrateur/sources_particulier_controller.rb rename to app/controllers/administrateurs/sources_particulier_controller.rb index 04c1bc1d7..094892b8f 100644 --- a/app/controllers/new_administrateur/sources_particulier_controller.rb +++ b/app/controllers/administrateurs/sources_particulier_controller.rb @@ -1,4 +1,4 @@ -module NewAdministrateur +module Administrateurs class SourcesParticulierController < AdministrateurController before_action :retrieve_procedure diff --git a/app/controllers/new_administrateur/types_de_champ_controller.rb b/app/controllers/administrateurs/types_de_champ_controller.rb similarity index 99% rename from app/controllers/new_administrateur/types_de_champ_controller.rb rename to app/controllers/administrateurs/types_de_champ_controller.rb index 49cc93507..499164d5e 100644 --- a/app/controllers/new_administrateur/types_de_champ_controller.rb +++ b/app/controllers/administrateurs/types_de_champ_controller.rb @@ -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] diff --git a/app/controllers/instructeurs/dossiers_controller.rb b/app/controllers/instructeurs/dossiers_controller.rb index 1f9bc3dd9..990f9aea3 100644 --- a/app/controllers/instructeurs/dossiers_controller.rb +++ b/app/controllers/instructeurs/dossiers_controller.rb @@ -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 diff --git a/app/controllers/manager/users_controller.rb b/app/controllers/manager/users_controller.rb index 7b3a376fe..934b37683 100644 --- a/app/controllers/manager/users_controller.rb +++ b/app/controllers/manager/users_controller.rb @@ -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 diff --git a/app/models/attestation_template.rb b/app/models/attestation_template.rb index 16f463d7f..6062589e8 100644 --- a/app/models/attestation_template.rb +++ b/app/models/attestation_template.rb @@ -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 } ) diff --git a/app/views/new_administrateur/_breadcrumbs.html.haml b/app/views/administrateurs/_breadcrumbs.html.haml similarity index 100% rename from app/views/new_administrateur/_breadcrumbs.html.haml rename to app/views/administrateurs/_breadcrumbs.html.haml diff --git a/app/views/new_administrateur/_groups_header.haml b/app/views/administrateurs/_groups_header.haml similarity index 100% rename from app/views/new_administrateur/_groups_header.haml rename to app/views/administrateurs/_groups_header.haml diff --git a/app/views/new_administrateur/attestation_templates/_apercu.html.haml b/app/views/administrateurs/attestation_templates/_apercu.html.haml similarity index 100% rename from app/views/new_administrateur/attestation_templates/_apercu.html.haml rename to app/views/administrateurs/attestation_templates/_apercu.html.haml diff --git a/app/views/new_administrateur/attestation_templates/_informations.html.haml b/app/views/administrateurs/attestation_templates/_informations.html.haml similarity index 100% rename from app/views/new_administrateur/attestation_templates/_informations.html.haml rename to app/views/administrateurs/attestation_templates/_informations.html.haml diff --git a/app/views/new_administrateur/attestation_templates/edit.html.haml b/app/views/administrateurs/attestation_templates/edit.html.haml similarity index 85% rename from app/views/new_administrateur/attestation_templates/edit.html.haml rename to app/views/administrateurs/attestation_templates/edit.html.haml index 5c470a5d3..28d0bea63 100644 --- a/app/views/new_administrateur/attestation_templates/edit.html.haml +++ b/app/views/administrateurs/attestation_templates/edit.html.haml @@ -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 } diff --git a/app/views/new_administrateur/attestation_templates/show.pdf.prawn b/app/views/administrateurs/attestation_templates/show.pdf.prawn similarity index 100% rename from app/views/new_administrateur/attestation_templates/show.pdf.prawn rename to app/views/administrateurs/attestation_templates/show.pdf.prawn diff --git a/app/views/new_administrateur/experts_procedures/index.html.haml b/app/views/administrateurs/experts_procedures/index.html.haml similarity index 98% rename from app/views/new_administrateur/experts_procedures/index.html.haml rename to app/views/administrateurs/experts_procedures/index.html.haml index 8303a05e2..9c3264b72 100644 --- a/app/views/new_administrateur/experts_procedures/index.html.haml +++ b/app/views/administrateurs/experts_procedures/index.html.haml @@ -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'] } diff --git a/app/views/new_administrateur/groupe_instructeurs/_edit.html.haml b/app/views/administrateurs/groupe_instructeurs/_edit.html.haml similarity index 97% rename from app/views/new_administrateur/groupe_instructeurs/_edit.html.haml rename to app/views/administrateurs/groupe_instructeurs/_edit.html.haml index 02017ede1..0f7f63943 100644 --- a/app/views/new_administrateur/groupe_instructeurs/_edit.html.haml +++ b/app/views/administrateurs/groupe_instructeurs/_edit.html.haml @@ -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. diff --git a/app/views/new_administrateur/groupe_instructeurs/_instructeurs.html.haml b/app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml similarity index 100% rename from app/views/new_administrateur/groupe_instructeurs/_instructeurs.html.haml rename to app/views/administrateurs/groupe_instructeurs/_instructeurs.html.haml diff --git a/app/views/new_administrateur/groupe_instructeurs/_routing.html.haml b/app/views/administrateurs/groupe_instructeurs/_routing.html.haml similarity index 100% rename from app/views/new_administrateur/groupe_instructeurs/_routing.html.haml rename to app/views/administrateurs/groupe_instructeurs/_routing.html.haml diff --git a/app/views/new_administrateur/groupe_instructeurs/index.html.haml b/app/views/administrateurs/groupe_instructeurs/index.html.haml similarity index 61% rename from app/views/new_administrateur/groupe_instructeurs/index.html.haml rename to app/views/administrateurs/groupe_instructeurs/index.html.haml index 0483de148..bdb4ff030 100644 --- a/app/views/new_administrateur/groupe_instructeurs/index.html.haml +++ b/app/views/administrateurs/groupe_instructeurs/index.html.haml @@ -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 } - diff --git a/app/views/new_administrateur/groupe_instructeurs/reaffecter_dossiers.html.haml b/app/views/administrateurs/groupe_instructeurs/reaffecter_dossiers.html.haml similarity index 96% rename from app/views/new_administrateur/groupe_instructeurs/reaffecter_dossiers.html.haml rename to app/views/administrateurs/groupe_instructeurs/reaffecter_dossiers.html.haml index eae251882..e66f0c12f 100644 --- a/app/views/new_administrateur/groupe_instructeurs/reaffecter_dossiers.html.haml +++ b/app/views/administrateurs/groupe_instructeurs/reaffecter_dossiers.html.haml @@ -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)), diff --git a/app/views/new_administrateur/groupe_instructeurs/show.html.haml b/app/views/administrateurs/groupe_instructeurs/show.html.haml similarity index 74% rename from app/views/new_administrateur/groupe_instructeurs/show.html.haml rename to app/views/administrateurs/groupe_instructeurs/show.html.haml index 6a347bbd9..aefd354ca 100644 --- a/app/views/new_administrateur/groupe_instructeurs/show.html.haml +++ b/app/views/administrateurs/groupe_instructeurs/show.html.haml @@ -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, diff --git a/app/views/new_administrateur/jeton_particulier/api_particulier.html.haml b/app/views/administrateurs/jeton_particulier/api_particulier.html.haml similarity index 89% rename from app/views/new_administrateur/jeton_particulier/api_particulier.html.haml rename to app/views/administrateurs/jeton_particulier/api_particulier.html.haml index 40f23fa2c..83b6d11da 100644 --- a/app/views/new_administrateur/jeton_particulier/api_particulier.html.haml +++ b/app/views/administrateurs/jeton_particulier/api_particulier.html.haml @@ -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') diff --git a/app/views/new_administrateur/jeton_particulier/show.html.haml b/app/views/administrateurs/jeton_particulier/show.html.haml similarity index 94% rename from app/views/new_administrateur/jeton_particulier/show.html.haml rename to app/views/administrateurs/jeton_particulier/show.html.haml index 30f7a0e57..de7d3734e 100644 --- a/app/views/new_administrateur/jeton_particulier/show.html.haml +++ b/app/views/administrateurs/jeton_particulier/show.html.haml @@ -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)), diff --git a/app/views/new_administrateur/mail_templates/_apercu.html.haml b/app/views/administrateurs/mail_templates/_apercu.html.haml similarity index 100% rename from app/views/new_administrateur/mail_templates/_apercu.html.haml rename to app/views/administrateurs/mail_templates/_apercu.html.haml diff --git a/app/views/new_administrateur/mail_templates/_form.html.haml b/app/views/administrateurs/mail_templates/_form.html.haml similarity index 100% rename from app/views/new_administrateur/mail_templates/_form.html.haml rename to app/views/administrateurs/mail_templates/_form.html.haml diff --git a/app/views/new_administrateur/mail_templates/edit.html.haml b/app/views/administrateurs/mail_templates/edit.html.haml similarity index 96% rename from app/views/new_administrateur/mail_templates/edit.html.haml rename to app/views/administrateurs/mail_templates/edit.html.haml index c719e8bfe..2b2afdde5 100644 --- a/app/views/new_administrateur/mail_templates/edit.html.haml +++ b/app/views/administrateurs/mail_templates/edit.html.haml @@ -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 } - diff --git a/app/views/new_administrateur/mail_templates/index.html.haml b/app/views/administrateurs/mail_templates/index.html.haml similarity index 93% rename from app/views/new_administrateur/mail_templates/index.html.haml rename to app/views/administrateurs/mail_templates/index.html.haml index 8d4963992..7978ff757 100644 --- a/app/views/new_administrateur/mail_templates/index.html.haml +++ b/app/views/administrateurs/mail_templates/index.html.haml @@ -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"] } diff --git a/app/views/new_administrateur/procedure_administrateurs/_add_admin_form.html.haml b/app/views/administrateurs/procedure_administrateurs/_add_admin_form.html.haml similarity index 100% rename from app/views/new_administrateur/procedure_administrateurs/_add_admin_form.html.haml rename to app/views/administrateurs/procedure_administrateurs/_add_admin_form.html.haml diff --git a/app/views/new_administrateur/procedure_administrateurs/_administrateur.html.haml b/app/views/administrateurs/procedure_administrateurs/_administrateur.html.haml similarity index 100% rename from app/views/new_administrateur/procedure_administrateurs/_administrateur.html.haml rename to app/views/administrateurs/procedure_administrateurs/_administrateur.html.haml diff --git a/app/views/new_administrateur/procedure_administrateurs/create.js.haml b/app/views/administrateurs/procedure_administrateurs/create.js.haml similarity index 100% rename from app/views/new_administrateur/procedure_administrateurs/create.js.haml rename to app/views/administrateurs/procedure_administrateurs/create.js.haml diff --git a/app/views/new_administrateur/procedure_administrateurs/destroy.js.haml b/app/views/administrateurs/procedure_administrateurs/destroy.js.haml similarity index 100% rename from app/views/new_administrateur/procedure_administrateurs/destroy.js.haml rename to app/views/administrateurs/procedure_administrateurs/destroy.js.haml diff --git a/app/views/new_administrateur/procedure_administrateurs/index.html.haml b/app/views/administrateurs/procedure_administrateurs/index.html.haml similarity index 92% rename from app/views/new_administrateur/procedure_administrateurs/index.html.haml rename to app/views/administrateurs/procedure_administrateurs/index.html.haml index 8383f5e78..d3545a511 100644 --- a/app/views/new_administrateur/procedure_administrateurs/index.html.haml +++ b/app/views/administrateurs/procedure_administrateurs/index.html.haml @@ -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 } diff --git a/app/views/new_administrateur/procedures/_informations.html.haml b/app/views/administrateurs/procedures/_informations.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/_informations.html.haml rename to app/views/administrateurs/procedures/_informations.html.haml diff --git a/app/views/new_administrateur/procedures/_monavis.html.haml b/app/views/administrateurs/procedures/_monavis.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/_monavis.html.haml rename to app/views/administrateurs/procedures/_monavis.html.haml diff --git a/app/views/new_administrateur/procedures/_procedure_transfert.html.haml b/app/views/administrateurs/procedures/_procedure_transfert.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/_procedure_transfert.html.haml rename to app/views/administrateurs/procedures/_procedure_transfert.html.haml diff --git a/app/views/new_administrateur/procedures/_procedures_list.html.haml b/app/views/administrateurs/procedures/_procedures_list.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/_procedures_list.html.haml rename to app/views/administrateurs/procedures/_procedures_list.html.haml diff --git a/app/views/new_administrateur/procedures/_publication_form.html.haml b/app/views/administrateurs/procedures/_publication_form.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/_publication_form.html.haml rename to app/views/administrateurs/procedures/_publication_form.html.haml diff --git a/app/views/administrateurs/procedures/_revision_changes.html.haml b/app/views/administrateurs/procedures/_revision_changes.html.haml new file mode 100644 index 000000000..d56915cb9 --- /dev/null +++ b/app/views/administrateurs/procedures/_revision_changes.html.haml @@ -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) diff --git a/app/views/new_administrateur/procedures/annotations.html.haml b/app/views/administrateurs/procedures/annotations.html.haml similarity index 87% rename from app/views/new_administrateur/procedures/annotations.html.haml rename to app/views/administrateurs/procedures/annotations.html.haml index a03645478..c37aab001 100644 --- a/app/views/new_administrateur/procedures/annotations.html.haml +++ b/app/views/administrateurs/procedures/annotations.html.haml @@ -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 } diff --git a/app/views/new_administrateur/procedures/apercu.html.haml b/app/views/administrateurs/procedures/apercu.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/apercu.html.haml rename to app/views/administrateurs/procedures/apercu.html.haml diff --git a/app/views/new_administrateur/procedures/champs.html.haml b/app/views/administrateurs/procedures/champs.html.haml similarity index 86% rename from app/views/new_administrateur/procedures/champs.html.haml rename to app/views/administrateurs/procedures/champs.html.haml index f88a14948..77cccb1fc 100644 --- a/app/views/new_administrateur/procedures/champs.html.haml +++ b/app/views/administrateurs/procedures/champs.html.haml @@ -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 } diff --git a/app/views/new_administrateur/procedures/edit.html.haml b/app/views/administrateurs/procedures/edit.html.haml similarity index 80% rename from app/views/new_administrateur/procedures/edit.html.haml rename to app/views/administrateurs/procedures/edit.html.haml index d80b92dd9..1c12d44be 100644 --- a/app/views/new_administrateur/procedures/edit.html.haml +++ b/app/views/administrateurs/procedures/edit.html.haml @@ -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 diff --git a/app/views/new_administrateur/procedures/index.html.haml b/app/views/administrateurs/procedures/index.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/index.html.haml rename to app/views/administrateurs/procedures/index.html.haml diff --git a/app/views/new_administrateur/procedures/jeton.html.haml b/app/views/administrateurs/procedures/jeton.html.haml similarity index 83% rename from app/views/new_administrateur/procedures/jeton.html.haml rename to app/views/administrateurs/procedures/jeton.html.haml index 03b7abbaa..0bfdc1be7 100644 --- a/app/views/new_administrateur/procedures/jeton.html.haml +++ b/app/views/administrateurs/procedures/jeton.html.haml @@ -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/" diff --git a/app/views/new_administrateur/procedures/monavis.html.haml b/app/views/administrateurs/procedures/monavis.html.haml similarity index 65% rename from app/views/new_administrateur/procedures/monavis.html.haml rename to app/views/administrateurs/procedures/monavis.html.haml index db68638c6..a11ff46a4 100644 --- a/app/views/new_administrateur/procedures/monavis.html.haml +++ b/app/views/administrateurs/procedures/monavis.html.haml @@ -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' diff --git a/app/views/new_administrateur/procedures/new.html.haml b/app/views/administrateurs/procedures/new.html.haml similarity index 79% rename from app/views/new_administrateur/procedures/new.html.haml rename to app/views/administrateurs/procedures/new.html.haml index f12097cef..2a75df20b 100644 --- a/app/views/new_administrateur/procedures/new.html.haml +++ b/app/views/administrateurs/procedures/new.html.haml @@ -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 diff --git a/app/views/new_administrateur/procedures/new_from_existing.html.haml b/app/views/administrateurs/procedures/new_from_existing.html.haml similarity index 100% rename from app/views/new_administrateur/procedures/new_from_existing.html.haml rename to app/views/administrateurs/procedures/new_from_existing.html.haml diff --git a/app/views/new_administrateur/procedures/publication.html.haml b/app/views/administrateurs/procedures/publication.html.haml similarity index 99% rename from app/views/new_administrateur/procedures/publication.html.haml rename to app/views/administrateurs/procedures/publication.html.haml index 281966184..8beeff598 100644 --- a/app/views/new_administrateur/procedures/publication.html.haml +++ b/app/views/administrateurs/procedures/publication.html.haml @@ -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'] } diff --git a/app/views/new_administrateur/procedures/show.html.haml b/app/views/administrateurs/procedures/show.html.haml similarity index 98% rename from app/views/new_administrateur/procedures/show.html.haml rename to app/views/administrateurs/procedures/show.html.haml index 40d26f61e..3ca5d9a83 100644 --- a/app/views/new_administrateur/procedures/show.html.haml +++ b/app/views/administrateurs/procedures/show.html.haml @@ -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 diff --git a/app/views/new_administrateur/procedures/transfert.html.haml b/app/views/administrateurs/procedures/transfert.html.haml similarity index 82% rename from app/views/new_administrateur/procedures/transfert.html.haml rename to app/views/administrateurs/procedures/transfert.html.haml index 1f7666686..1a6c03926 100644 --- a/app/views/new_administrateur/procedures/transfert.html.haml +++ b/app/views/administrateurs/procedures/transfert.html.haml @@ -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'] } diff --git a/app/views/new_administrateur/services/_form.html.haml b/app/views/administrateurs/services/_form.html.haml similarity index 100% rename from app/views/new_administrateur/services/_form.html.haml rename to app/views/administrateurs/services/_form.html.haml diff --git a/app/views/new_administrateur/services/edit.html.haml b/app/views/administrateurs/services/edit.html.haml similarity index 89% rename from app/views/new_administrateur/services/edit.html.haml rename to app/views/administrateurs/services/edit.html.haml index 95d54c652..d16808f86 100644 --- a/app/views/new_administrateur/services/edit.html.haml +++ b/app/views/administrateurs/services/edit.html.haml @@ -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)), diff --git a/app/views/new_administrateur/services/index.html.haml b/app/views/administrateurs/services/index.html.haml similarity index 87% rename from app/views/new_administrateur/services/index.html.haml rename to app/views/administrateurs/services/index.html.haml index 58ce9bc22..62929fc27 100644 --- a/app/views/new_administrateur/services/index.html.haml +++ b/app/views/administrateurs/services/index.html.haml @@ -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 ] }, diff --git a/app/views/new_administrateur/services/new.html.haml b/app/views/administrateurs/services/new.html.haml similarity index 88% rename from app/views/new_administrateur/services/new.html.haml rename to app/views/administrateurs/services/new.html.haml index a51ab24d1..56526d026 100644 --- a/app/views/new_administrateur/services/new.html.haml +++ b/app/views/administrateurs/services/new.html.haml @@ -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)), diff --git a/app/views/new_administrateur/sources_particulier/show.html.haml b/app/views/administrateurs/sources_particulier/show.html.haml similarity index 96% rename from app/views/new_administrateur/sources_particulier/show.html.haml rename to app/views/administrateurs/sources_particulier/show.html.haml index 6f839d482..ff040e2a0 100644 --- a/app/views/new_administrateur/sources_particulier/show.html.haml +++ b/app/views/administrateurs/sources_particulier/show.html.haml @@ -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)), diff --git a/app/views/groupe_instructeur_mailer/add_instructeurs.html.haml b/app/views/groupe_instructeur_mailer/add_instructeurs.html.haml index b6f0dabff..31a5f3c10 100644 --- a/app/views/groupe_instructeur_mailer/add_instructeurs.html.haml +++ b/app/views/groupe_instructeur_mailer/add_instructeurs.html.haml @@ -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 : diff --git a/app/views/instructeurs/archives/index.html.haml b/app/views/instructeurs/archives/index.html.haml index 0557308d7..3deac155e 100644 --- a/app/views/instructeurs/archives/index.html.haml +++ b/app/views/instructeurs/archives/index.html.haml @@ -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'] } diff --git a/app/views/instructeurs/groupe_instructeurs/index.html.haml b/app/views/instructeurs/groupe_instructeurs/index.html.haml index 009e150fb..e7b44936f 100644 --- a/app/views/instructeurs/groupe_instructeurs/index.html.haml +++ b/app/views/instructeurs/groupe_instructeurs/index.html.haml @@ -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'] } diff --git a/app/views/instructeurs/groupe_instructeurs/show.html.haml b/app/views/instructeurs/groupe_instructeurs/show.html.haml index fa7f61c2e..a5d1b26aa 100644 --- a/app/views/instructeurs/groupe_instructeurs/show.html.haml +++ b/app/views/instructeurs/groupe_instructeurs/show.html.haml @@ -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 diff --git a/app/views/instructeurs/procedures/email_notifications.html.haml b/app/views/instructeurs/procedures/email_notifications.html.haml index 814b43d56..7b5335845 100644 --- a/app/views/instructeurs/procedures/email_notifications.html.haml +++ b/app/views/instructeurs/procedures/email_notifications.html.haml @@ -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'] } diff --git a/app/views/instructeurs/procedures/email_usagers.html.haml b/app/views/instructeurs/procedures/email_usagers.html.haml index 72a54dc77..1c6002e36 100644 --- a/app/views/instructeurs/procedures/email_usagers.html.haml +++ b/app/views/instructeurs/procedures/email_usagers.html.haml @@ -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 - diff --git a/app/views/instructeurs/procedures/stats.html.haml b/app/views/instructeurs/procedures/stats.html.haml index 4d83e6d16..606869b90 100644 --- a/app/views/instructeurs/procedures/stats.html.haml +++ b/app/views/instructeurs/procedures/stats.html.haml @@ -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'] } diff --git a/app/views/new_administrateur/procedures/_revision_changes.html.haml b/app/views/new_administrateur/procedures/_revision_changes.html.haml deleted file mode 100644 index 1c7e936c5..000000000 --- a/app/views/new_administrateur/procedures/_revision_changes.html.haml +++ /dev/null @@ -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) diff --git a/app/views/users/profil/show.html.haml b/app/views/users/profil/show.html.haml index 723ff7f24..ebce57a8b 100644 --- a/app/views/users/profil/show.html.haml +++ b/app/views/users/profil/show.html.haml @@ -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'] } diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5196e8aab..4f8510a83 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -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é" diff --git a/config/locales/views/new_administrateur/groupe_instructeurs/fr.yml b/config/locales/views/administrateurs/groupe_instructeurs/fr.yml similarity index 98% rename from config/locales/views/new_administrateur/groupe_instructeurs/fr.yml rename to config/locales/views/administrateurs/groupe_instructeurs/fr.yml index 57b15b066..b365e378d 100644 --- a/config/locales/views/new_administrateur/groupe_instructeurs/fr.yml +++ b/config/locales/views/administrateurs/groupe_instructeurs/fr.yml @@ -1,5 +1,5 @@ fr: - new_administrateur: + administrateurs: experts_procedures: wrong_address: one: "%{value} n’est pas une adresse email valide" @@ -38,7 +38,7 @@ fr:

Cette fonctionnalité permet d’acheminer les dossier vers chaque groupe, et de ne plus avoir besoin de filtrer ses dossiers parmi une grande quantité de demandes. Elle est donc particulièrement adaptée pour les démarches nationales instruites localement.

- Les instructeurs ne voient que les dossiers les concernant, et n’ont donc pas accès aux données extérieures à leur périmètre. + Les instructeurs ne voient que les dossiers les concernant, et n’ont donc pas accès aux données extérieures à leur périmètre. self_managment_notice_html: | L’autogestion des instructeurs permet aux instructeurs de gérer eux-mêmes la liste des instructeurs de la démarche. button: diff --git a/config/locales/views/new_administrateur/revision_changes/fr.yml b/config/locales/views/administrateurs/revision_changes/fr.yml similarity index 99% rename from config/locales/views/new_administrateur/revision_changes/fr.yml rename to config/locales/views/administrateurs/revision_changes/fr.yml index 495f1728f..53ca50c99 100644 --- a/config/locales/views/new_administrateur/revision_changes/fr.yml +++ b/config/locales/views/administrateurs/revision_changes/fr.yml @@ -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é diff --git a/config/routes.rb b/config/routes.rb index 30df3ec00..27f0d796d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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' diff --git a/db/migrate/20211126150915_dropfeedbackstable.rb b/db/migrate/20211126150915_dropfeedbackstable.rb new file mode 100644 index 000000000..a37442b4c --- /dev/null +++ b/db/migrate/20211126150915_dropfeedbackstable.rb @@ -0,0 +1,5 @@ +class Dropfeedbackstable < ActiveRecord::Migration[6.1] + def up + drop_table(:feedbacks, if_exists: true) + end +end diff --git a/db/schema.rb b/db/schema.rb index d9eaf5fab..9d45dd8de 100644 --- a/db/schema.rb +++ b/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" diff --git a/spec/controllers/administrateur/activate_controller_spec.rb b/spec/controllers/administrateurs/activate_controller_spec.rb similarity index 100% rename from spec/controllers/administrateur/activate_controller_spec.rb rename to spec/controllers/administrateurs/activate_controller_spec.rb diff --git a/spec/controllers/new_administrateur/administrateur_controller_spec.rb b/spec/controllers/administrateurs/administrateur_controller_spec.rb similarity index 69% rename from spec/controllers/new_administrateur/administrateur_controller_spec.rb rename to spec/controllers/administrateurs/administrateur_controller_spec.rb index d55ce9b99..8923f1f02 100644 --- a/spec/controllers/new_administrateur/administrateur_controller_spec.rb +++ b/spec/controllers/administrateurs/administrateur_controller_spec.rb @@ -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) diff --git a/spec/controllers/new_administrateur/attestation_templates_controller_spec.rb b/spec/controllers/administrateurs/attestation_templates_controller_spec.rb similarity index 98% rename from spec/controllers/new_administrateur/attestation_templates_controller_spec.rb rename to spec/controllers/administrateurs/attestation_templates_controller_spec.rb index 2b7927ba7..401eb0be1 100644 --- a/spec/controllers/new_administrateur/attestation_templates_controller_spec.rb +++ b/spec/controllers/administrateurs/attestation_templates_controller_spec.rb @@ -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 } diff --git a/spec/controllers/new_administrateur/experts_procedures_controller_spec.rb b/spec/controllers/administrateurs/experts_procedures_controller_spec.rb similarity index 96% rename from spec/controllers/new_administrateur/experts_procedures_controller_spec.rb rename to spec/controllers/administrateurs/experts_procedures_controller_spec.rb index 8f5162ea0..6a9ca33d5 100644 --- a/spec/controllers/new_administrateur/experts_procedures_controller_spec.rb +++ b/spec/controllers/administrateurs/experts_procedures_controller_spec.rb @@ -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 } diff --git a/spec/controllers/new_administrateur/groupe_instructeurs_controller_spec.rb b/spec/controllers/administrateurs/groupe_instructeurs_controller_spec.rb similarity index 99% rename from spec/controllers/new_administrateur/groupe_instructeurs_controller_spec.rb rename to spec/controllers/administrateurs/groupe_instructeurs_controller_spec.rb index c789f8fc2..c735c332a 100644 --- a/spec/controllers/new_administrateur/groupe_instructeurs_controller_spec.rb +++ b/spec/controllers/administrateurs/groupe_instructeurs_controller_spec.rb @@ -1,4 +1,4 @@ -describe NewAdministrateur::GroupeInstructeursController, type: :controller do +describe Administrateurs::GroupeInstructeursController, type: :controller do render_views let(:admin) { create(:administrateur) } diff --git a/spec/controllers/new_administrateur/jeton_particulier_controller_spec.rb b/spec/controllers/administrateurs/jeton_particulier_controller_spec.rb similarity index 97% rename from spec/controllers/new_administrateur/jeton_particulier_controller_spec.rb rename to spec/controllers/administrateurs/jeton_particulier_controller_spec.rb index 5142c78e2..082731d85 100644 --- a/spec/controllers/new_administrateur/jeton_particulier_controller_spec.rb +++ b/spec/controllers/administrateurs/jeton_particulier_controller_spec.rb @@ -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) } diff --git a/spec/controllers/new_administrateur/mail_templates_controller_spec.rb b/spec/controllers/administrateurs/mail_templates_controller_spec.rb similarity index 96% rename from spec/controllers/new_administrateur/mail_templates_controller_spec.rb rename to spec/controllers/administrateurs/mail_templates_controller_spec.rb index 36a2a17a5..6095e772e 100644 --- a/spec/controllers/new_administrateur/mail_templates_controller_spec.rb +++ b/spec/controllers/administrateurs/mail_templates_controller_spec.rb @@ -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) } diff --git a/spec/controllers/new_administrateur/procedures_controller_spec.rb b/spec/controllers/administrateurs/procedures_controller_spec.rb similarity index 99% rename from spec/controllers/new_administrateur/procedures_controller_spec.rb rename to spec/controllers/administrateurs/procedures_controller_spec.rb index bb0827d75..cfd865224 100644 --- a/spec/controllers/new_administrateur/procedures_controller_spec.rb +++ b/spec/controllers/administrateurs/procedures_controller_spec.rb @@ -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 } diff --git a/spec/controllers/new_administrateur/services_controller_spec.rb b/spec/controllers/administrateurs/services_controller_spec.rb similarity index 98% rename from spec/controllers/new_administrateur/services_controller_spec.rb rename to spec/controllers/administrateurs/services_controller_spec.rb index 21c0ca13d..9945edd0c 100644 --- a/spec/controllers/new_administrateur/services_controller_spec.rb +++ b/spec/controllers/administrateurs/services_controller_spec.rb @@ -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) } diff --git a/spec/controllers/new_administrateur/sources_particulier_controller_spec.rb b/spec/controllers/administrateurs/sources_particulier_controller_spec.rb similarity index 91% rename from spec/controllers/new_administrateur/sources_particulier_controller_spec.rb rename to spec/controllers/administrateurs/sources_particulier_controller_spec.rb index 0834e795f..e56c3ced7 100644 --- a/spec/controllers/new_administrateur/sources_particulier_controller_spec.rb +++ b/spec/controllers/administrateurs/sources_particulier_controller_spec.rb @@ -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 diff --git a/spec/controllers/new_administrateur/types_de_champ_controller_spec.rb b/spec/controllers/administrateurs/types_de_champ_controller_spec.rb similarity index 95% rename from spec/controllers/new_administrateur/types_de_champ_controller_spec.rb rename to spec/controllers/administrateurs/types_de_champ_controller_spec.rb index dcae29934..327bd0231 100644 --- a/spec/controllers/new_administrateur/types_de_champ_controller_spec.rb +++ b/spec/controllers/administrateurs/types_de_champ_controller_spec.rb @@ -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 diff --git a/spec/controllers/instructeurs/dossiers_controller_spec.rb b/spec/controllers/instructeurs/dossiers_controller_spec.rb index 6c7a8720e..49c51606a 100644 --- a/spec/controllers/instructeurs/dossiers_controller_spec.rb +++ b/spec/controllers/instructeurs/dossiers_controller_spec.rb @@ -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 diff --git a/spec/controllers/manager/users_controller_spec.rb b/spec/controllers/manager/users_controller_spec.rb index 602ad70eb..14bebcc1b 100644 --- a/spec/controllers/manager/users_controller_spec.rb +++ b/spec/controllers/manager/users_controller_spec.rb @@ -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 diff --git a/spec/controllers/users/dossiers_controller_spec.rb b/spec/controllers/users/dossiers_controller_spec.rb index b9a60f226..9b7517f44 100644 --- a/spec/controllers/users/dossiers_controller_spec.rb +++ b/spec/controllers/users/dossiers_controller_spec.rb @@ -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 diff --git a/spec/system/admin/admin_creation_spec.rb b/spec/system/administrateurs/admin_creation_spec.rb similarity index 100% rename from spec/system/admin/admin_creation_spec.rb rename to spec/system/administrateurs/admin_creation_spec.rb diff --git a/spec/system/admin/procedure_cloning_spec.rb b/spec/system/administrateurs/procedure_cloning_spec.rb similarity index 96% rename from spec/system/admin/procedure_cloning_spec.rb rename to spec/system/administrateurs/procedure_cloning_spec.rb index bd4535ecc..136202b02 100644 --- a/spec/system/admin/procedure_cloning_spec.rb +++ b/spec/system/administrateurs/procedure_cloning_spec.rb @@ -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 diff --git a/spec/system/admin/procedure_creation_spec.rb b/spec/system/administrateurs/procedure_creation_spec.rb similarity index 98% rename from spec/system/admin/procedure_creation_spec.rb rename to spec/system/administrateurs/procedure_creation_spec.rb index 09025a0ba..904141ddd 100644 --- a/spec/system/admin/procedure_creation_spec.rb +++ b/spec/system/administrateurs/procedure_creation_spec.rb @@ -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 diff --git a/spec/system/admin/procedure_locked_spec.rb b/spec/system/administrateurs/procedure_locked_spec.rb similarity index 100% rename from spec/system/admin/procedure_locked_spec.rb rename to spec/system/administrateurs/procedure_locked_spec.rb diff --git a/spec/system/admin/procedure_publish_spec.rb b/spec/system/administrateurs/procedure_publish_spec.rb similarity index 98% rename from spec/system/admin/procedure_publish_spec.rb rename to spec/system/administrateurs/procedure_publish_spec.rb index f60d5aed4..f2956fd71 100644 --- a/spec/system/admin/procedure_publish_spec.rb +++ b/spec/system/administrateurs/procedure_publish_spec.rb @@ -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 diff --git a/spec/system/admin/procedure_spec_helper.rb b/spec/system/administrateurs/procedure_spec_helper.rb similarity index 100% rename from spec/system/admin/procedure_spec_helper.rb rename to spec/system/administrateurs/procedure_spec_helper.rb diff --git a/spec/system/admin/procedure_update_spec.rb b/spec/system/administrateurs/procedure_update_spec.rb similarity index 97% rename from spec/system/admin/procedure_update_spec.rb rename to spec/system/administrateurs/procedure_update_spec.rb index adcf50507..f63328ba9 100644 --- a/spec/system/admin/procedure_update_spec.rb +++ b/spec/system/administrateurs/procedure_update_spec.rb @@ -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 diff --git a/spec/system/new_administrateur/types_de_champ_spec.rb b/spec/system/administrateurs/types_de_champ_spec.rb similarity index 100% rename from spec/system/new_administrateur/types_de_champ_spec.rb rename to spec/system/administrateurs/types_de_champ_spec.rb diff --git a/spec/views/admin/_closed_mail_template_attestation_inconsistency_alert.html.haml_spec.rb b/spec/views/administrateurs/_closed_mail_template_attestation_inconsistency_alert.html.haml_spec.rb similarity index 100% rename from spec/views/admin/_closed_mail_template_attestation_inconsistency_alert.html.haml_spec.rb rename to spec/views/administrateurs/_closed_mail_template_attestation_inconsistency_alert.html.haml_spec.rb diff --git a/spec/views/new_administrateur/experts_procedures/index.html.haml_spec.rb b/spec/views/administrateurs/experts_procedures/index.html.haml_spec.rb similarity index 95% rename from spec/views/new_administrateur/experts_procedures/index.html.haml_spec.rb rename to spec/views/administrateurs/experts_procedures/index.html.haml_spec.rb index 3084e4e2f..c40e3c10b 100644 --- a/spec/views/new_administrateur/experts_procedures/index.html.haml_spec.rb +++ b/spec/views/administrateurs/experts_procedures/index.html.haml_spec.rb @@ -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 diff --git a/spec/views/new_administrateur/mail_templates/edit.html.haml.spec.rb b/spec/views/administrateurs/mail_templates/edit.html.haml.spec.rb similarity index 87% rename from spec/views/new_administrateur/mail_templates/edit.html.haml.spec.rb rename to spec/views/administrateurs/mail_templates/edit.html.haml.spec.rb index b0317931d..99245b44b 100644 --- a/spec/views/new_administrateur/mail_templates/edit.html.haml.spec.rb +++ b/spec/views/administrateurs/mail_templates/edit.html.haml.spec.rb @@ -1,4 +1,4 @@ -describe 'new_administrateur/mail_templates/edit.html.haml', type: :view do +describe 'administrateurs/mail_templates/edit.html.haml', type: :view do let(:procedure) { create(:procedure) } let(:mail_template) { create(:received_mail, procedure: procedure) } let(:all_tags) { mail_template.tags } diff --git a/spec/views/new_administrateur/procedures/edit.html.haml_spec.rb b/spec/views/administrateurs/procedures/edit.html.haml_spec.rb similarity index 87% rename from spec/views/new_administrateur/procedures/edit.html.haml_spec.rb rename to spec/views/administrateurs/procedures/edit.html.haml_spec.rb index 8611a0094..c43c6244c 100644 --- a/spec/views/new_administrateur/procedures/edit.html.haml_spec.rb +++ b/spec/views/administrateurs/procedures/edit.html.haml_spec.rb @@ -1,4 +1,4 @@ -describe 'new_administrateur/procedures/edit.html.haml' do +describe 'administrateurs/procedures/edit.html.haml' do let(:logo) { fixture_file_upload('spec/fixtures/files/logo_test_procedure.png', 'image/png') } let(:procedure) { create(:procedure, logo: logo, lien_site_web: 'http://some.website') } diff --git a/spec/views/new_administrateur/procedures/show.html.haml_spec.rb b/spec/views/administrateurs/procedures/show.html.haml_spec.rb similarity index 95% rename from spec/views/new_administrateur/procedures/show.html.haml_spec.rb rename to spec/views/administrateurs/procedures/show.html.haml_spec.rb index 606aa9b99..d2d33cb0d 100644 --- a/spec/views/new_administrateur/procedures/show.html.haml_spec.rb +++ b/spec/views/administrateurs/procedures/show.html.haml_spec.rb @@ -1,4 +1,4 @@ -describe 'new_administrateur/procedures/show.html.haml', type: :view do +describe 'administrateurs/procedures/show.html.haml', type: :view do let(:closed_at) { nil } let(:procedure) { create(:procedure, :with_service, closed_at: closed_at) }