person card: highlight institution when it matches active filter

This commit is contained in:
2026-07-03 13:16:04 +02:00
parent 6fa5792e5e
commit 8e56b59122
4 changed files with 24 additions and 0 deletions
@@ -57,6 +57,7 @@
<button
type="button"
class="institution-tag"
[class.active]="isInstitutionActive()"
[matTooltip]="inst.display_name || ''"
matTooltipPosition="above"
(click)="
@@ -172,6 +172,19 @@
0 0 0 2px var(--sg-background),
0 0 0 4px var(--sg-primary);
}
&.active {
border-color: var(--sg-primary);
box-shadow:
0 0 0 1px #ffffff,
0 0 0 3px var(--sg-primary);
}
&.active:hover,
&.active:focus-visible {
background: var(--sg-primary);
color: #fff;
}
}
.flag-img {
@@ -27,6 +27,7 @@ export class PersonCardComponent {
isBookmarked = input<boolean>(false);
loading = input<boolean>(false);
selectedTopics = input<Set<string>>(new Set<string>());
activeInstitutionName = input<string>('');
bookmarkToggle = output<CustomAuthor>();
topicClick = output<string>();
@@ -65,6 +66,14 @@ export class PersonCardComponent {
return newestInstitution;
});
isInstitutionActive = computed<boolean>(() => {
const active = this.activeInstitutionName().trim().toLowerCase();
if (!active) return false;
return (
(this.institution()?.display_name ?? '').trim().toLowerCase() === active
);
});
topics = computed<WorkTopic[]>(() => {
return (this.person().topics ?? [])
.filter((t): t is WorkTopic => !!t.display_name)
@@ -159,6 +159,7 @@
[person]="person"
[isBookmarked]="isBookmarked(person)"
[selectedTopics]="selectedTopics()"
[activeInstitutionName]="appliedInstitutionName"
(bookmarkToggle)="toggleBookmark($event)"
(topicClick)="onCardTopicClick($event)"
(institutionClick)="onCardInstitutionClick($event)">