From 0ed166f51008d2b03989238fb406b5a1a3eccedb Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Wed, 29 May 2024 14:30:20 +0200 Subject: [PATCH] export_template feature flag scoped by procedure --- .../export_dropdown_component.html.haml | 16 ++++++++-------- .../instructeurs/procedures/exports.html.haml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/components/dossiers/export_dropdown_component/export_dropdown_component.html.haml b/app/components/dossiers/export_dropdown_component/export_dropdown_component.html.haml index fbb499483..fd29214f2 100644 --- a/app/components/dossiers/export_dropdown_component/export_dropdown_component.html.haml +++ b/app/components/dossiers/export_dropdown_component/export_dropdown_component.html.haml @@ -15,12 +15,12 @@ = link_to download_export_path(export_format: format), role: 'menuitem', data: { turbo_method: :post, turbo: true } do = t(".everything_#{format}_html") - - if export_templates.present? - - export_templates.each do |export_template| + - if @procedure.feature_enabled?(:export_template) + - if export_templates.present? + - export_templates.each do |export_template| + - menu.with_item do + = link_to download_export_path(export_template_id: export_template.id), role: 'menuitem', data: { turbo_method: :post, turbo: true } do + = "Exporter à partir du modèle #{export_template.name}" - menu.with_item do - = link_to download_export_path(export_template_id: export_template.id), role: 'menuitem', data: { turbo_method: :post, turbo: true } do - = "Exporter à partir du modèle #{export_template.name}" - - if feature_enabled?(:export_template) - - menu.with_item do - = link_to new_instructeur_export_template_path(procedure_id: params[:procedure_id]), role: 'menuitem' do - Ajouter un modèle d'export + = link_to new_instructeur_export_template_path(procedure_id: params[:procedure_id]), role: 'menuitem' do + Ajouter un modèle d'export diff --git a/app/views/instructeurs/procedures/exports.html.haml b/app/views/instructeurs/procedures/exports.html.haml index 0986a977a..793a7d960 100644 --- a/app/views/instructeurs/procedures/exports.html.haml +++ b/app/views/instructeurs/procedures/exports.html.haml @@ -23,7 +23,7 @@ - else = t('.no_export_html', expiration_time: Export::MAX_DUREE_CONSERVATION_EXPORT.in_hours.to_i ) - - if feature_enabled?(:export_template) + - if @procedure.feature_enabled?(:export_template) %h2.fr-mb-1w.fr-mt-8w Liste des modèles d'export %p.fr-hint-text