fix(filters): filter by dossier should only accept number

This commit is contained in:
mfo 2024-09-17 11:39:18 +02:00
parent b4ed11c788
commit ebb51e8128
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -12,7 +12,7 @@ describe ColumnsConcern do
let(:tdc_private_2) { procedure.active_revision.types_de_champ_private[1] }
let(:expected) {
[
{ label: 'Nº dossier', table: 'self', column: 'id', classname: 'number-col', displayable: true, type: :text, scope: '', value_column: :value, filterable: true },
{ label: 'Nº dossier', table: 'self', column: 'id', classname: 'number-col', displayable: true, type: :number, scope: '', value_column: :value, filterable: true },
{ label: 'notifications', table: 'notifications', column: 'notifications', displayable: true, type: :text, scope: '', value_column: :value, filterable: false },
{ label: 'Créé le', table: 'self', column: 'created_at', classname: '', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },
{ label: 'Mis à jour le', table: 'self', column: 'updated_at', classname: '', displayable: true, type: :date, scope: '', value_column: :value, filterable: true },