From 5d22b201e941c6e0ae29e9427582e83fec7cd113 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 7 Jul 2026 08:50:48 +0200 Subject: [PATCH 01/10] publications/persons: add open-institution shortcut to institution tags and filter chips --- .../person-card/person-card.component.html | 8 +++++ .../person-card/person-card.component.scss | 25 +++++++++++++ .../person-card/person-card.component.ts | 20 +++++++++-- .../person-list/person-list.component.html | 8 +++++ .../person-list/person-list.component.scss | 21 +++++++++++ .../person-list/person-list.component.ts | 35 +++++++++++++++++++ .../person-publications.component.html | 12 +++++++ .../person-publications.component.scss | 23 ++++++++++++ .../person-publications.component.ts | 13 +++++++ 9 files changed, 163 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/modules/person-card/person-card.component.html b/webapp/src/app/modules/person-card/person-card.component.html index 946430ae..1f7741d4 100644 --- a/webapp/src/app/modules/person-card/person-card.component.html +++ b/webapp/src/app/modules/person-card/person-card.component.html @@ -95,6 +95,14 @@ >{{ inst.country_code.toUpperCase() }} } + @if (institutionPageId() && !loading()) { + open_in_new + } } diff --git a/webapp/src/app/modules/person-card/person-card.component.scss b/webapp/src/app/modules/person-card/person-card.component.scss index 75f0ed69..2172cd99 100644 --- a/webapp/src/app/modules/person-card/person-card.component.scss +++ b/webapp/src/app/modules/person-card/person-card.component.scss @@ -162,6 +162,31 @@ white-space: nowrap; } + .institution-open-icon { + flex-shrink: 0; + width: 12px; + height: 12px; + margin-left: 5px; + font-size: 12px; + line-height: 1; + vertical-align: middle; + cursor: pointer; + opacity: 0; + transition: opacity 0.15s ease; + + &:hover { + opacity: 1; + } + } + + &:hover .institution-open-icon { + opacity: 0.7; + + &:hover { + opacity: 1; + } + } + &:hover, &:focus-visible { background: var(--sg-primary); diff --git a/webapp/src/app/modules/person-card/person-card.component.ts b/webapp/src/app/modules/person-card/person-card.component.ts index e8a50711..aef4cd8f 100644 --- a/webapp/src/app/modules/person-card/person-card.component.ts +++ b/webapp/src/app/modules/person-card/person-card.component.ts @@ -1,6 +1,6 @@ -import { Component, input, computed, output } from '@angular/core'; +import { Component, inject, input, computed, output } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { RouterLink } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api'; @@ -23,6 +23,8 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; styleUrl: './person-card.component.scss', }) export class PersonCardComponent { + private readonly router = inject(Router); + person = input.required(); isBookmarked = input(false); loading = input(false); @@ -66,6 +68,20 @@ export class PersonCardComponent { return newestInstitution; }); + institutionPageId = computed( + () => this.institution()?.id?.split('/').pop() ?? null, + ); + + openInstitutionPage(event: Event): void { + event.stopPropagation(); + event.preventDefault(); + + const id = this.institutionPageId(); + if (!id) return; + + void this.router.navigate(['/institution', id]); + } + isInstitutionActive = computed(() => { const active = this.activeInstitutionName().trim().toLowerCase(); if (!active) return false; diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index 0dc9fe14..9647b24a 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -82,6 +82,14 @@ filter.countryCode.toUpperCase() }} } + @if (findInstitutionPageIdByName(filter.value)) { + open_in_new + } } @empty { - diff --git a/webapp/src/app/modules/person-publications/person-publications.component.scss b/webapp/src/app/modules/person-publications/person-publications.component.scss index 45f2e235..715913f9 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.scss +++ b/webapp/src/app/modules/person-publications/person-publications.component.scss @@ -301,6 +301,29 @@ h2 { font-size: 9px; } +.filter-institution-chip .institution-open-icon, +.publication-institution-tag .institution-open-icon { + flex-shrink: 0; + width: 12px; + height: 12px; + margin-left: 5px; + font-size: 12px; + line-height: 1; + cursor: pointer; + opacity: 0; + transition: opacity 0.15s ease; +} + +.filter-institution-chip:hover .institution-open-icon, +.publication-institution-tag:hover .institution-open-icon { + opacity: 0.7; +} + +.filter-institution-chip .institution-open-icon:hover, +.publication-institution-tag .institution-open-icon:hover { + opacity: 1; +} + .filter-meta-chip__label, .filter-topic-chip__label { overflow: hidden; diff --git a/webapp/src/app/modules/person-publications/person-publications.component.ts b/webapp/src/app/modules/person-publications/person-publications.component.ts index 739602b2..09a9d755 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.ts +++ b/webapp/src/app/modules/person-publications/person-publications.component.ts @@ -486,6 +486,19 @@ export class PersonPublicationsComponent implements OnInit { }); } + openInstitutionPage( + institutionId: string | null | undefined, + event: Event, + ): void { + event.stopPropagation(); + event.preventDefault(); + + const id = institutionId?.split('/').pop(); + if (!id) return; + + void this.router.navigate(['/institution', id]); + } + getSelectedTopicTooltip(topic: TopicAutocompleteOption): string { const workTopic = this.findPublicationTopic(topic.id); From bb941361a154fba94aded0fcfb081f1aad536efc Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 7 Jul 2026 09:04:43 +0200 Subject: [PATCH 02/10] publication-detail: link topic chips to keywords topic mapping --- .../publication-detail.component.html | 3 ++- .../publication-detail.component.ts | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index c672c74c..54f34606 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -182,7 +182,8 @@ [subfieldName]="topic.subfield?.display_name" [fieldName]="topic.field?.display_name" [domainName]="topic.domain?.display_name" - [color]="getTopicColor(topic)"> + [color]="getTopicColor(topic)" + (chipClick)="openTopicInKeywords(topic)"> } diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index b377543b..c0c1ee5e 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -6,7 +6,7 @@ import { HttpClient } from '@angular/common/http'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { ActivatedRoute, RouterLink } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { finalize } from 'rxjs'; import { Authorship, @@ -50,6 +50,7 @@ export class PublicationDetailComponent implements OnInit { private readonly route = inject(ActivatedRoute); private readonly httpClient = inject(HttpClient); private readonly location = inject(Location); + private readonly router = inject(Router); private readonly worksService = inject(WorksService); publication: Work | null = null; @@ -75,6 +76,22 @@ export class PublicationDetailComponent implements OnInit { this.location.back(); } + openTopicInKeywords(topic: WorkTopic): void { + const topicName = topic.display_name?.trim(); + if (!topicName) return; + + // Deep link into the keywords page: the topic lands as manual keyword, + // is preselected and shown in the topic-mapping view, so the + // analysis/visualization can be started for it directly. + void this.router.navigate(['/keywords'], { + queryParams: { + manual: topicName, + selected: topicName, + view: 'topic', + }, + }); + } + getTopicColor(topic: WorkTopic): string { return topicHierarchyColor({ id: topic.id, From 383c77134a7ab8cecf3e3effa7fae79060c3df66 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 7 Jul 2026 09:19:34 +0200 Subject: [PATCH 03/10] publication-detail: link topic chips to person search topic filter --- .../publication-detail.component.html | 2 +- .../publication-detail.component.ts | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index 54f34606..a91f0a45 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -183,7 +183,7 @@ [fieldName]="topic.field?.display_name" [domainName]="topic.domain?.display_name" [color]="getTopicColor(topic)" - (chipClick)="openTopicInKeywords(topic)"> + (chipClick)="findAuthorsForTopic(topic)"> } diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index c0c1ee5e..b4c766e8 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -76,19 +76,14 @@ export class PublicationDetailComponent implements OnInit { this.location.back(); } - openTopicInKeywords(topic: WorkTopic): void { + findAuthorsForTopic(topic: WorkTopic): void { const topicName = topic.display_name?.trim(); if (!topicName) return; - // Deep link into the keywords page: the topic lands as manual keyword, - // is preselected and shown in the topic-mapping view, so the - // analysis/visualization can be started for it directly. - void this.router.navigate(['/keywords'], { - queryParams: { - manual: topicName, - selected: topicName, - view: 'topic', - }, + // Deep link into the person search with this topic preset as filter, + // so matching authors show up directly. + void this.router.navigate(['/persons'], { + queryParams: { topic: topicName }, }); } From e470b65b5a18c64232e8c293bae7985ac3b194be Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 7 Jul 2026 09:38:06 +0200 Subject: [PATCH 04/10] publication-detail: make authors and institutions collapsible like news sidebar --- .../publication-detail.component.html | 197 +++++++++++------- .../publication-detail.component.scss | 85 ++++++++ .../publication-detail.component.ts | 5 + 3 files changed, 208 insertions(+), 79 deletions(-) diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index a91f0a45..77157e33 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -117,55 +117,75 @@ } -
-
+
+
-
- @for (authorship of authors(); track authorship.author?.id) { - - } @empty { -

Keine Angaben vorhanden.

+ Autorinnen und Autoren + info_outline + @if (authors().length) { + {{ authors().length }} } -
+ expand_more + + @if (authorsExpanded) { +
+
+ @for (authorship of authors(); track authorship.author?.id) { + + } @empty { +

Keine Angaben vorhanden.

+ } +
+
+ }
@if (publication.topics?.length) { @@ -300,41 +320,60 @@ @if (institutions().length) { -
-
+
+
-
- @for (institution of institutions(); track institution.id) { -
- - {{ institution.name }} - - @if (institution.country) { - - - {{ institution.country.toUpperCase() }} - - } @else if (institution.type) { - {{ institution.type }} + Institutionen + info_outline + {{ institutions().length }} + expand_more + + @if (institutionsExpanded) { +
+
+ @for (institution of institutions(); track institution.id) { +
+ + {{ institution.name }} + + @if (institution.country) { + + + {{ institution.country.toUpperCase() }} + + } @else if (institution.type) { + {{ institution.type }} + } +
}
- } -
+
+ }
} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.scss b/webapp/src/app/modules/publication-detail/publication-detail.component.scss index 2e8c72d4..463604b8 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.scss +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.scss @@ -188,6 +188,79 @@ aside { box-shadow: var(--sg-shadow-sm); } +.accordion-card { + padding: 0; + overflow: hidden; +} + +.accordion-header { + display: flex; + align-items: center; + gap: 8px; + width: 100%; + padding: 18px 22px; + background: none; + border: none; + cursor: pointer; + text-align: left; + font-family: inherit; + font-size: 16px; + font-weight: 700; + color: var(--sg-text); + transition: background 0.12s; + + &:hover { + background: #f6f9ff; + } + + mat-icon { + flex-shrink: 0; + width: 20px; + height: 20px; + font-size: 20px; + color: var(--sg-text-muted); + } +} + +.accordion-title { + flex: 1; +} + +.count-badge { + padding: 2px 7px; + border-radius: 999px; + background: #e8effe; + color: #3b5bd6; + font-size: 11px; + font-weight: 700; +} + +.info-icon { + flex-shrink: 0; + width: 16px !important; + height: 16px !important; + font-size: 16px !important; + color: var(--sg-text-muted); + opacity: 0.7; + cursor: default; + + &:hover { + opacity: 1; + } +} + +.chevron { + transition: transform 0.2s ease; + + &.rotated { + transform: rotate(-90deg); + } +} + +.accordion-body { + padding: 4px 22px 22px; +} + .section-title { display: flex; align-items: center; @@ -445,6 +518,18 @@ dd { padding: 22px 20px; } + .accordion-card { + padding: 0; + } + + .accordion-header { + padding: 16px 20px; + } + + .accordion-body { + padding: 4px 20px 20px; + } + .metrics, .author-list { grid-template-columns: 1fr; diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index b4c766e8..a039137b 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -6,6 +6,7 @@ import { HttpClient } from '@angular/common/http'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { finalize } from 'rxjs'; import { @@ -38,6 +39,7 @@ interface InstitutionDetail { MatButtonModule, MatIconModule, MatProgressSpinnerModule, + MatTooltipModule, RouterLink, TopicChipComponent, UpperCasePipe, @@ -57,6 +59,9 @@ export class PublicationDetailComponent implements OnInit { loading = true; notFound = false; + authorsExpanded = true; + institutionsExpanded = false; + ngOnInit(): void { this.loading = true; From 940c050cd72a14d224c35b352771c68566562f6a Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 7 Jul 2026 09:44:17 +0200 Subject: [PATCH 05/10] publication-detail: make sources and funding sections collapsible --- .../publication-detail.component.html | 168 +++++++++++------- .../publication-detail.component.ts | 9 + 2 files changed, 113 insertions(+), 64 deletions(-) diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index 77157e33..7c11115c 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -225,52 +225,71 @@ } @if (sources().length) { -
-
+
+
-
- @for ( - location of sources(); - track location.source?.id || location.landing_page_url - ) { -
-
- {{ - location.source?.display_name || 'Externe Quelle' - }} -

- {{ - location.version || - location.source?.type || - 'Veröffentlichte Version' - }} - @if (location.license) { - · {{ location.license }} - } -

-
-
- @if (location.is_oa) { - Open Access - } - @if ( - location.pdf_url || location.landing_page_url; - as sourceUrl - ) { - - open_in_new - - } -
-
- } -
+ Quellen und Versionen + info_outline + {{ sources().length }} + expand_more + + @if (sourcesExpanded) { +
+
+ @for ( + location of sources(); + track location.source?.id || location.landing_page_url + ) { +
+
+ {{ + location.source?.display_name || 'Externe Quelle' + }} +

+ {{ + location.version || + location.source?.type || + 'Veröffentlichte Version' + }} + @if (location.license) { + · {{ location.license }} + } +

+
+
+ @if (location.is_oa) { + Open Access + } + @if ( + location.pdf_url || location.landing_page_url; + as sourceUrl + ) { + + open_in_new + + } +
+
+ } +
+
+ }
} @@ -378,27 +397,48 @@ } @if (publication.funders?.length || publication.awards?.length) { -
-
+
+
-
- @for (funder of publication.funders ?? []; track funder.id) { -
- {{ funder.display_name }}Förderorganisation + Förderungen + info_outline + {{ fundingCount() }} + expand_more + + @if (fundingExpanded) { +
+
+ @for (funder of publication.funders ?? []; track funder.id) { +
+ {{ funder.display_name }}Förderorganisation +
+ } + @for (award of publication.awards ?? []; track award.id) { +
+ {{ + award.display_name || award.funder_award_id + }}{{ + award.funder_display_name || 'Förderung' + }} +
+ }
- } - @for (award of publication.awards ?? []; track award.id) { -
- {{ - award.display_name || award.funder_award_id - }}{{ award.funder_display_name || 'Förderung' }} -
- } -
+
+ }
} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index a039137b..6b8d27a4 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -61,6 +61,8 @@ export class PublicationDetailComponent implements OnInit { authorsExpanded = true; institutionsExpanded = false; + sourcesExpanded = false; + fundingExpanded = false; ngOnInit(): void { this.loading = true; @@ -172,6 +174,13 @@ export class PublicationDetailComponent implements OnInit { ); } + fundingCount(): number { + return ( + (this.publication?.funders?.length ?? 0) + + (this.publication?.awards?.length ?? 0) + ); + } + pages(): string | null { const first = this.publication?.biblio?.first_page; const last = this.publication?.biblio?.last_page; From a8e582cf23a5334121bc7d96f8abfaf676d3b8a1 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Tue, 7 Jul 2026 09:46:53 +0200 Subject: [PATCH 06/10] publication-detail: make external links section collapsible --- .../publication-detail.component.html | 43 +++++++++++++------ .../publication-detail.component.ts | 1 + 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index 7c11115c..54cdc042 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -443,19 +443,38 @@ } @if (externalLinks().length) { -
-
+
+
- + Externe Links + info_outline + {{ externalLinks().length }} + expand_more + + @if (linksExpanded) { +
+ +
+ }
} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index 6b8d27a4..72552ecc 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -63,6 +63,7 @@ export class PublicationDetailComponent implements OnInit { institutionsExpanded = false; sourcesExpanded = false; fundingExpanded = false; + linksExpanded = false; ngOnInit(): void { this.loading = true; From d1802fa1f876200690928b7883aca5ac5121f475 Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 10 Jul 2026 13:12:27 +0200 Subject: [PATCH 07/10] publication detail: paginate authors and institutions lists --- .../publication-detail.component.html | 55 ++++++++++++++++++- .../publication-detail.component.scss | 44 +++++++++++++++ .../publication-detail.component.ts | 30 ++++++++++ 3 files changed, 127 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index 54cdc042..baf5cb60 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -142,7 +142,10 @@ @if (authorsExpanded) {
- @for (authorship of authors(); track authorship.author?.id) { + @for ( + authorship of pagedAuthors(); + track authorship.author?.id + ) {
{{ @@ -184,6 +187,27 @@

Keine Angaben vorhanden.

}
+ @if (authorsPageCount() > 1) { +
+ + {{ authorsPage + 1 }} / {{ authorsPageCount() }} + +
+ }
} @@ -362,7 +386,10 @@ @if (institutionsExpanded) {
- @for (institution of institutions(); track institution.id) { + @for ( + institution of pagedInstitutions(); + track institution.id + ) { + @if (institutionsPageCount() > 1) { +
+ + {{ institutionsPage + 1 }} / + {{ institutionsPageCount() }} + +
+ }
} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.scss b/webapp/src/app/modules/publication-detail/publication-detail.component.scss index 463604b8..6c9b3334 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.scss +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.scss @@ -444,6 +444,50 @@ dd { font-size: 11px; } +.list-pagination { + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + margin-top: 12px; +} + +.page-btn { + display: grid; + place-items: center; + width: 28px; + height: 28px; + border: 1px solid var(--sg-border); + border-radius: 8px; + background: none; + cursor: pointer; + color: var(--sg-text-muted); + transition: background 0.12s; + + &:hover:not(:disabled) { + background: var(--sg-surface-muted); + color: var(--sg-text); + } + + &:disabled { + opacity: 0.35; + cursor: default; + } + + mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + } +} + +.page-indicator { + font-size: 12px; + color: var(--sg-text-muted); + min-width: 36px; + text-align: center; +} + .institution-country { display: inline-flex; align-items: center; diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index 72552ecc..0153993b 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -65,12 +65,20 @@ export class PublicationDetailComponent implements OnInit { fundingExpanded = false; linksExpanded = false; + authorsPage = 0; + readonly authorsPageSize = 10; + + institutionsPage = 0; + readonly institutionsPageSize = 5; + ngOnInit(): void { this.loading = true; this.route.data.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({ next: ({ publication }) => { this.publication = publication; + this.authorsPage = 0; + this.institutionsPage = 0; this.loading = false; }, error: () => { @@ -130,6 +138,28 @@ export class PublicationDetailComponent implements OnInit { return this.publication?.authorships ?? []; } + pagedAuthors(): Authorship[] { + return this.authors().slice( + this.authorsPage * this.authorsPageSize, + (this.authorsPage + 1) * this.authorsPageSize, + ); + } + + authorsPageCount(): number { + return Math.ceil(this.authors().length / this.authorsPageSize); + } + + pagedInstitutions(): InstitutionDetail[] { + return this.institutions().slice( + this.institutionsPage * this.institutionsPageSize, + (this.institutionsPage + 1) * this.institutionsPageSize, + ); + } + + institutionsPageCount(): number { + return Math.ceil(this.institutions().length / this.institutionsPageSize); + } + institutions(): InstitutionDetail[] { const institutions = new Map(); for (const authorship of this.authors()) { From 010e1c7f213da963b1bd3c901603b628093ba16b Mon Sep 17 00:00:00 2001 From: louis-19041904 Date: Fri, 10 Jul 2026 13:43:08 +0200 Subject: [PATCH 08/10] publications: sort author publications by citations or year --- service/src/main/inse/works/logic.py | 4 ++++ service/src/main/inse/works/search_client.py | 18 ++++++++++---- service/src/main/inse/works/service.py | 7 +++++- .../src/main/inse/works/test_search_client.py | 22 +++++++++++++++++ webapp/src/app/api/.openapi-generator/FILES | 1 + webapp/src/app/api/api/works.service.ts | 10 ++++++++ webapp/src/app/api/model/matchedTopic.ts | 18 ++++++++++++++ webapp/src/app/api/model/models.ts | 1 + webapp/src/app/api/model/newsArticleDetail.ts | 3 ++- .../person-publications.component.html | 13 ++++++++++ .../person-publications.component.scss | 4 ++++ .../person-publications.component.ts | 24 +++++++++++++++++++ 12 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 webapp/src/app/api/model/matchedTopic.ts diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index 96bf0ef2..ec4f16af 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -55,6 +55,7 @@ async def get_author_works( language: list[str] | None = None, institution_id: list[str] | None = None, topic_id: list[str] | None = None, + sort: str = "year", client: OpenAlexWorksSearchClient | None = None, ) -> WorkPage: search_client = client or OpenAlexWorksSearchClient() @@ -68,6 +69,7 @@ async def get_author_works( language=language, institution_id=institution_id, topic_id=topic_id, + sort=sort, ) elements, total = _parse_full_work_search_response(data) @@ -929,6 +931,7 @@ async def _search_author_works_data( language: list[str] | None = None, institution_id: list[str] | None = None, topic_id: list[str] | None = None, + sort: str = "year", ) -> dict: return await search_client.search_author_works( author_id, @@ -939,6 +942,7 @@ async def _search_author_works_data( language=language, institution_id=institution_id, topic_id=topic_id, + sort=sort, ) diff --git a/service/src/main/inse/works/search_client.py b/service/src/main/inse/works/search_client.py index 42b2ee8b..2e52a9a6 100644 --- a/service/src/main/inse/works/search_client.py +++ b/service/src/main/inse/works/search_client.py @@ -35,6 +35,7 @@ class OpenAlexWorksSearchClient: language: list[str] | None = None, institution_id: list[str] | None = None, topic_id: list[str] | None = None, + sort: str = "year", ) -> dict[str, Any]: indexed_author_id = f"https://openalex.org/{author_id.strip()}" filters = self._work_filters( @@ -73,6 +74,16 @@ class OpenAlexWorksSearchClient: }, }, }) + if sort == "citations": + sort_clauses = [ + {"cited_by_count": {"order": "desc", "missing": "_last"}}, + {"publication_year": {"order": "desc", "missing": "_last"}}, + ] + else: + sort_clauses = [ + {"publication_year": {"order": "desc", "missing": "_last"}}, + {"cited_by_count": {"order": "desc", "missing": "_last"}}, + ] return { "from": (page - 1) * size, "size": size, @@ -83,10 +94,7 @@ class OpenAlexWorksSearchClient: "filter": filters, }, }, - "sort": [ - {"publication_year": {"order": "desc", "missing": "_last"}}, - {"cited_by_count": {"order": "desc", "missing": "_last"}}, - ], + "sort": sort_clauses, } def _work_filters( @@ -130,6 +138,7 @@ class OpenAlexWorksSearchClient: language: list[str] | None = None, institution_id: list[str] | None = None, topic_id: list[str] | None = None, + sort: str = "year", ) -> dict[str, Any]: if not self.api_key: raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.") @@ -143,6 +152,7 @@ class OpenAlexWorksSearchClient: language=language, institution_id=institution_id, topic_id=topic_id, + sort=sort, ) return await elasticsearch.search(index=self.index,body=body,cluster=ESCluster.NES,) diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py index 382f3fd7..ead6daad 100644 --- a/service/src/main/inse/works/service.py +++ b/service/src/main/inse/works/service.py @@ -4,7 +4,7 @@ REST API for publication works. """ -from typing import Annotated, Optional +from typing import Annotated, Literal, Optional from fastapi import APIRouter from fastapi import Path @@ -54,6 +54,10 @@ async def get_author_works( list[str] | None, Query(description="Filter by OpenAlex topic id. Can be repeated."), ] = None, + sort: Annotated[ + Literal["year", "citations"], + Query(description="Sort order: by publication year or by citation count."), + ] = "year", ): return await logic.get_author_works( author_id, @@ -64,6 +68,7 @@ async def get_author_works( language=language, institution_id=institution_id, topic_id=topic_id, + sort=sort, ) diff --git a/service/src/main/inse/works/test_search_client.py b/service/src/main/inse/works/test_search_client.py index 2d9e2a41..1f3c905e 100644 --- a/service/src/main/inse/works/test_search_client.py +++ b/service/src/main/inse/works/test_search_client.py @@ -26,6 +26,28 @@ def test_author_works_query_searches_authorship_author_id(): assert query["query"]["bool"]["filter"] == [] +def test_author_works_query_sorts_by_year_by_default(): + client = OpenAlexWorksSearchClient(api_key="test-key") + + query = client.author_works_query("A5023888391", page=1, size=20) + + assert query["sort"] == [ + {"publication_year": {"order": "desc", "missing": "_last"}}, + {"cited_by_count": {"order": "desc", "missing": "_last"}}, + ] + + +def test_author_works_query_sorts_by_citations(): + client = OpenAlexWorksSearchClient(api_key="test-key") + + query = client.author_works_query("A5023888391", page=1, size=20, sort="citations") + + assert query["sort"] == [ + {"cited_by_count": {"order": "desc", "missing": "_last"}}, + {"publication_year": {"order": "desc", "missing": "_last"}}, + ] + + def test_author_works_query_adds_publication_filters(): client = OpenAlexWorksSearchClient(api_key="test-key") diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 9928d2c3..e0efeecf 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -142,6 +142,7 @@ model/loginResponse.ts model/longitude.ts model/matchedAuthor.ts model/matchedOfficer.ts +model/matchedTopic.ts model/mentionedPerson.ts model/meta.ts model/model2YrMeanCitedness.ts diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index ca494a80..4561cb78 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -165,6 +165,7 @@ export class WorksService extends BaseService { * @param language Filter by language code. Can be repeated. * @param institutionId Filter by OpenAlex institution id. Can be repeated. * @param topicId Filter by OpenAlex topic id. Can be repeated. + * @param sort Sort order: by publication year or by citation count. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -177,6 +178,7 @@ export class WorksService extends BaseService { language?: Array, institutionId?: Array, topicId?: Array, + sort?: 'year' | 'citations', observe?: 'body', reportProgress?: boolean, options?: { @@ -194,6 +196,7 @@ export class WorksService extends BaseService { language?: Array, institutionId?: Array, topicId?: Array, + sort?: 'year' | 'citations', observe?: 'response', reportProgress?: boolean, options?: { @@ -211,6 +214,7 @@ export class WorksService extends BaseService { language?: Array, institutionId?: Array, topicId?: Array, + sort?: 'year' | 'citations', observe?: 'events', reportProgress?: boolean, options?: { @@ -228,6 +232,7 @@ export class WorksService extends BaseService { language?: Array, institutionId?: Array, topicId?: Array, + sort?: 'year' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: { @@ -298,6 +303,11 @@ export class WorksService extends BaseService { ); }); } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sort, + 'sort', + ); let localVarHeaders = this.defaultHeaders; diff --git a/webapp/src/app/api/model/matchedTopic.ts b/webapp/src/app/api/model/matchedTopic.ts new file mode 100644 index 00000000..52de9018 --- /dev/null +++ b/webapp/src/app/api/model/matchedTopic.ts @@ -0,0 +1,18 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface MatchedTopic { + id?: string | null; + display_name?: string | null; + subfield_name?: string | null; + field_name?: string | null; + domain_name?: string | null; + source_keyword?: string | null; +} diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index d932a058..fb8ac2ef 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -117,6 +117,7 @@ export * from './loginResponse'; export * from './longitude'; export * from './matchedAuthor'; export * from './matchedOfficer'; +export * from './matchedTopic'; export * from './mentionedPerson'; export * from './meta'; export * from './model2YrMeanCitedness'; diff --git a/webapp/src/app/api/model/newsArticleDetail.ts b/webapp/src/app/api/model/newsArticleDetail.ts index ac51097c..09962000 100644 --- a/webapp/src/app/api/model/newsArticleDetail.ts +++ b/webapp/src/app/api/model/newsArticleDetail.ts @@ -7,6 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import { MatchedTopic } from './matchedTopic'; import { MentionedPerson } from './mentionedPerson'; export interface NewsArticleDetail { @@ -20,6 +21,6 @@ export interface NewsArticleDetail { related?: boolean | null; full_content?: string | null; authors?: Array; - topics?: Array; keywords?: Array; + topics?: Array; } diff --git a/webapp/src/app/modules/person-publications/person-publications.component.html b/webapp/src/app/modules/person-publications/person-publications.component.html index ba311a44..1b1664bb 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.html +++ b/webapp/src/app/modules/person-publications/person-publications.component.html @@ -156,6 +156,19 @@ + + sort + + @for (option of sortOptions; track option.value) { + {{ option.label }} + } + + +
- @if (worksCount() !== null || citedByCount() !== null) { + @if ( + worksCount() !== null || citedByCount() !== null || h_index() !== null + ) { @if (worksCount() !== null) { menu_book - {{ worksCount() }} Publikationen + {{ worksCount() | number }} Publikationen } @if (worksCount() !== null && citedByCount() !== null) { @@ -45,50 +47,66 @@ @if (citedByCount() !== null) { format_quote - {{ citedByCount() }} Zitationen + {{ citedByCount() | number }} Zitationen + + } + @if ( + (worksCount() !== null || citedByCount() !== null) && + h_index() !== null + ) { + · + } + @if (h_index() !== null) { + + trending_up + h-Index {{ h_index() }} } - - @if (h_index() !== null) { - h_index: {{ h_index() }} + } + @if (displayCareerStage() || orcid()) { + -
-
- mail - uni-email@uni-due.de -
- @if (orcid()) { -
- verified - {{ - orcid() - }} -
- } - -