extract dossier_state_column
This commit is contained in:
parent
242ab78235
commit
30fcb75da4
2 changed files with 8 additions and 4 deletions
|
@ -33,9 +33,9 @@ class Column
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def notifications?
|
def notifications? = [table, column] == ['notifications', 'notifications']
|
||||||
table == 'notifications' && column == 'notifications'
|
|
||||||
end
|
def dossier_state? = [table, column] == ['self', 'state']
|
||||||
|
|
||||||
def self.find(h_id)
|
def self.find(h_id)
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -33,6 +33,10 @@ module ColumnsConcern
|
||||||
Column.new(procedure_id: id, table: 'self', column: 'id', classname: 'number-col', type: :number)
|
Column.new(procedure_id: id, table: 'self', column: 'id', classname: 'number-col', type: :number)
|
||||||
end
|
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
|
def notifications_column
|
||||||
Column.new(procedure_id: id, table: 'notifications', column: 'notifications', label: "notifications", filterable: false)
|
Column.new(procedure_id: id, table: 'notifications', column: 'notifications', label: "notifications", filterable: false)
|
||||||
end
|
end
|
||||||
|
@ -46,7 +50,7 @@ module ColumnsConcern
|
||||||
non_displayable_dates = ['updated_since', 'depose_since', 'en_construction_since', 'en_instruction_since', 'processed_since']
|
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) }
|
.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
|
[common, dates, sva_svr_columns(for_filters: true), non_displayable_dates, states].flatten.compact
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue