chore(sva): always enable card but form submit needs feature flag

This commit is contained in:
Colin Darie 2024-04-18 16:03:31 +02:00
parent 4041bfa160
commit 63aecdd85a
6 changed files with 16 additions and 6 deletions

View file

@ -1,4 +1,6 @@
---
en:
ready: "Configuré"
needs_configuration: "À configurer"
title: "Silence Vaut Accord ou Rejet"
subtitle: "Accept or Refuse a file after a deadline"
ready: "Configured"
disabled: "Disabled"

View file

@ -3,4 +3,4 @@ fr:
title: "Silence Vaut Accord ou Rejet"
subtitle: "Accepter ou Refuser un dossier après un délai"
ready: "Configuré"
needs_configuration: "À configurer"
disabled: "Désactivé"

View file

@ -4,7 +4,7 @@
- if @procedure.sva_svr_enabled?
%p.fr-badge.fr-badge--success= t('.ready')
- else
%p.fr-badge.fr-badge--info= t('.needs_configuration')
%p.fr-badge= t('.disabled')
%h3.fr-h6.fr-mt-10v= t('.title')
%p.fr-tile-subtitle= t('.subtitle')
%p.fr-btn.fr-btn--tertiary= t('views.shared.actions.edit')

View file

@ -10,6 +10,7 @@ class Procedure::SVASVRFormComponent < ApplicationComponent
def form_disabled?
return false if procedure.brouillon?
return true if !procedure.feature_enabled?(:sva)
procedure.sva_svr_enabled?
end

View file

@ -1,5 +1,12 @@
= form_for [procedure, configuration], url: admin_procedure_sva_svr_path(procedure), method: :put do |f|
- if procedure.publiee? && !procedure.sva_svr_enabled?
- if !procedure.feature_enabled?(:sva)
.fr-alert.fr-alert--info.fr-alert--sm.fr-my-8w
%p
Pour activer le paramétrage de cette fonctionnalité, contactez-nous sur
= link_to CONTACT_EMAIL, "mailto:#{CONTACT_EMAIL}", **helpers.external_link_attributes
en indiquant votre numéro de démarche (#{@procedure.id}) et le cadre dapplication du SVA/SVR.
- elsif procedure.publiee? && !procedure.sva_svr_enabled?
.fr-alert.fr-alert--info.fr-alert--sm.fr-mb-4w
%p= t('.notice_new_files_only')

View file

@ -85,7 +85,7 @@
= render Procedure::Card::AnnotationsComponent.new(procedure: @procedure)
= render Procedure::Card::APIEntrepriseComponent.new(procedure: @procedure)
= render Procedure::Card::APIParticulierComponent.new(procedure: @procedure)
= render Procedure::Card::SVASVRComponent.new(procedure: @procedure) if @procedure.sva_svr_enabled? || @procedure.feature_enabled?(:sva)
= render Procedure::Card::SVASVRComponent.new(procedure: @procedure)
= render Procedure::Card::MonAvisComponent.new(procedure: @procedure)
= render Procedure::Card::DossierSubmittedMessageComponent.new(procedure: @procedure)
= render Procedure::Card::ChorusComponent.new(procedure: @procedure)