add rnf and rna address in form view
This commit is contained in:
parent
c148f5a389
commit
9e3f28e87b
9 changed files with 19 additions and 7 deletions
|
@ -2,4 +2,4 @@
|
|||
en:
|
||||
rnf_info_error: No foundation found
|
||||
rnf_info_pending: RNF verification pending
|
||||
rnf_info_success: "This RNF matches %{title}"
|
||||
rnf_info_success: "This RNF matches %{title}, %{address}"
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
fr:
|
||||
rnf_info_error: Aucune fondation trouvée
|
||||
rnf_info_pending: Vérification du RNF en cours
|
||||
rnf_info_success: "Ce RNF correspond à %{title}"
|
||||
rnf_info_success: "Ce RNF correspond à %{title}, %{address}"
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
- elsif @champ.fetch_external_data_pending?
|
||||
%p.fr-info-text= t('.rnf_info_pending')
|
||||
- elsif @champ.data?
|
||||
%p.fr-info-text= t('.rnf_info_success', title: @champ.title)
|
||||
%p.fr-info-text= t('.rnf_info_success', title: @champ.title, address: @champ.full_address)
|
||||
|
|
|
@ -23,7 +23,8 @@ class APIEntreprise::RNAAdapter < APIEntreprise::Adapter
|
|||
"association_date_creation" => data[:date_creation],
|
||||
# see: https://mattermost.incubateur.net/betagouv/pl/r6txumw9cpyx58rt7iq5dte9qe
|
||||
"association_date_declaration" => meta[:date_derniere_mise_a_jour_rna],
|
||||
"association_date_publication" => data[:date_publication_journal_officiel]
|
||||
"association_date_publication" => data[:date_publication_journal_officiel],
|
||||
"address" => data[:adresse_siege]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,6 +11,11 @@ class Champs::RNAChamp < Champ
|
|||
data&.dig("association_titre")
|
||||
end
|
||||
|
||||
def full_address
|
||||
address = data&.dig("address")
|
||||
"#{address["numero_voie"]} #{address["type_voie"]} #{address["libelle_voie"]} #{address["code_postal"]} #{address["commune"]}"
|
||||
end
|
||||
|
||||
def identifier
|
||||
title.present? ? "#{value} (#{title})" : value
|
||||
end
|
||||
|
|
|
@ -109,4 +109,10 @@ class Champs::RNFChamp < Champ
|
|||
}
|
||||
end
|
||||
end
|
||||
|
||||
def full_address
|
||||
if address.present?
|
||||
address['label']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,4 +8,4 @@
|
|||
%p.fr-error-text= t('.network_error')
|
||||
- else
|
||||
- if champ.value.present?
|
||||
%p.fr-info-text= t('.data_fetched', title: champ.title)
|
||||
%p.fr-info-text= t('.data_fetched', title: champ.title, address: champ.full_address)
|
||||
|
|
|
@ -28,7 +28,7 @@ en:
|
|||
not_filled: not filled
|
||||
not_found: "RNA number %{rna} (no association found)"
|
||||
association:
|
||||
data_fetched: "This RNA number is linked to %{title}"
|
||||
data_fetched: "This RNA number is linked to %{title}, %{address}"
|
||||
not_found: "No association found"
|
||||
network_error: "A network error has prevented the association associated with this RNA to be fetched"
|
||||
rnf:
|
||||
|
|
|
@ -30,7 +30,7 @@ fr:
|
|||
not_filled: non renseigné
|
||||
not_found: "RNA %{rna} (aucun établissement trouvé)"
|
||||
association:
|
||||
data_fetched: "Ce RNA correspond à %{title}"
|
||||
data_fetched: "Ce RNA correspond à %{title}, %{address}"
|
||||
not_found: "Aucun établissement trouvé"
|
||||
network_error: "Une erreur réseau a empêché l’association liée à ce RNA d’être trouvée"
|
||||
rnf:
|
||||
|
|
Loading…
Reference in a new issue