From e9991573e722753912d301c83d476d4e9d211f58 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 30 Oct 2024 14:29:13 +0100 Subject: [PATCH] chore: columns on some champs at this point do not make sense --- app/models/types_de_champ/carte_type_de_champ.rb | 4 ++++ .../types_de_champ/piece_justificative_type_de_champ.rb | 4 ++++ spec/models/column_spec.rb | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/models/types_de_champ/carte_type_de_champ.rb b/app/models/types_de_champ/carte_type_de_champ.rb index 9a16c6392..01cbd2a20 100644 --- a/app/models/types_de_champ/carte_type_de_champ.rb +++ b/app/models/types_de_champ/carte_type_de_champ.rb @@ -27,4 +27,8 @@ class TypesDeChamp::CarteTypeDeChamp < TypesDeChamp::TypeDeChampBase def champ_value_for_export(champ, path = :value) champ.geo_areas.map(&:label).join("\n") end + + def columns(procedure_id:, displayable: true, prefix: nil) + [] + end end diff --git a/app/models/types_de_champ/piece_justificative_type_de_champ.rb b/app/models/types_de_champ/piece_justificative_type_de_champ.rb index 6f00eec3a..2c68ef035 100644 --- a/app/models/types_de_champ/piece_justificative_type_de_champ.rb +++ b/app/models/types_de_champ/piece_justificative_type_de_champ.rb @@ -22,4 +22,8 @@ class TypesDeChamp::PieceJustificativeTypeDeChamp < TypesDeChamp::TypeDeChampBas attachment.url end end + + def columns(procedure_id:, displayable: true, prefix: nil) + [] + end end diff --git a/spec/models/column_spec.rb b/spec/models/column_spec.rb index 2d7652822..c1f1442dd 100644 --- a/spec/models/column_spec.rb +++ b/spec/models/column_spec.rb @@ -66,7 +66,8 @@ describe Column do expect_type_de_champ_values('linked_drop_down_list', [nil, "categorie 1", "choix 1"]) expect_type_de_champ_values('yes_no', [true]) expect_type_de_champ_values('annuaire_education', [nil]) - expect_type_de_champ_values('carte', [nil]) + expect_type_de_champ_values('carte', []) + expect_type_de_champ_values('piece_justificative', []) expect_type_de_champ_values('cnaf', [nil]) expect_type_de_champ_values('dgfip', [nil]) expect_type_de_champ_values('pole_emploi', [nil])