refactor(person-funding): reuse shared publication-detail page for 'Mehr Infos' instead of duplicated inline panel #252
@@ -4,303 +4,6 @@
|
||||
<p class="message">Fehler beim Laden der Förderungen.</p>
|
||||
} @else if (funders.length === 0) {
|
||||
<p class="message">Keine Förderungen gefunden.</p>
|
||||
} @else if (selectedPublicationDetailId) {
|
||||
@if (getSelectedPublicationDetail(); as publication) {
|
||||
<div class="funding-publication-page">
|
||||
<button
|
||||
type="button"
|
||||
class="publication-detail-back"
|
||||
(click)="closePublicationDetail()">
|
||||
<span class="material-icons">arrow_back</span>
|
||||
Zurück zu den Förderungen
|
||||
</button>
|
||||
|
||||
<section class="publication-detail-hero">
|
||||
<div class="publication-detail-hero__content">
|
||||
<div class="publication-detail-hero__meta">
|
||||
@if (publication.publication_year) {
|
||||
<span>{{ publication.publication_year }}</span>
|
||||
}
|
||||
@if (hasTextValue(getPublicationTypeLabel(publication))) {
|
||||
<span>{{ getPublicationTypeLabel(publication) }}</span>
|
||||
}
|
||||
@if (hasTextValue(getLanguageLabel(publication))) {
|
||||
<span>{{ getLanguageLabel(publication) }}</span>
|
||||
}
|
||||
</div>
|
||||
<h2>{{ publication.title }}</h2>
|
||||
@if (hasPublicationSource(publication)) {
|
||||
<p class="publication-detail-hero__source">
|
||||
{{ getPublicationSourceLabel(publication) }}
|
||||
</p>
|
||||
}
|
||||
<p class="publication-detail-hero__authors">
|
||||
{{ getPublicationAuthors(publication) }}
|
||||
</p>
|
||||
<div class="publication-detail-hero__highlights">
|
||||
@if (typeof publication.cited_by_count === 'number') {
|
||||
<span class="hero-highlight">
|
||||
<span class="hero-highlight__value">{{
|
||||
publication.cited_by_count
|
||||
}}</span>
|
||||
<span class="hero-highlight__label">Zitationen</span>
|
||||
</span>
|
||||
}
|
||||
<span
|
||||
class="hero-highlight hero-highlight--badge"
|
||||
[class.hero-highlight--open]="
|
||||
getOpenAccessBadge(publication).tone === 'open'
|
||||
"
|
||||
[class.hero-highlight--closed]="
|
||||
getOpenAccessBadge(publication).tone === 'closed'
|
||||
">
|
||||
{{ getOpenAccessBadge(publication).label }}
|
||||
</span>
|
||||
<span
|
||||
class="position-badge"
|
||||
[ngClass]="getPositionBadgeClass(publication.author_position)">
|
||||
{{ getPositionLabel(publication.author_position || 'unknown') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@if (getPublicationExternalUrl(publication); as externalUrl) {
|
||||
<a
|
||||
class="publication-detail-hero__action"
|
||||
[href]="externalUrl"
|
||||
target="_blank"
|
||||
rel="noopener">
|
||||
Zur Publikation
|
||||
<span class="material-icons">open_in_new</span>
|
||||
</a>
|
||||
}
|
||||
</section>
|
||||
|
||||
<div class="publication-detail-grid">
|
||||
<div class="publication-detail-main">
|
||||
<section class="publication-detail-section">
|
||||
<h3>Überblick</h3>
|
||||
<p
|
||||
class="publication-overview"
|
||||
[innerHTML]="getPublicationOverview(publication)"></p>
|
||||
</section>
|
||||
|
||||
<section class="publication-detail-section">
|
||||
<h3>Abstract</h3>
|
||||
<p class="publication-abstract">
|
||||
{{ publication.abstract || 'Kein Abstract vorhanden.' }}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
@if (publication.publication_date) {
|
||||
<section class="publication-detail-section">
|
||||
<h3>Publikationsdaten</h3>
|
||||
<dl class="publication-detail-facts">
|
||||
<div>
|
||||
<dt>Datum</dt>
|
||||
<dd>{{ getPublicationDateLabel(publication) }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (
|
||||
hasTextValue(publication.primary_topic) ||
|
||||
hasTextValue(publication.topic_field) ||
|
||||
hasTextValue(publication.topic_subfield) ||
|
||||
hasTextValue(publication.topic_domain) ||
|
||||
hasListValues(publication.topics) ||
|
||||
hasListValues(publication.keywords)
|
||||
) {
|
||||
<section class="publication-detail-section">
|
||||
<h3>Einordnung</h3>
|
||||
<dl class="publication-detail-facts">
|
||||
@if (hasTextValue(publication.primary_topic)) {
|
||||
<div>
|
||||
<dt>Hauptthema</dt>
|
||||
<dd>{{ publication.primary_topic }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (hasTextValue(publication.topic_field)) {
|
||||
<div>
|
||||
<dt>Fachgebiet</dt>
|
||||
<dd>{{ publication.topic_field }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (hasTextValue(publication.topic_subfield)) {
|
||||
<div>
|
||||
<dt>Teilgebiet</dt>
|
||||
<dd>{{ publication.topic_subfield }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (hasTextValue(publication.topic_domain)) {
|
||||
<div>
|
||||
<dt>Bereich</dt>
|
||||
<dd>{{ publication.topic_domain }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (hasListValues(publication.topics)) {
|
||||
<div>
|
||||
<dt>Themen</dt>
|
||||
<dd>
|
||||
<ul class="tag-list">
|
||||
@for (topic of publication.topics; track topic) {
|
||||
<li class="tag">{{ topic }}</li>
|
||||
}
|
||||
</ul>
|
||||
</dd>
|
||||
</div>
|
||||
}
|
||||
@if (hasListValues(publication.keywords)) {
|
||||
<div>
|
||||
<dt>Keywords</dt>
|
||||
<dd>
|
||||
<ul class="tag-list">
|
||||
@for (keyword of publication.keywords; track keyword) {
|
||||
<li class="tag">{{ keyword }}</li>
|
||||
}
|
||||
</ul>
|
||||
</dd>
|
||||
</div>
|
||||
}
|
||||
</dl>
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (
|
||||
getCitationCountsByYear(publication).length ||
|
||||
publication.is_retracted
|
||||
) {
|
||||
<section class="publication-detail-section">
|
||||
<h3>Wirkung</h3>
|
||||
<dl class="publication-detail-facts">
|
||||
@if (getCitationCountsByYear(publication); as citationYears) {
|
||||
@if (citationYears.length) {
|
||||
<div>
|
||||
<dt>Zitiert pro Jahr</dt>
|
||||
<dd>
|
||||
<table class="citation-year-table">
|
||||
<tbody>
|
||||
@for (entry of citationYears; track entry.year) {
|
||||
<tr>
|
||||
<th scope="row">{{ entry.year }}</th>
|
||||
<td>{{ entry.count }}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</dd>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@if (publication.is_retracted) {
|
||||
<div>
|
||||
<dt>Zurückgezogen</dt>
|
||||
<dd>
|
||||
<span class="warning-badge">Ja, zurückgezogen</span>
|
||||
</dd>
|
||||
</div>
|
||||
}
|
||||
</dl>
|
||||
</section>
|
||||
}
|
||||
|
||||
<section class="publication-detail-section">
|
||||
<h3>Zugang</h3>
|
||||
<dl class="publication-detail-facts">
|
||||
<div>
|
||||
<dt>Open Access</dt>
|
||||
<dd>
|
||||
<span
|
||||
class="access-badge"
|
||||
[class.access-badge--open]="
|
||||
getOpenAccessBadge(publication).tone === 'open'
|
||||
"
|
||||
[class.access-badge--closed]="
|
||||
getOpenAccessBadge(publication).tone === 'closed'
|
||||
">
|
||||
{{ getOpenAccessBadge(publication).label }}
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Volltext</dt>
|
||||
<dd class="access-actions">
|
||||
<span>{{ getFulltextLabel(publication) }}</span>
|
||||
@if (publication.pdf_url) {
|
||||
<a
|
||||
class="inline-action"
|
||||
[href]="publication.pdf_url"
|
||||
target="_blank"
|
||||
rel="noopener">
|
||||
PDF öffnen
|
||||
<span class="material-icons">open_in_new</span>
|
||||
</a>
|
||||
}
|
||||
</dd>
|
||||
</div>
|
||||
@if (hasTextValue(getLicenseLabel(publication))) {
|
||||
<div>
|
||||
<dt>Lizenz</dt>
|
||||
<dd>{{ getLicenseLabel(publication) }}</dd>
|
||||
</div>
|
||||
}
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<aside class="publication-detail-side">
|
||||
<section
|
||||
class="publication-detail-section publication-detail-section--funding">
|
||||
<h3>Förderbezug</h3>
|
||||
<dl class="publication-detail-facts">
|
||||
<div>
|
||||
<dt>Förderer</dt>
|
||||
<dd>{{ getPublicationFunderLabel(publication) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Position</dt>
|
||||
<dd>
|
||||
<span
|
||||
class="position-badge"
|
||||
[ngClass]="
|
||||
getPositionBadgeClass(publication.author_position)
|
||||
">
|
||||
{{
|
||||
getPositionLabel(publication.author_position || 'unknown')
|
||||
}}
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
@if (publication.grant_labels?.length) {
|
||||
<div>
|
||||
<dt>Grant</dt>
|
||||
<dd>{{ getGrantLabel(publication) }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (hasListValues(publication.institutions)) {
|
||||
<div>
|
||||
<dt>Institutionen</dt>
|
||||
<dd>{{ getListLabel(publication.institutions) }}</dd>
|
||||
</div>
|
||||
}
|
||||
@if (hasListValues(publication.countries)) {
|
||||
<div>
|
||||
<dt>Länder</dt>
|
||||
<dd>
|
||||
<ul class="tag-list tag-list--compact">
|
||||
@for (country of publication.countries; track country) {
|
||||
<li class="tag">{{ country }}</li>
|
||||
}
|
||||
</ul>
|
||||
</dd>
|
||||
</div>
|
||||
}
|
||||
</dl>
|
||||
</section>
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
} @else {
|
||||
<div class="funding-container">
|
||||
<div class="funding-content">
|
||||
@@ -412,16 +115,16 @@
|
||||
getPublicationTitle(id)
|
||||
}}</span>
|
||||
@if (expandedPublicationId === id) {
|
||||
<button
|
||||
type="button"
|
||||
<a
|
||||
class="publication-more-info"
|
||||
title="Publikationsdetails öffnen"
|
||||
(click)="openPublicationDetail($event, id)">
|
||||
[routerLink]="['/publication', getShortPublicationId(id)]"
|
||||
(click)="$event.stopPropagation()">
|
||||
<span class="mehr-infos-label">Mehr Infos</span>
|
||||
<span class="publication-link-icon">
|
||||
<span class="material-icons">open_in_new</span>
|
||||
</span>
|
||||
</button>
|
||||
</a>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
|
||||
@@ -144,9 +144,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.position-badge--first,
|
||||
.hero-highlight--open,
|
||||
.publication-detail-grid .access-badge--open {
|
||||
.position-badge--first {
|
||||
background: #effaf3;
|
||||
border-color: #bdebcf;
|
||||
color: #24834f;
|
||||
@@ -311,281 +309,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
.funding-publication-page {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.publication-detail-back,
|
||||
.publication-more-info {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.publication-detail-back {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.publication-more-info {
|
||||
gap: 4px;
|
||||
margin-top: 6px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.publication-detail-hero {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
align-items: flex-start;
|
||||
padding: 24px;
|
||||
border: 1px solid #dbe3f2;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 16px;
|
||||
background:
|
||||
radial-gradient(
|
||||
circle at 95% 5%,
|
||||
rgba(200, 217, 255, 0.45),
|
||||
transparent 35%
|
||||
),
|
||||
linear-gradient(140deg, #fff 0%, #f8faff 100%);
|
||||
|
||||
&__content {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
&__meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
span {
|
||||
padding: 4px 10px;
|
||||
border: 1px solid #dbe3f2;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
color: #64748b;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0 0 10px;
|
||||
font-size: clamp(1.25rem, 2vw, 1.75rem);
|
||||
line-height: 1.25;
|
||||
color: #1e3a5f;
|
||||
}
|
||||
|
||||
&__source {
|
||||
margin: 0 0 8px;
|
||||
color: #334155;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
&__authors {
|
||||
margin: 0 0 16px;
|
||||
color: #64748b;
|
||||
line-height: 1.5;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
&__highlights {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&__action {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 10px 16px;
|
||||
border: 1px solid #bdd4ff;
|
||||
border-radius: 8px;
|
||||
background: #f0f6ff;
|
||||
color: #0b63ce;
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
text-decoration: none;
|
||||
|
||||
.material-icons {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hero-highlight {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #e0e6f0;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
|
||||
&__value {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: #1e3a5f;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 0.7rem;
|
||||
color: #64748b;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
&--badge {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
&--closed {
|
||||
border-color: #e0e6f0;
|
||||
background: #f8fafc;
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
|
||||
.position-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 6px 12px;
|
||||
border-radius: 999px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
|
||||
&--unknown {
|
||||
background: #f1f5f9;
|
||||
color: #64748b;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
}
|
||||
|
||||
$g: '.publication-detail-grid';
|
||||
|
||||
#{$g} {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
#{$g} .publication-detail-main,
|
||||
#{$g} .publication-detail-side {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
#{$g} .publication-detail-section {
|
||||
border: 1px solid #e0e6f0;
|
||||
border-radius: 10px;
|
||||
padding: 18px;
|
||||
background: #fff;
|
||||
|
||||
h3 {
|
||||
margin: 0 0 14px;
|
||||
font-size: 1rem;
|
||||
color: #1e3a5f;
|
||||
}
|
||||
}
|
||||
|
||||
#{$g} .publication-overview,
|
||||
#{$g} .publication-abstract {
|
||||
margin: 0;
|
||||
color: #334155;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
#{$g} .publication-detail-facts {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#{$g} .publication-detail-facts div {
|
||||
display: grid;
|
||||
grid-template-columns: 130px minmax(0, 1fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
#{$g} .publication-detail-facts dt {
|
||||
color: #64748b;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
#{$g} .publication-detail-facts dd {
|
||||
margin: 0;
|
||||
word-break: break-word;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
#{$g} .tag-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#{$g} .tag,
|
||||
#{$g} .access-badge,
|
||||
#{$g} .warning-badge {
|
||||
display: inline-flex;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
#{$g} .tag {
|
||||
background: #f0f6ff;
|
||||
border: 1px solid #dbeafe;
|
||||
color: #1e40af;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
#{$g} .access-badge {
|
||||
font-weight: 600;
|
||||
background: #f1f5f9;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
#{$g} .access-badge--closed {
|
||||
background: #f8fafc;
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
#{$g} .inline-action {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
color: #0b63ce;
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
text-decoration: none;
|
||||
|
||||
.material-icons {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
#{$g} .warning-badge {
|
||||
background: #fef2f2;
|
||||
border: 1px solid #fecaca;
|
||||
color: #b91c1c;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.publication-item {
|
||||
@@ -620,20 +353,3 @@ $g: '.publication-detail-grid';
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.publication-detail-hero {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
&__action {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
#{$g} {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
@@ -11,51 +10,23 @@ import { FundingService } from '../../api';
|
||||
type SortMode = 'name' | 'top';
|
||||
type AuthorPosition = 'first' | 'middle' | 'last' | 'unknown';
|
||||
|
||||
type CitationCountByYear = {
|
||||
year: number;
|
||||
count: number;
|
||||
};
|
||||
|
||||
type FundingPublicationDetail = {
|
||||
id: string;
|
||||
title: string;
|
||||
abstract?: string | null;
|
||||
doi?: string | null;
|
||||
publication_year?: number | null;
|
||||
publication_date?: string | null;
|
||||
publication_type?: string | null;
|
||||
language?: string | null;
|
||||
publication_url?: string | null;
|
||||
pdf_url?: string | null;
|
||||
source_name?: string | null;
|
||||
source_type?: string | null;
|
||||
is_open_access?: boolean | null;
|
||||
open_access_status?: string | null;
|
||||
has_fulltext?: boolean | null;
|
||||
license?: string | null;
|
||||
cited_by_count?: number | null;
|
||||
is_retracted?: boolean | null;
|
||||
primary_topic?: string | null;
|
||||
topic_field?: string | null;
|
||||
topic_subfield?: string | null;
|
||||
topic_domain?: string | null;
|
||||
author_position?: AuthorPosition | string | null;
|
||||
authors?: string[];
|
||||
funder_names?: string[];
|
||||
institutions?: string[];
|
||||
countries?: string[];
|
||||
topics?: string[];
|
||||
keywords?: string[];
|
||||
grant_labels?: string[];
|
||||
counts_by_year?: Array<{
|
||||
year?: number | null;
|
||||
cited_by_count?: number | null;
|
||||
}>;
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-person-funding',
|
||||
imports: [CommonModule, MatFormFieldModule, MatSelectModule, MatIconModule],
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterLink,
|
||||
MatFormFieldModule,
|
||||
MatSelectModule,
|
||||
MatIconModule,
|
||||
],
|
||||
templateUrl: './person-funding.component.html',
|
||||
styleUrl: './person-funding.component.scss',
|
||||
})
|
||||
@@ -63,15 +34,12 @@ export class PersonFundingComponent implements OnInit {
|
||||
private route = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private fundingApi = inject(FundingService);
|
||||
private sanitizer = inject(DomSanitizer);
|
||||
private initialSelectedFunderKey: string | null = null;
|
||||
private initialPublicationPage = 1;
|
||||
private initialFunderListPage = 1;
|
||||
private initialPublicationDetailId: string | null = null;
|
||||
|
||||
funders: any[] = [];
|
||||
filteredFunders: any[] = [];
|
||||
authorName: string | null = null;
|
||||
selectedFunder: any = null;
|
||||
selectedFunderListPage = 1;
|
||||
selectedPublicationPage = 1;
|
||||
@@ -82,7 +50,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
loading = true;
|
||||
error = false;
|
||||
expandedPublicationId: string | null = null;
|
||||
selectedPublicationDetailId: string | null = null;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.parent?.paramMap.subscribe((params) => {
|
||||
@@ -91,8 +58,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy');
|
||||
this.initialSelectedFunderKey =
|
||||
this.route.snapshot.queryParamMap.get('funder');
|
||||
this.initialPublicationDetailId =
|
||||
this.route.snapshot.queryParamMap.get('publicationDetail');
|
||||
this.initialPublicationPage = this.parsePageParam(
|
||||
this.route.snapshot.queryParamMap.get('publicationPage') ??
|
||||
this.route.snapshot.queryParamMap.get('page'),
|
||||
@@ -111,7 +76,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
this.fundingApi.getFundersByAuthor(authorId).subscribe({
|
||||
next: (result: any) => {
|
||||
this.funders = result.funders ?? [];
|
||||
this.authorName = result.author_name ?? null;
|
||||
this.applyFilter();
|
||||
this.selectedFunderListPage = this.clampPage(
|
||||
this.initialFunderListPage,
|
||||
@@ -132,7 +96,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
selectFunder(funder: any): void {
|
||||
this.selectedFunder = funder;
|
||||
this.selectedPublicationPage = 1;
|
||||
this.selectedPublicationDetailId = null;
|
||||
this.updateQueryParams();
|
||||
}
|
||||
|
||||
@@ -150,7 +113,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
|
||||
private applyFilter(): void {
|
||||
this.selectedFunder = null;
|
||||
this.selectedPublicationDetailId = null;
|
||||
this.selectedFunderListPage = 1;
|
||||
this.selectedPublicationPage = 1;
|
||||
let funders: any[];
|
||||
@@ -188,14 +150,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
this.initialPublicationPage,
|
||||
this.getPublicationPageCountForFunder(matchedFunder),
|
||||
);
|
||||
if (
|
||||
this.initialPublicationDetailId &&
|
||||
this.getPublicationIds(matchedFunder).includes(
|
||||
this.initialPublicationDetailId,
|
||||
)
|
||||
) {
|
||||
this.selectedPublicationDetailId = this.initialPublicationDetailId;
|
||||
}
|
||||
this.updateQueryParams();
|
||||
} else {
|
||||
this.updateQueryParams();
|
||||
@@ -214,7 +168,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
publicationPage: this.selectedFunder
|
||||
? this.selectedPublicationPage
|
||||
: null,
|
||||
publicationDetail: this.selectedPublicationDetailId,
|
||||
funderPage: this.selectedFunderListPage,
|
||||
},
|
||||
queryParamsHandling: 'merge',
|
||||
@@ -404,25 +357,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
this.expandedPublicationId = this.expandedPublicationId === id ? null : id;
|
||||
}
|
||||
|
||||
openPublicationDetail(event: MouseEvent, publicationId: string): void {
|
||||
event.stopPropagation();
|
||||
this.selectedPublicationDetailId = publicationId;
|
||||
this.expandedPublicationId = null;
|
||||
this.updateQueryParams();
|
||||
}
|
||||
|
||||
closePublicationDetail(): void {
|
||||
this.selectedPublicationDetailId = null;
|
||||
this.updateQueryParams();
|
||||
}
|
||||
|
||||
getSelectedPublicationDetail(): FundingPublicationDetail | null {
|
||||
if (!this.selectedPublicationDetailId) {
|
||||
return null;
|
||||
}
|
||||
return this.getPublicationDetail(this.selectedPublicationDetailId);
|
||||
}
|
||||
|
||||
getPublicationDetail(publicationId: string): FundingPublicationDetail | null {
|
||||
const detail = this.selectedFunder?.publication_details?.[publicationId];
|
||||
if (detail) {
|
||||
@@ -447,64 +381,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
return parts[parts.length - 1] ?? publicationId;
|
||||
}
|
||||
|
||||
getPublicationExternalUrl(
|
||||
publication: FundingPublicationDetail,
|
||||
): string | null {
|
||||
return (
|
||||
publication.publication_url ??
|
||||
this.selectedFunder?.publication_urls?.[publication.id] ??
|
||||
publication.id ??
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
getPublicationAuthors(publication: FundingPublicationDetail): string {
|
||||
return publication.authors?.length
|
||||
? publication.authors.join(', ')
|
||||
: 'Keine Angaben';
|
||||
}
|
||||
|
||||
hasPublicationSource(publication: FundingPublicationDetail): boolean {
|
||||
return !!publication.source_name;
|
||||
}
|
||||
|
||||
hasListValues(values?: string[] | null): boolean {
|
||||
return !!values?.length;
|
||||
}
|
||||
|
||||
hasTextValue(value?: string | null): boolean {
|
||||
return !!value && value !== '-' && value !== 'Keine Angaben';
|
||||
}
|
||||
|
||||
getOpenAccessBadge(publication: FundingPublicationDetail): {
|
||||
label: string;
|
||||
tone: 'open' | 'closed' | 'unknown';
|
||||
} {
|
||||
if (publication.is_open_access) {
|
||||
const statusLabels: Record<string, string> = {
|
||||
bronze: 'Bronze',
|
||||
diamond: 'Diamond',
|
||||
gold: 'Gold',
|
||||
green: 'Green',
|
||||
hybrid: 'Hybrid',
|
||||
};
|
||||
const status = publication.open_access_status
|
||||
? (statusLabels[publication.open_access_status] ??
|
||||
publication.open_access_status)
|
||||
: null;
|
||||
return {
|
||||
label: status ? `Open Access (${status})` : 'Open Access',
|
||||
tone: 'open',
|
||||
};
|
||||
}
|
||||
|
||||
if (publication.open_access_status === 'closed') {
|
||||
return { label: 'Nicht frei zugänglich', tone: 'closed' };
|
||||
}
|
||||
|
||||
return { label: 'Zugang unbekannt', tone: 'unknown' };
|
||||
}
|
||||
|
||||
getPositionBadgeClass(position?: AuthorPosition | string | null): string {
|
||||
const classes: Record<string, string> = {
|
||||
first: 'position-badge--first',
|
||||
@@ -515,218 +391,6 @@ export class PersonFundingComponent implements OnInit {
|
||||
return classes[position ?? 'unknown'] ?? classes['unknown'];
|
||||
}
|
||||
|
||||
getAuthorName(): string {
|
||||
return this.authorName ?? 'Die Person';
|
||||
}
|
||||
|
||||
getPublicationOverview(publication: FundingPublicationDetail): SafeHtml {
|
||||
const yearText = publication.publication_year
|
||||
? `aus dem Jahr ${publication.publication_year}`
|
||||
: 'ohne Jahresangabe';
|
||||
const authorText = publication.authors?.length
|
||||
? `von ${publication.authors.map((author) => this.escapeHtml(author)).join(', ')}`
|
||||
: 'ohne Autorenangabe';
|
||||
const funderText = this.selectedFunder?.funder_name
|
||||
? `Sie ist dem Förderer ${this.escapeHtml(this.selectedFunder.funder_name)} zugeordnet`
|
||||
: 'Es ist kein Förderer ausgewählt';
|
||||
const positionText = publication.author_position
|
||||
? `${this.boldAuthorName(this.getAuthorName())} ist als ${this.getPositionLabel(publication.author_position)} beteiligt`
|
||||
: 'die Autorposition ist nicht bekannt';
|
||||
const sourceText = publication.source_name
|
||||
? `Erschienen ist sie in/bei ${this.escapeHtml(publication.source_name)}.`
|
||||
: '';
|
||||
const citationText =
|
||||
typeof publication.cited_by_count === 'number'
|
||||
? `Sie wurde ${publication.cited_by_count} Mal zitiert.`
|
||||
: '';
|
||||
|
||||
const html =
|
||||
`Publikation ${yearText} ${authorText}. ${sourceText} ${funderText}; ${positionText}. ${citationText}`.trim();
|
||||
return this.sanitizer.bypassSecurityTrustHtml(html);
|
||||
}
|
||||
|
||||
private escapeHtml(value: string): string {
|
||||
return value
|
||||
.replaceAll('&', '&')
|
||||
.replaceAll('<', '<')
|
||||
.replaceAll('>', '>');
|
||||
}
|
||||
|
||||
private boldAuthorName(name: string): string {
|
||||
return `<strong>${this.escapeHtml(name)}</strong>`;
|
||||
}
|
||||
|
||||
getPublicationDateLabel(publication: FundingPublicationDetail): string {
|
||||
if (publication.publication_date) {
|
||||
const date = new Date(`${publication.publication_date}T00:00:00`);
|
||||
if (!Number.isNaN(date.getTime())) {
|
||||
return new Intl.DateTimeFormat('de-DE').format(date);
|
||||
}
|
||||
return publication.publication_date;
|
||||
}
|
||||
|
||||
return publication.publication_year
|
||||
? String(publication.publication_year)
|
||||
: '-';
|
||||
}
|
||||
|
||||
getPublicationTypeLabel(publication: FundingPublicationDetail): string {
|
||||
const labels: Record<string, string> = {
|
||||
article: 'Artikel',
|
||||
book: 'Buch',
|
||||
'book-chapter': 'Buchkapitel',
|
||||
dataset: 'Datensatz',
|
||||
dissertation: 'Dissertation',
|
||||
editorial: 'Editorial',
|
||||
letter: 'Letter',
|
||||
preprint: 'Preprint',
|
||||
'proceedings-article': 'Konferenzbeitrag',
|
||||
report: 'Bericht',
|
||||
review: 'Review',
|
||||
};
|
||||
const type = publication.publication_type;
|
||||
if (!type) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return labels[type] ?? type;
|
||||
}
|
||||
|
||||
getLanguageLabel(publication: FundingPublicationDetail): string {
|
||||
const labels: Record<string, string> = {
|
||||
de: 'Deutsch',
|
||||
en: 'Englisch',
|
||||
es: 'Spanisch',
|
||||
fr: 'Französisch',
|
||||
it: 'Italienisch',
|
||||
pt: 'Portugiesisch',
|
||||
};
|
||||
const language = publication.language;
|
||||
if (!language) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return labels[language] ?? language.toUpperCase();
|
||||
}
|
||||
|
||||
getPublicationSourceLabel(publication: FundingPublicationDetail): string {
|
||||
if (!publication.source_name) {
|
||||
return 'Keine Angaben';
|
||||
}
|
||||
|
||||
const sourceType = this.getSourceTypeLabel(publication.source_type);
|
||||
return sourceType === '-'
|
||||
? publication.source_name
|
||||
: `${publication.source_name} (${sourceType})`;
|
||||
}
|
||||
|
||||
getSourceTypeLabel(sourceType?: string | null): string {
|
||||
const labels: Record<string, string> = {
|
||||
book: 'Buch',
|
||||
conference: 'Konferenz',
|
||||
journal: 'Journal',
|
||||
repository: 'Repository',
|
||||
};
|
||||
if (!sourceType) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return labels[sourceType] ?? sourceType;
|
||||
}
|
||||
|
||||
getListLabel(values?: string[] | null): string {
|
||||
return values?.length ? values.join(', ') : 'Keine Angaben';
|
||||
}
|
||||
|
||||
getPublicationFunderLabel(publication: FundingPublicationDetail): string {
|
||||
if (publication.funder_names?.length) {
|
||||
return this.getListLabel(publication.funder_names);
|
||||
}
|
||||
|
||||
return this.selectedFunder?.funder_name ?? 'Keine Angaben';
|
||||
}
|
||||
|
||||
getCitationCountLabel(publication: FundingPublicationDetail): string {
|
||||
if (typeof publication.cited_by_count !== 'number') {
|
||||
return 'Keine Angaben';
|
||||
}
|
||||
|
||||
return publication.cited_by_count === 1
|
||||
? '1 Zitation'
|
||||
: `${publication.cited_by_count} Zitationen`;
|
||||
}
|
||||
|
||||
getCitationCountsByYear(
|
||||
publication: FundingPublicationDetail,
|
||||
): CitationCountByYear[] {
|
||||
return (publication.counts_by_year ?? [])
|
||||
.filter(
|
||||
(count) =>
|
||||
typeof count.year === 'number' &&
|
||||
typeof count.cited_by_count === 'number',
|
||||
)
|
||||
.map((count) => ({
|
||||
year: count.year as number,
|
||||
count: count.cited_by_count as number,
|
||||
}))
|
||||
.sort((first, second) => second.year - first.year);
|
||||
}
|
||||
|
||||
getOpenAccessLabel(publication: FundingPublicationDetail): string {
|
||||
const statusLabels: Record<string, string> = {
|
||||
bronze: 'Bronze',
|
||||
closed: 'geschlossen',
|
||||
diamond: 'Diamond',
|
||||
gold: 'Gold',
|
||||
green: 'Green',
|
||||
hybrid: 'Hybrid',
|
||||
};
|
||||
const status = publication.open_access_status
|
||||
? (statusLabels[publication.open_access_status] ??
|
||||
publication.open_access_status)
|
||||
: null;
|
||||
|
||||
if (publication.is_open_access) {
|
||||
return status ? `Ja (${status})` : 'Ja';
|
||||
}
|
||||
|
||||
return status === 'geschlossen' ? 'Nein' : 'Keine Angaben';
|
||||
}
|
||||
|
||||
getFulltextLabel(publication: FundingPublicationDetail): string {
|
||||
if (publication.pdf_url) {
|
||||
return 'PDF verfügbar';
|
||||
}
|
||||
if (publication.has_fulltext) {
|
||||
return 'Volltext verfügbar';
|
||||
}
|
||||
|
||||
return 'Kein Volltext hinterlegt';
|
||||
}
|
||||
|
||||
getLicenseLabel(publication: FundingPublicationDetail): string {
|
||||
return publication.license
|
||||
? publication.license.toUpperCase()
|
||||
: 'Keine Angaben';
|
||||
}
|
||||
|
||||
getRetractionLabel(publication: FundingPublicationDetail): string {
|
||||
if (publication.is_retracted === true) {
|
||||
return 'Ja, zurückgezogen';
|
||||
}
|
||||
if (publication.is_retracted === false) {
|
||||
return 'Nein, nicht zurückgezogen';
|
||||
}
|
||||
|
||||
return 'Keine Angaben';
|
||||
}
|
||||
|
||||
getGrantLabel(publication: FundingPublicationDetail): string {
|
||||
return publication.grant_labels?.length
|
||||
? publication.grant_labels.join(', ')
|
||||
: 'Kein Grant-Name hinterlegt';
|
||||
}
|
||||
|
||||
getPublicationPosition(publicationId: string): AuthorPosition {
|
||||
if (!this.selectedFunder) {
|
||||
return 'unknown';
|
||||
|
||||
Reference in New Issue
Block a user