From 877b602e62356bf6fd8be0bb5813b1113cbedaa6 Mon Sep 17 00:00:00 2001 From: Andria Capai Date: Wed, 18 Dec 2024 10:21:18 +0100 Subject: [PATCH] fix: taxon Select returning cd_nom Use getPreferredName method everywhere needs to display taxon name . Use click event in select in order to update cd_nom control form Reviewed-by: andriacap --- .../observations/form/form.component.html | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/frontend/src/app/programs/observations/form/form.component.html b/frontend/src/app/programs/observations/form/form.component.html index b13c71a7..cdf5fd7e 100644 --- a/frontend/src/app/programs/observations/form/form.component.html +++ b/frontend/src/app/programs/observations/form/form.component.html @@ -13,9 +13,7 @@ '?w=800' : 'assets/default_image.png' " [alt]=" - !!taxa[0].nom_francais - ? taxa[0].nom_francais - : taxa[0].taxref.nom_vern + getPreferredName(taxa[0]) " class="object-fit-cover" /> @@ -38,14 +36,10 @@
taxaCount >= taxonSelectInputThreshold && taxaCount < taxonAutocompleteInputThreshold " class="d-inline-flex toolbar "> - - @@ -65,15 +59,10 @@
'?h=150' : 'assets/default_image.png' " [alt]=" - !!s.nom_francais - ? s.nom_francais - : s.taxref.nom_vern + getPreferredName(s) " (click)="onTaxonSelected(s)" /> - {{ - !!s.nom_francais - ? s.nom_francais - : s.taxref.nom_vern - }} + {{ getPreferredName(s) }} +