diff --git a/app/components/procedure/card/annotations_component.rb b/app/components/procedure/card/annotations_component.rb index 82936f6b2..470e5f4a8 100644 --- a/app/components/procedure/card/annotations_component.rb +++ b/app/components/procedure/card/annotations_component.rb @@ -6,10 +6,6 @@ class Procedure::Card::AnnotationsComponent < ApplicationComponent private - def render? - !@procedure.locked? || @procedure.feature_enabled?(:procedure_revisions) - end - def error_messages @procedure.errors.messages_for(:draft_types_de_champ_private).to_sentence end diff --git a/app/components/procedure/card/champs_component.rb b/app/components/procedure/card/champs_component.rb index 595d19464..d45b2f666 100644 --- a/app/components/procedure/card/champs_component.rb +++ b/app/components/procedure/card/champs_component.rb @@ -6,10 +6,6 @@ class Procedure::Card::ChampsComponent < ApplicationComponent private - def render? - !@procedure.locked? || @procedure.feature_enabled?(:procedure_revisions) - end - def error_messages [ @procedure.errors.messages_for(:draft_types_de_champ_public), diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index fa1c4d408..9cc29b377 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -15,13 +15,6 @@ class AdminController < ApplicationController redirect_to admin_procedures_path, status: 404 end - def procedure_locked? - if @procedure.locked? - flash.alert = 'Démarche verrouillée' - redirect_to admin_procedure_path(id: @procedure.id) - end - end - def reset_procedure if @procedure.brouillon? @procedure.reset! diff --git a/app/controllers/administrateurs/administrateur_controller.rb b/app/controllers/administrateurs/administrateur_controller.rb index 5d97768d4..1c187123c 100644 --- a/app/controllers/administrateurs/administrateur_controller.rb +++ b/app/controllers/administrateurs/administrateur_controller.rb @@ -12,20 +12,6 @@ module Administrateurs redirect_to admin_procedures_path, status: 404 end - def procedure_locked? - if @procedure.locked? - flash.alert = 'Démarche verrouillée' - redirect_to admin_procedure_path(@procedure) - end - end - - def procedure_revisable? - if @procedure.locked? && !@procedure.feature_enabled?(:procedure_revisions) - flash.alert = 'Démarche verrouillée' - redirect_to admin_procedure_path(@procedure) - end - end - def reset_procedure if @procedure.brouillon? || @procedure.draft_changed? @procedure.reset! diff --git a/app/controllers/administrateurs/procedures_controller.rb b/app/controllers/administrateurs/procedures_controller.rb index 4e4612fc9..a23dec9df 100644 --- a/app/controllers/administrateurs/procedures_controller.rb +++ b/app/controllers/administrateurs/procedures_controller.rb @@ -3,7 +3,6 @@ module Administrateurs layout 'all', only: [:all, :administrateurs] before_action :retrieve_procedure, only: [:champs, :annotations, :modifications, :edit, :zones, :monavis, :update_monavis, :jeton, :update_jeton, :publication, :publish, :transfert, :close, :allow_expert_review, :experts_require_administrateur_invitation, :reset_draft] - before_action :procedure_revisable?, only: [:champs, :annotations, :modifications, :reset_draft] before_action :draft_valid?, only: [:apercu] ITEMS_PER_PAGE = 25 diff --git a/app/controllers/administrateurs/types_de_champ_controller.rb b/app/controllers/administrateurs/types_de_champ_controller.rb index e32756bbe..e48d7b83c 100644 --- a/app/controllers/administrateurs/types_de_champ_controller.rb +++ b/app/controllers/administrateurs/types_de_champ_controller.rb @@ -1,6 +1,6 @@ module Administrateurs class TypesDeChampController < AdministrateurController - before_action :retrieve_procedure, :procedure_revisable? + before_action :retrieve_procedure def create type_de_champ = draft.add_type_de_champ(type_de_champ_create_params) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index cde2c03b6..7c51631f1 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -681,7 +681,7 @@ class Procedure < ApplicationRecord end def revised? - feature_enabled?(:procedure_revisions) && revisions.size > 2 + revisions.size > 2 end def revisions_count