inject dossier_labels at dossier_labels_column build time

This commit is contained in:
simon lehericey 2024-11-06 13:50:32 +01:00
parent f5227f9609
commit 2b6cc49541
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 1 additions and 5 deletions

View file

@ -54,10 +54,6 @@ class Instructeurs::ColumnFilterValueComponent < ApplicationComponent
[_1.label, _1.id]
end
end
elsif column.table == 'dossier_labels'
Procedure.find(procedure_id).labels.filter_map do
[_1.name, _1.id]
end
else
column.options_for_select
end

View file

@ -91,7 +91,7 @@ module ColumnsConcern
def user_france_connected_column = Columns::DossierColumn.new(procedure_id: id, table: 'self', column: 'user_from_france_connect?', filterable: false, displayable: false)
def dossier_labels_column = Columns::DossierColumn.new(procedure_id: id, table: 'dossier_labels', column: 'label_id', type: :enum)
def dossier_labels_column = Columns::DossierColumn.new(procedure_id: id, table: 'dossier_labels', column: 'label_id', type: :enum, options_for_select: labels.map { [_1.name, _1.id] })
def procedure_chorus_columns
['domaine_fonctionnel', 'referentiel_prog', 'centre_de_cout']