demarches-normaliennes/app/components/editable_champ/carte_component.rb

34 lines
993 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class EditableChamp::CarteComponent < EditableChamp::EditableChampBaseComponent
2022-08-12 10:45:04 +02:00
include ApplicationHelper
def dsfr_champ_container
:fieldset
end
2024-05-06 18:10:30 +02:00
def react_props
{
feature_collection: @champ.to_feature_collection,
champ_id: @champ.input_id,
url: update_path,
adresse_source: data_sources_data_source_adresse_path,
2024-10-23 11:11:37 +02:00
options: @champ.render_options,
translations: {
address_input_label: t(".address_input_label"),
address_input_description: t(".address_input_description"),
pin_input_label: t(".pin_input_label"),
pin_input_description: t(".pin_input_description"),
show_pin: t(".show_pin"),
add_pin: t(".add_pin"),
add_file: t(".add_file"),
choose_file: t(".choose_file"),
delete_file: t(".delete_file")
}
2024-05-06 18:10:30 +02:00
}
end
def update_path
champs_carte_features_path(@champ.dossier, @champ.stable_id, row_id: @champ.row_id)
end
2022-08-12 10:45:04 +02:00
end