inject dossier_state at build time
This commit is contained in:
parent
2b6cc49541
commit
e2bc45dc4a
2 changed files with 6 additions and 4 deletions
|
@ -46,9 +46,7 @@ class Instructeurs::ColumnFilterValueComponent < ApplicationComponent
|
||||||
end
|
end
|
||||||
|
|
||||||
def options_for_select_of_column
|
def options_for_select_of_column
|
||||||
if column.scope.present?
|
if column.groupe_instructeur?
|
||||||
I18n.t(column.scope).map(&:to_a).map(&:reverse)
|
|
||||||
elsif column.groupe_instructeur?
|
|
||||||
current_instructeur.groupe_instructeurs.filter_map do
|
current_instructeur.groupe_instructeurs.filter_map do
|
||||||
if _1.procedure_id == procedure_id
|
if _1.procedure_id == procedure_id
|
||||||
[_1.label, _1.id]
|
[_1.label, _1.id]
|
||||||
|
|
|
@ -53,7 +53,11 @@ module ColumnsConcern
|
||||||
|
|
||||||
def dossier_id_column = Columns::DossierColumn.new(procedure_id: id, table: 'self', column: 'id', type: :number)
|
def dossier_id_column = Columns::DossierColumn.new(procedure_id: id, table: 'self', column: 'id', type: :number)
|
||||||
|
|
||||||
def dossier_state_column = Columns::DossierColumn.new(procedure_id: id, table: 'self', column: 'state', type: :enum, scope: 'instructeurs.dossiers.filterable_state', displayable: false)
|
def dossier_state_column
|
||||||
|
options_for_select = I18n.t('instructeurs.dossiers.filterable_state').map(&:to_a).map(&:reverse)
|
||||||
|
|
||||||
|
Columns::DossierColumn.new(procedure_id: id, table: 'self', column: 'state', type: :enum, options_for_select:, displayable: false)
|
||||||
|
end
|
||||||
|
|
||||||
def notifications_column = Columns::DossierColumn.new(procedure_id: id, table: 'notifications', column: 'notifications', label: "notifications", filterable: false)
|
def notifications_column = Columns::DossierColumn.new(procedure_id: id, table: 'notifications', column: 'notifications', label: "notifications", filterable: false)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue