feat(titulaire): afficher le libellé d'activité NAF en sous-titre gris

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-06-23 22:32:12 +02:00
parent d99bb00d6c
commit f9aefb55d8
+24 -7
View File
@@ -87,13 +87,19 @@ layout = [
className="mb-2", className="mb-2",
children=[ children=[
dbc.Col( dbc.Col(
html.H2( [
children=[ html.H2(
html.Span(id="titulaire_siret"), children=[
" - ", html.Span(id="titulaire_siret"),
html.Span(id="titulaire_nom"), " - ",
], html.Span(id="titulaire_nom"),
), ],
),
html.P(
id="titulaire_activite_libelle",
style={"color": "gray", "marginTop": "-10px"},
),
],
width=8, width=8,
), ),
dbc.Col( dbc.Col(
@@ -255,10 +261,20 @@ layout = [
Output(component_id="titulaire_departement", component_property="children"), Output(component_id="titulaire_departement", component_property="children"),
Output(component_id="titulaire_region", component_property="children"), Output(component_id="titulaire_region", component_property="children"),
Output(component_id="titulaire_lien_annuaire", component_property="href"), Output(component_id="titulaire_lien_annuaire", component_property="href"),
Output(component_id="titulaire_activite_libelle", component_property="children"),
Input(component_id="titulaire_url", component_property="pathname"), Input(component_id="titulaire_url", component_property="pathname"),
) )
def update_titulaire_infos(url): def update_titulaire_infos(url):
titulaire_siret = url.split("/")[-1] titulaire_siret = url.split("/")[-1]
if "titulaire_activite_libelle" in DF_TITULAIRES.columns:
activite_libelle_row = DF_TITULAIRES.filter(
pl.col("titulaire_id") == titulaire_siret
).select("titulaire_activite_libelle")
activite_libelle = (
activite_libelle_row.item(0, 0) if activite_libelle_row.height > 0 else ""
)
else:
activite_libelle = ""
data = get_annuaire_data(titulaire_siret) data = get_annuaire_data(titulaire_siret)
data_etablissement = data.get("matching_etablissements") if data else None data_etablissement = data.get("matching_etablissements") if data else None
if data_etablissement: if data_etablissement:
@@ -302,6 +318,7 @@ def update_titulaire_infos(url):
departement, departement,
nom_region, nom_region,
lien_annuaire, lien_annuaire,
activite_libelle,
) )