extract dossier_state_column

This commit is contained in:
simon lehericey 2024-10-09 15:16:13 +02:00
parent 242ab78235
commit 30fcb75da4
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 8 additions and 4 deletions

View file

@ -33,9 +33,9 @@ class Column
}
end
def notifications?
table == 'notifications' && column == 'notifications'
end
def notifications? = [table, column] == ['notifications', 'notifications']
def dossier_state? = [table, column] == ['self', 'state']
def self.find(h_id)
begin

View file

@ -33,6 +33,10 @@ module ColumnsConcern
Column.new(procedure_id: id, table: 'self', column: 'id', classname: 'number-col', type: :number)
end
def dossier_state_column
Column.new(procedure_id: id, table: 'self', column: 'state', type: :enum, scope: 'instructeurs.dossiers.filterable_state', displayable: false)
end
def notifications_column
Column.new(procedure_id: id, table: 'notifications', column: 'notifications', label: "notifications", filterable: false)
end
@ -46,7 +50,7 @@ module ColumnsConcern
non_displayable_dates = ['updated_since', 'depose_since', 'en_construction_since', 'en_instruction_since', 'processed_since']
.map { |column| Column.new(procedure_id: id, table: 'self', column:, type: :date, displayable: false) }
states = [Column.new(procedure_id: id, table: 'self', column: 'state', type: :enum, scope: 'instructeurs.dossiers.filterable_state', displayable: false)]
states = [dossier_state_column]
[common, dates, sva_svr_columns(for_filters: true), non_displayable_dates, states].flatten.compact
end