2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-09-08 11:25:39 +02:00
|
|
|
class EditableChamp::CarteComponent < EditableChamp::EditableChampBaseComponent
|
2022-08-12 10:45:04 +02:00
|
|
|
include ApplicationHelper
|
2024-04-09 16:18:44 +02:00
|
|
|
def dsfr_champ_container
|
|
|
|
:fieldset
|
|
|
|
end
|
2023-02-27 11:59:38 +01:00
|
|
|
|
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
|
|
|
}
|
2023-02-27 11:59:38 +01:00
|
|
|
end
|
2024-04-22 10:47:47 +02:00
|
|
|
|
|
|
|
def update_path
|
2024-03-28 12:42:29 +01:00
|
|
|
champs_carte_features_path(@champ.dossier, @champ.stable_id, row_id: @champ.row_id)
|
2024-04-22 10:47:47 +02:00
|
|
|
end
|
2022-08-12 10:45:04 +02:00
|
|
|
end
|