feat(routing): put routing logic behind a feature flag
This commit is contained in:
parent
6dfe54479d
commit
6f6bbd6ca1
6 changed files with 10 additions and 6 deletions
|
@ -455,7 +455,9 @@ module Users
|
|||
@dossier.assign_to_groupe_instructeur(groupe_instructeur_from_params)
|
||||
end
|
||||
|
||||
RoutingEngine.compute(@dossier)
|
||||
if @dossier.procedure.feature_enabled?(:routing_rules)
|
||||
RoutingEngine.compute(@dossier)
|
||||
end
|
||||
|
||||
if dossier.en_construction?
|
||||
errors += @dossier.check_mandatory_and_visible_champs
|
||||
|
|
|
@ -667,11 +667,11 @@ class Dossier < ApplicationRecord
|
|||
end
|
||||
|
||||
def show_groupe_instructeur_details?
|
||||
procedure.routing_enabled? && groupe_instructeur.present? && (!procedure.feature_enabled?(:procedure_routage_api) || !defaut_groupe_instructeur?)
|
||||
procedure.routing_enabled? && groupe_instructeur.present? && (!procedure.feature_enabled?(:procedure_routage_api) || !defaut_groupe_instructeur?) && !procedure.feature_enabled?(:routing_rules)
|
||||
end
|
||||
|
||||
def show_groupe_instructeur_selector?
|
||||
procedure.routing_enabled? && !procedure.feature_enabled?(:procedure_routage_api)
|
||||
procedure.routing_enabled? && !procedure.feature_enabled?(:procedure_routage_api) && !procedure.feature_enabled?(:routing_rules)
|
||||
end
|
||||
|
||||
def assign_to_groupe_instructeur(groupe_instructeur, author = nil)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
- if groupes_instructeurs.many?
|
||||
- if groupes_instructeurs.many? && !procedure.feature_enabled?(:routing_rules)
|
||||
.card
|
||||
= form_for procedure,
|
||||
url: { action: :update_routing_criteria_name },
|
||||
|
|
|
@ -26,6 +26,6 @@
|
|||
|
||||
= render partial: 'administrateurs/groupe_instructeurs/edit', locals: { procedure: @procedure, groupes_instructeurs: @groupes_instructeurs }
|
||||
|
||||
- if @procedure.routing_enabled?
|
||||
- if @procedure.routing_enabled? && @procedure.feature_enabled?(:routing_rules)
|
||||
= render(Procedure::RoutingRulesComponent.new(revision: @procedure.active_revision,
|
||||
groupe_instructeurs: @procedure.groupe_instructeurs))
|
||||
|
|
|
@ -16,7 +16,8 @@ features = [
|
|||
:api_particulier,
|
||||
:dossier_pdf_vide,
|
||||
:hide_instructeur_email,
|
||||
:procedure_routage_api
|
||||
:procedure_routage_api,
|
||||
:routing_rules
|
||||
]
|
||||
|
||||
def database_exists?
|
||||
|
|
|
@ -19,6 +19,7 @@ describe 'As an administrateur I can manage procedure routing', js: true do
|
|||
let(:drop_down_tdc) { procedure.draft_revision.types_de_champ.first }
|
||||
|
||||
before do
|
||||
Flipper.enable(:routing_rules, procedure)
|
||||
procedure.publish_revision!
|
||||
login_as administrateur.user, scope: :user
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue