update person to display scores in interest tags
This commit is contained in:
@@ -288,6 +288,12 @@ def search_persons(
|
||||
ids_copy[str_field] = str(val)
|
||||
source_copy["ids"] = ids_copy
|
||||
|
||||
topics = source_copy.get("topics")
|
||||
if isinstance(topics, list):
|
||||
for topic in topics:
|
||||
if isinstance(topic, dict) and topic.get("score") is None:
|
||||
topic["score"] = topic.get("count")
|
||||
|
||||
author = Author.from_dict(source_copy)
|
||||
if author:
|
||||
authors.append(author)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="interest-tags">
|
||||
@if (tags().length > 0) {
|
||||
@for (tag of tags(); track tag.label) {
|
||||
<button type="button" class="interest-tag-button">{{ tag.label }}</button>
|
||||
<button type="button" class="interest-tag-button">{{ tag.label }} ({{ tag.score }}*)</button>
|
||||
}
|
||||
} @else {
|
||||
<span class="interest-empty">Keine Themen gefunden</span>
|
||||
|
||||
@@ -50,7 +50,7 @@ export class PersonComponent {
|
||||
switchMap((id) => {
|
||||
if (!id) return of(null);
|
||||
this.isPersonLoading.set(true);
|
||||
return this.personsApi.searchPersons(id, PERSON_INCLUDE_TAGS).pipe(
|
||||
return this.personsApi.searchPersons(id, undefined, PERSON_INCLUDE_TAGS).pipe(
|
||||
map((result) => result.results?.[0] ?? null),
|
||||
catchError((err) => {
|
||||
console.error('Failed to load person:', err);
|
||||
|
||||
Reference in New Issue
Block a user