add message when path is already taken when publishing a procedure

This commit is contained in:
Lisa Durand 2024-03-14 17:17:47 +01:00
parent 5f826cfd88
commit e757eefd37
12 changed files with 70 additions and 15 deletions

View file

@ -3,7 +3,7 @@ module Administrateurs
layout 'all', only: [:all, :administrateurs]
respond_to :html, :xlsx
before_action :retrieve_procedure, only: [:champs, :annotations, :modifications, :edit, :zones, :monavis, :update_monavis, :jeton, :update_jeton, :publication, :publish, :transfert, :close, :confirmation, :allow_expert_review, :allow_expert_messaging, :experts_require_administrateur_invitation, :reset_draft, :publish_revision]
before_action :retrieve_procedure, only: [:champs, :annotations, :modifications, :edit, :zones, :monavis, :update_monavis, :jeton, :update_jeton, :publication, :publish, :transfert, :close, :confirmation, :allow_expert_review, :allow_expert_messaging, :experts_require_administrateur_invitation, :reset_draft, :publish_revision, :check_path]
before_action :draft_valid?, only: [:apercu]
after_action :reset_procedure, only: [:update]
@ -283,6 +283,17 @@ module Administrateurs
end
end
def check_path
@path_available = @procedure.path_available?(params[:path])
@other_procedure = @procedure.other_procedure_with_path(params[:path])
@administrateur = current_administrateur
respond_to do |format|
format.turbo_stream do
render :check_path
end
end
end
def publish
@procedure.assign_attributes(publish_params)