Merge pull request #2954 from tchak/enable-champ-carto-for-all

Enable champ carte for all
This commit is contained in:
Paul Chavard 2018-11-06 15:32:57 +01:00 committed by GitHub
commit 82351d608f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 7 deletions

View file

@ -9,9 +9,9 @@ module ChampHelper
raw({ raw({
position: champ.position, position: champ.position,
selection: champ.value.present? ? JSON.parse(champ.value) : [], selection: champ.value.present? ? JSON.parse(champ.value) : [],
quartiersPrioritaires: champ.quartiers_prioritaires? ? champ.quartiers_prioritaires : [], quartiersPrioritaires: champ.quartiers_prioritaires? ? champ.quartiers_prioritaires.as_json(except: :properties) : [],
cadastres: champ.cadastres? ? champ.cadastres : [], cadastres: champ.cadastres? ? champ.cadastres.as_json(except: :properties) : [],
parcellesAgricoles: champ.parcelles_agricoles? ? champ.parcelles_agricoles : [] parcellesAgricoles: champ.parcelles_agricoles? ? champ.parcelles_agricoles.as_json(except: :properties) : []
}.to_json) }.to_json)
# rubocop:enable Rails/OutputSafety # rubocop:enable Rails/OutputSafety
end end

View file

@ -3,7 +3,6 @@ module TypeDeChampHelper
TypeDeChamp.type_champs.fetch(:piece_justificative) => :champ_pj?, TypeDeChamp.type_champs.fetch(:piece_justificative) => :champ_pj?,
TypeDeChamp.type_champs.fetch(:siret) => :champ_siret?, TypeDeChamp.type_champs.fetch(:siret) => :champ_siret?,
TypeDeChamp.type_champs.fetch(:linked_drop_down_list) => :champ_linked_dropdown?, TypeDeChamp.type_champs.fetch(:linked_drop_down_list) => :champ_linked_dropdown?,
TypeDeChamp.type_champs.fetch(:carte) => :champ_carte?,
TypeDeChamp.type_champs.fetch(:integer_number) => :champ_integer_number? TypeDeChamp.type_champs.fetch(:integer_number) => :champ_integer_number?
} }

View file

@ -13,8 +13,6 @@ Flipflop.configure do
title: "Champ SIRET" title: "Champ SIRET"
feature :champ_linked_dropdown, feature :champ_linked_dropdown,
title: "Champ double menu déroulant" title: "Champ double menu déroulant"
feature :champ_carte,
title: "Champ Carte"
feature :champ_integer_number, feature :champ_integer_number,
title: "Champ nombre entier" title: "Champ nombre entier"
end end

View file

@ -43,7 +43,6 @@ describe Champs::CarteController, type: :controller do
let(:selection) { [[{ "lat": 48.87442541960633, "lng": 2.3859214782714844 }, { "lat": 48.87273183590832, "lng": 2.3850631713867183 }, { "lat": 48.87081237174292, "lng": 2.3809432983398438 }, { "lat": 48.8712640169951, "lng": 2.377510070800781 }, { "lat": 48.87510283703279, "lng": 2.3778533935546875 }, { "lat": 48.87544154230615, "lng": 2.382831573486328 }, { "lat": 48.87442541960633, "lng": 2.3859214782714844 }]] } let(:selection) { [[{ "lat": 48.87442541960633, "lng": 2.3859214782714844 }, { "lat": 48.87273183590832, "lng": 2.3850631713867183 }, { "lat": 48.87081237174292, "lng": 2.3809432983398438 }, { "lat": 48.8712640169951, "lng": 2.377510070800781 }, { "lat": 48.87510283703279, "lng": 2.3778533935546875 }, { "lat": 48.87544154230615, "lng": 2.382831573486328 }, { "lat": 48.87442541960633, "lng": 2.3859214782714844 }]] }
it { expect(response.body).not_to be_nil } it { expect(response.body).not_to be_nil }
it { expect(response.body).to include('QPCODE1234') }
it { expect(response.body).to include('MultiPolygon') } it { expect(response.body).to include('MultiPolygon') }
it { expect(response.body).to include('[2.38715792094576,48.8723062632126]') } it { expect(response.body).to include('[2.38715792094576,48.8723062632126]') }
end end