extract dossier_id_column, notifications_column

This commit is contained in:
simon lehericey 2024-09-30 20:48:54 +02:00
parent c6559577f1
commit 3c7521a428
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 10 additions and 2 deletions

View file

@ -1,4 +1,4 @@
= form_tag update_sort_instructeur_procedure_path(procedure_id: @procedure.id, column_id: 'notifications/notifications', order: opposite_order), method: :get, data: { controller: 'autosubmit' } do
= form_tag update_sort_instructeur_procedure_path(procedure_id: @procedure.id, column_id: @procedure.notifications_column.id, order: opposite_order), method: :get, data: { controller: 'autosubmit' } do
.fr-fieldset__element.fr-m-0
.fr-checkbox-group.fr-checkbox-group--sm
= check_box_tag :order, opposite_order, active?

View file

@ -14,8 +14,16 @@ module ColumnsConcern
columns.concat(types_de_champ_columns)
end
def dossier_id_column
Column.new(table: 'self', column: 'id', classname: 'number-col', type: :number)
end
def notifications_column
Column.new(table: 'notifications', column: 'notifications', label: "notifications", filterable: false)
end
def dossier_columns
common = [Column.new(table: 'self', column: 'id', classname: 'number-col', type: :number), Column.new(table: 'notifications', column: 'notifications', label: "notifications", filterable: false)]
common = [dossier_id_column, notifications_column]
dates = ['created_at', 'updated_at', 'depose_at', 'en_construction_at', 'en_instruction_at', 'processed_at']
.map { |column| Column.new(table: 'self', column:, type: :date) }