review(10591#discussion_r1818752344): homogenize interface for columns builders
This commit is contained in:
parent
8afe4374c7
commit
d9fc48ad70
1 changed files with 7 additions and 14 deletions
|
@ -31,24 +31,17 @@ module ColumnsConcern
|
||||||
end
|
end
|
||||||
|
|
||||||
def chorus_columns
|
def chorus_columns
|
||||||
if chorusable? && chorus_configuration.complete?
|
['domaine_fonctionnel', 'referentiel_prog', 'centre_de_cout']
|
||||||
['domaine_fonctionnel', 'referentiel_prog', 'centre_de_cout']
|
.map { |column| Column.new(procedure_id: id, table: 'procedure', column:, displayable: false, filterable: false) }
|
||||||
.map { |column| Column.new(procedure_id: id, table: 'procedure', column:, displayable: false, filterable: false) }
|
|
||||||
else
|
|
||||||
[]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def all_usager_columns_for_export
|
def all_usager_columns_for_export
|
||||||
common = [
|
columns = [dossier_id_column, email_for_display_column, france_connected_column]
|
||||||
dossier_id_column,
|
columns.concat(individual_columns) if for_individual
|
||||||
email_for_display_column,
|
columns.concat(moral_columns) if !for_individual
|
||||||
france_connected_column
|
columns.concat(chorus_columns) if chorusable? && chorus_configuration.complete?
|
||||||
]
|
|
||||||
|
|
||||||
individual_or_moral_columns = for_individual? ? individual_columns : moral_columns
|
columns.flatten.compact
|
||||||
|
|
||||||
[common, individual_or_moral_columns, chorus_columns].flatten.compact
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def all_dossier_columns_for_export
|
def all_dossier_columns_for_export
|
||||||
|
|
Loading…
Reference in a new issue