Merge branch 'dev' into multi-organisations-statics
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good

This commit is contained in:
2026-08-18 17:47:05 +02:00
434 changed files with 27558 additions and 41209 deletions
@@ -61,7 +61,7 @@
<mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Abbrechen</button>
<button mat-flat-button color="primary" type="button" (click)="submit()">
<mat-icon>save</mat-icon>
<mat-icon>{{ SAVE_ICON }}</mat-icon>
Speichern
</button>
</mat-dialog-actions>
@@ -21,6 +21,7 @@ import {
InseAccountManagementModelOrganizationProfile,
UserRole,
} from '../../api';
import { SAVE_ICON } from '../../shared/ui/icons';
export type AccountDialogMode = 'create' | 'edit';
@@ -71,6 +72,8 @@ export type AccountDialogResult =
standalone: true,
})
export class AccountDialogComponent {
readonly SAVE_ICON = SAVE_ICON;
private readonly dialogRef =
inject<
MatDialogRef<AccountDialogComponent, AccountDialogResult | undefined>
@@ -31,7 +31,7 @@
type="button"
matTooltip="Neuen Account anlegen"
(click)="startCreate()">
<mat-icon>person_add</mat-icon>
<mat-icon>{{ PERSON_ADD_ICON }}</mat-icon>
Neuer Account
</button>
}
@@ -68,7 +68,7 @@
type="button"
aria-label="Bearbeiten"
(click)="startEdit(row)">
<mat-icon>edit</mat-icon>
<mat-icon>{{ EDIT_ICON }}</mat-icon>
</button>
<button
mat-icon-button
@@ -76,7 +76,7 @@
aria-label="Impersonate"
[disabled]="!canImpersonate(row)"
(click)="impersonate(row)">
<mat-icon>switch_account</mat-icon>
<mat-icon>{{ SWITCH_ACCOUNT_ICON }}</mat-icon>
</button>
<button
mat-icon-button
@@ -84,7 +84,9 @@
[attr.aria-label]="row.activated ? 'Deaktivieren' : 'Aktivieren'"
[disabled]="row.is_current || row.deleted"
(click)="toggleAccountActivation(row)">
<mat-icon>{{ row.activated ? 'person_off' : 'person_check' }}</mat-icon>
<mat-icon>{{
row.activated ? PERSON_OFF_ICON : PERSON_CHECK_ICON
}}</mat-icon>
</button>
<button
mat-icon-button
@@ -92,7 +94,7 @@
aria-label="Deaktivieren"
[disabled]="row.is_current || row.deleted"
(click)="deleteAccount(row)">
<mat-icon>delete</mat-icon>
<mat-icon>{{ DELETE_ICON }}</mat-icon>
</button>
</div>
</ng-template>
@@ -44,6 +44,14 @@ import {
UserRole,
} from '../../api';
import { StatusPipe } from '../../shared/pipes/status.pipe';
import {
DELETE_ICON,
EDIT_ICON,
PERSON_ADD_ICON,
PERSON_CHECK_ICON,
PERSON_OFF_ICON,
SWITCH_ACCOUNT_ICON,
} from '../../shared/ui/icons';
@Component({
selector: 'app-accounts',
@@ -71,6 +79,13 @@ import { StatusPipe } from '../../shared/pipes/status.pipe';
standalone: true,
})
export class AccountsComponent implements OnInit {
readonly PERSON_ADD_ICON = PERSON_ADD_ICON;
readonly EDIT_ICON = EDIT_ICON;
readonly SWITCH_ACCOUNT_ICON = SWITCH_ACCOUNT_ICON;
readonly PERSON_CHECK_ICON = PERSON_CHECK_ICON;
readonly PERSON_OFF_ICON = PERSON_OFF_ICON;
readonly DELETE_ICON = DELETE_ICON;
protected readonly credentialService = inject(CredentialService);
private readonly snackBar = inject(MatSnackBar);
private readonly router = inject(Router);
@@ -58,7 +58,7 @@
"
(click)="showPassword = !showPassword">
<mat-icon>{{
showPassword ? 'visibility' : 'visibility_off'
showPassword ? VISIBILITY_ICON : VISIBILITY_OFF_ICON
}}</mat-icon>
</button>
@if (credentialsForm.controls.password.hasError('required')) {
@@ -91,7 +91,7 @@
} @else {
<form class="login-form" [formGroup]="otkForm" (ngSubmit)="login()">
<div class="code-intro">
<mat-icon>mark_email_unread</mat-icon>
<mat-icon>{{ EMAIL_UNREAD_ICON }}</mat-icon>
<div>
<strong>Code eingeben</strong>
<span>
@@ -123,7 +123,7 @@
class="expiry"
[class.expiry--expired]="codeExpiresIn === 0"
aria-live="polite">
<mat-icon>timer</mat-icon>
<mat-icon>{{ TIMER_ICON }}</mat-icon>
@if (codeExpiresIn > 0) {
<span>Code läuft in {{ formatCountdown() }} ab.</span>
} @else {
@@ -15,6 +15,12 @@ import { finalize, Subscription } from 'rxjs';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import { Router, RouterLink } from '@angular/router';
import { HttpErrorResponse } from '@angular/common/http';
import {
EMAIL_UNREAD_ICON,
TIMER_ICON,
VISIBILITY_ICON,
VISIBILITY_OFF_ICON,
} from '../../shared/ui/icons';
type LoginStep = 'credentials' | 'otk';
@@ -35,6 +41,11 @@ type LoginStep = 'credentials' | 'otk';
standalone: true,
})
export class AppLoginComponent implements OnDestroy {
readonly EMAIL_UNREAD_ICON = EMAIL_UNREAD_ICON;
readonly TIMER_ICON = TIMER_ICON;
readonly VISIBILITY_ICON = VISIBILITY_ICON;
readonly VISIBILITY_OFF_ICON = VISIBILITY_OFF_ICON;
credentialsForm = new FormGroup({
email: new FormControl<string>('', [Validators.required, Validators.email]),
password: new FormControl<string>('', [
@@ -6,7 +6,7 @@
<p>Gespeicherte Personen für den schnellen Zugriff.</p>
</div>
<div class="bookmark-count">
<mat-icon>bookmarks</mat-icon>
<mat-icon>{{ BOOKMARKS_ICON }}</mat-icon>
<strong>{{ persons().length }}</strong>
<span>Personen</span>
</div>
@@ -15,7 +15,7 @@
@if (loading()) {
<app-loading
text="Bookmarks werden geladen …"
icon="bookmarks"
[icon]="BOOKMARKS_ICON"
[size]="60"
[diameter]="60" />
} @else if (persons().length) {
@@ -30,7 +30,7 @@
</section>
} @else {
<section class="empty-state">
<mat-icon>bookmark_border</mat-icon>
<mat-icon>{{ BOOKMARK_BORDER_ICON }}</mat-icon>
<h2>Noch keine Bookmarks</h2>
<p>
Speichere Personen über das Bookmark-Symbol auf einer Personenkarte.
@@ -8,6 +8,7 @@ import { CustomAuthor, PersonsService } from '../../api';
import { BookmarkService } from '../../shared/services/bookmark.service';
import { PersonCardComponent } from '../person-card/person-card.component';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { BOOKMARKS_ICON, BOOKMARK_BORDER_ICON } from '../../shared/ui/icons';
const PERSON_INCLUDE_TAGS =
'display_name,works_count,cited_by_count,summary_stats,ids,' +
@@ -22,6 +23,9 @@ const PERSON_INCLUDE_TAGS =
styleUrl: './bookmarks.component.scss',
})
export class BookmarksComponent {
readonly BOOKMARKS_ICON = BOOKMARKS_ICON;
readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON;
readonly bookmarkService = inject(BookmarkService);
private readonly personsService = inject(PersonsService);
private readonly destroyRef = inject(DestroyRef);
@@ -25,4 +25,4 @@ mat-card > mat-card-content {
touch-action: none;
user-select: none;
cursor: grab;
}
}
@@ -1,7 +1,7 @@
@if (visible()) {
<mat-card appearance="outlined" class="research-profile-card">
<mat-card-header class="profile-header">
<mat-icon class="profile-icon">science</mat-icon>
<mat-icon class="profile-icon">{{ SCIENCE_ICON }}</mat-icon>
<div class="profile-heading">
<mat-card-title>Forschungsprofil</mat-card-title>
<mat-card-subtitle>
@@ -11,6 +11,7 @@ import {
AuthorCategoryPieComponent,
buildAuthorCategoryLegend,
} from './author-category-pie.component';
import { SCIENCE_ICON } from '../../../shared/ui/icons';
export interface ResearchProfileAuthor {
authorId: string;
@@ -36,6 +37,8 @@ interface AuthorOrientationView {
styleUrl: './author-research-profile.component.scss',
})
export class AuthorResearchProfileComponent {
readonly SCIENCE_ICON = SCIENCE_ICON;
private readonly chartTheme = inject(ChartThemeService);
authors = input.required<ResearchProfileAuthor[]>();
@@ -81,8 +84,7 @@ export class AuthorResearchProfileComponent {
return 'Forschungsprofil nicht verfügbar';
}
if (
profile.status ===
AuthorOrientationProfileStatus.NoClassifiedPublications
profile.status === AuthorOrientationProfileStatus.NoClassifiedPublications
) {
return 'Keine klassifizierten Publikationen';
}
@@ -4,31 +4,52 @@
<div class="compare-meta">
@if (keywords().length > 0) {
<span class="meta-chip">
<mat-icon>topic</mat-icon>
{{ keywords().join(', ') }}
</span>
<div class="meta-row">
<span class="meta-label">Betrachtete Themen:</span>
<div class="meta-chip-group">
@for (keyword of keywords(); track keyword) {
<app-topic-chip
[label]="keyword"
[color]="keywordColor(keyword)" />
}
</div>
<span class="meta-operator"
>Verknüpfungsoperator: {{ operatorLabel() }}</span
>
</div>
}
@if (timespan(); as span) {
<span class="meta-chip">
<mat-icon>date_range</mat-icon>
{{ span.from }}–{{ span.to }}
</span>
<div class="meta-row">
<span class="meta-label">Betrachteter Zeitraum:</span>
<app-chip color="secondary">
<mat-icon>{{ DATE_RANGE_ICON }}</mat-icon>
{{ span.from }}–{{ span.to }}
</app-chip>
</div>
}
@if (hasData()) {
<div class="meta-row">
<span class="meta-label">Betrachtete Personen:</span>
<div class="meta-chip-group">
@for (author of summary(); track author.authorId) {
<app-chip [color]="author.color">
<a
class="chip-link"
[routerLink]="[
'/person',
authorProfileId(author.authorId),
'overview',
]"
title="Zur Autor:innen-Seite">
{{ author.name }}
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</app-chip>
}
</div>
</div>
}
</div>
@if (hasData()) {
<ul class="author-legend">
@for (author of summary(); track author.authorId) {
<li class="legend-item">
<span
class="legend-swatch"
[style.background]="author.color"></span>
<span class="legend-name">{{ author.name }}</span>
</li>
}
</ul>
}
</header>
@if (loading()) {
@@ -38,10 +59,13 @@
} @else {
<!-- section 1: stats over the topic-filtered works -->
<section class="card">
<h2 class="card-title">Kennzahlen zu den Keywords</h2>
<h2 class="card-title">
Kennzahlen der Publikationen zu den ausgewählten Themen
</h2>
<p class="card-sub">
Bester Wert je Zeile ist hervorgehoben. „–“ bedeutet, dass der Wert für
diese:n Autor:in nicht vorliegt.
Berücksichtigt werden ausschließlich Publikationen zu den ausgewählten
Themen im betrachteten Zeitraum. Bester Wert je Zeile ist hervorgehoben.
„–" bedeutet, dass der Wert für diese:n Autor:in nicht vorliegt.
</p>
<ng-container
[ngTemplateOutlet]="statsTable"
@@ -51,7 +75,9 @@
<!-- section 2: author-level stats, independent of the keywords and time -->
<section class="card">
<h2 class="card-title">Kennzahlen zur Person</h2>
<p class="card-sub">Unabhängig von den Keywords und Zeitraum.</p>
<p class="card-sub">
Unabhängig von den ausgewählten Themen und vom Zeitraum.
</p>
<ng-container
[ngTemplateOutlet]="statsTable"
[ngTemplateOutletContext]="{ rows: staticRows() }" />
@@ -60,15 +86,17 @@
<!-- section 3: topic profile over ALL works of each author -->
<section class="card">
<h2 class="card-title">Themenprofil</h2>
<p class="card-sub">"Topic-Analyse"</p>
<p class="card-sub">
Verteilung und Breite der Themen über alle Publikationen
</p>
@if (profileLoading()) {
<p class="compare-hint">Lädt…</p>
} @else if (orderedProfiles().length > 0) {
<h3 class="chart-title">Themenverteilung nach Subfield</h3>
<p class="chart-hint">
Von allen Arbeiten der Autor:innen im Zeitraum: der Anteil je
Subfield, bestimmt über das Primärthema jeder Arbeit. (Top 5)
Anteil je Subfield an allen Publikationen im Zeitraum, bestimmt über
das Primärthema. (Top 5)
</p>
<div
echarts
@@ -79,20 +107,50 @@
<div class="chart-box">
<h3 class="chart-title">Themen-Fokus</h3>
<p class="chart-hint">
Anzahl der Werke zum Suchthema im Verhältnis zum Gesamtwerk – und
wie viele davon das Suchthema als Primärthema tragen.
Publikationen zum Suchthema im Verhältnis zu allen Publikationen –
und wie viele es als Primärthema tragen
</p>
<div echarts [options]="focusChart()" class="profile-chart"></div>
</div>
<div class="chart-box">
<h3 class="chart-title">Themenbreite</h3>
<p class="chart-hint">
Einzigartige Primärthemen, Subfields und Fields im Gesamtwerk
(Primary Topic)
Einzigartige Primärthemen, Subfields und Fields über alle
Publikationen (Primärthema)
</p>
<div echarts [options]="breadthChart()" class="profile-chart"></div>
</div>
</div>
<h3 class="chart-title">Themenlandschaft</h3>
<p class="chart-hint">Field → Subfield → Thema</p>
<div class="treemap-author-tabs" role="tablist" aria-label="Autor:in">
@for (
author of orderedProfiles();
track author.author_id;
let i = $index
) {
<button
type="button"
role="tab"
class="treemap-author-tab"
[class.active]="treemapProfile()?.author_id === author.author_id"
[attr.aria-selected]="
treemapProfile()?.author_id === author.author_id
"
[style.--tab-color]="authorColor(author.author_id)"
(click)="selectTreemapAuthor(i)">
<app-chip [color]="authorColor(author.author_id)">
{{ author.display_name }}
</app-chip>
</button>
}
</div>
<app-topic-treemap
[data]="treemapData()"
[selectedNodeId]="treemapNodeId()"
(selectedNodeIdChange)="treemapNodeId.set($event)"
countLabel="Werke"></app-topic-treemap>
} @else {
<p class="compare-hint">Keine Daten für das Themenprofil.</p>
}
@@ -113,12 +171,19 @@
<th class="metric-col">Kennzahl</th>
@for (author of summary(); track author.authorId) {
<th class="author-col">
<span class="th-name">
<span
class="legend-swatch"
[style.background]="author.color"></span>
{{ author.name }}
</span>
<app-chip [color]="author.color">
<a
class="chip-link"
[routerLink]="[
'/person',
authorProfileId(author.authorId),
'overview',
]"
title="Zur Autor:innen-Seite">
{{ author.name }}
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</app-chip>
</th>
}
</tr>
@@ -127,7 +192,16 @@
@for (row of rows; track row.label) {
<tr>
<th scope="row" class="metric-col">
<span class="metric-label">{{ row.label }}</span>
<span class="metric-label">
{{ row.label }}
@if (row.nameMatched) {
<mat-icon
class="icon-small name-match-star"
aria-hidden="true">
{{ STAR_ICON }}
</mat-icon>
}
</span>
<span class="metric-hint">{{ row.hint }}</span>
@if (row.kind === 'group') {
<span class="position-legend">
@@ -181,4 +255,12 @@
</tbody>
</table>
</div>
@if (hasNameMatchedRow(rows)) {
<p class="name-match-note">
<mat-icon class="icon-small">{{ STAR_ICON }}</mat-icon>
Diese Kennzahlen basieren auf einem automatischen Namensabgleich mit
externen Quellen, wodurch es in Einzelfällen zu Fehlzuordnungen kommen
kann.
</p>
}
</ng-template>
@@ -24,52 +24,62 @@
.compare-meta {
display: flex;
flex-direction: column;
gap: 8px;
}
.meta-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.meta-chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 12px;
border-radius: 999px;
background: var(--sg-surface-muted);
border: 1px solid var(--sg-border);
color: var(--sg-text-muted);
.meta-label {
font-size: 13px;
mat-icon {
font-size: 16px;
width: 16px;
height: 16px;
color: var(--sg-text-soft);
}
font-weight: 600;
color: var(--sg-text-muted, #64708f);
}
.author-legend {
list-style: none;
margin: 0;
padding: 0;
.meta-operator {
font-size: 13px;
font-weight: 600;
color: var(--sg-text-muted, #64708f);
}
.meta-chip-group {
display: flex;
flex-wrap: wrap;
gap: 8px 18px;
gap: 8px;
}
.legend-item {
app-chip mat-icon {
font-size: 16px;
width: 16px;
height: 16px;
vertical-align: text-bottom;
}
.chip-link {
display: inline-flex;
align-items: center;
gap: 8px;
font-size: 14px;
font-weight: 600;
color: var(--sg-text);
}
gap: 4px;
margin: -4px -12px;
padding: 4px 12px;
color: inherit;
text-decoration: none;
cursor: pointer;
.legend-swatch {
width: 12px;
height: 12px;
border-radius: 3px;
flex: 0 0 auto;
mat-icon {
font-size: 14px;
width: 14px;
height: 14px;
opacity: 0.7;
}
&:hover mat-icon {
opacity: 1;
}
}
/* ---- cards ---- */
@@ -112,24 +122,12 @@
font-size: 14px;
thead th {
text-align: left;
text-align: center;
padding: 0 16px 10px;
border-bottom: 2px solid var(--sg-border);
vertical-align: bottom;
}
.author-col {
text-align: right;
}
.th-name {
display: inline-flex;
align-items: center;
gap: 8px;
font-weight: 700;
color: var(--sg-text);
}
tbody tr + tr th,
tbody tr + tr td {
border-top: 1px solid var(--sg-border);
@@ -146,7 +144,10 @@
}
.metric-label {
display: block;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
font-weight: 600;
color: var(--sg-text);
}
@@ -159,8 +160,33 @@
color: var(--sg-text-soft);
}
.icon-small {
font-size: 14px;
width: 14px;
height: 14px;
vertical-align: text-bottom;
}
.name-match-star {
color: var(--sg-warning, #b8860b);
}
.name-match-note {
display: flex;
align-items: center;
gap: 6px;
margin: 10px 0 0;
font-size: 12px;
color: var(--sg-text-muted);
mat-icon {
flex: 0 0 auto;
color: var(--sg-warning, #b8860b);
}
}
.value-cell {
text-align: right;
text-align: center;
font-variant-numeric: tabular-nums;
color: var(--sg-text);
white-space: nowrap;
@@ -262,6 +288,35 @@
height: 320px;
}
.treemap-author-tabs {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin: 4px 0 10px;
}
.treemap-author-tab {
display: inline-flex;
border: 0;
padding: 0;
border-radius: 7px;
background: transparent;
cursor: pointer;
transition:
transform 0.15s ease,
box-shadow 0.15s ease;
&:hover {
transform: translateY(-1px);
}
&.active {
box-shadow:
0 0 0 2px #ffffff,
0 0 0 4px var(--tab-color, var(--sg-primary, #2563eb));
}
}
.chart-grid {
display: grid;
grid-template-columns: 1fr 1fr;
@@ -1,6 +1,6 @@
import { Component, OnInit, computed, inject, signal } from '@angular/core';
import { DecimalPipe, NgTemplateOutlet } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { MatIconModule } from '@angular/material/icon';
import { EChartsOption } from 'echarts';
import { NgxEchartsDirective } from 'ngx-echarts';
@@ -14,12 +14,26 @@ import {
PublicationType,
RankingService,
SelectedAuthorsRequest,
Topic,
TopicsService,
} from '../../api';
import {
AuthorResearchProfileComponent,
ResearchProfileAuthor,
} from './author-research-profile/author-research-profile.component';
import {
TopicTreemapComponent,
TopicTreemapData,
} from '../../shared/ui/topic-treemap/topic-treemap.component';
import { ChipComponent } from '../../shared/ui/chip/chip.component';
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
import { ChartThemeService } from '../../shared/services/chart-theme.service';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import {
DATE_RANGE_ICON,
OPEN_IN_NEW_ICON,
STAR_ICON,
} from '../../shared/ui/icons';
import {
AUTHOR_COLORS,
OTHER_COLOR,
@@ -89,6 +103,7 @@ interface MetricRow {
cells: MetricCell[];
segments: GroupSegment[];
groupCells: GroupCell[];
nameMatched: boolean;
}
interface RowDef {
@@ -96,6 +111,7 @@ interface RowDef {
hint: string;
select: (a: AuthorSummary) => number | null;
decimals?: boolean;
nameMatched?: boolean;
}
interface SegmentDef {
@@ -112,19 +128,56 @@ interface SegmentDef {
imports: [
DecimalPipe,
NgTemplateOutlet,
RouterLink,
MatIconModule,
NgxEchartsDirective,
AuthorResearchProfileComponent,
TopicTreemapComponent,
ChipComponent,
TopicChipComponent,
],
templateUrl: './compare-authors.component.html',
styleUrl: './compare-authors.component.scss',
})
export class CompareAuthorsComponent implements OnInit {
readonly DATE_RANGE_ICON = DATE_RANGE_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly STAR_ICON = STAR_ICON;
private readonly route = inject(ActivatedRoute);
private readonly rankingService = inject(RankingService);
private readonly topicsService = inject(TopicsService);
private readonly chartTheme = inject(ChartThemeService);
readonly keywords = signal<string[]>([]);
readonly operator = signal<'and' | 'or'>('or');
readonly operatorLabel = computed(() =>
this.operator() === 'and' ? 'UND' : 'ODER',
);
// resolved OpenAlex topic (field/domain) per keyword for colour matching
private readonly keywordTopics = signal<Record<string, Topic>>({});
keywordColor(keyword: string): string {
const topic = this.keywordTopics()[this.normalizeKeyword(keyword)];
return topicHierarchyColor(
topic
? {
id: topic.id,
name: topic.display_name,
field_id: topic.field?.id,
field_name: topic.field?.display_name,
domain_id: topic.domain?.id,
domain_name: topic.domain?.display_name,
}
: { name: keyword },
);
}
private normalizeKeyword(keyword: string): string {
return keyword.trim().toLowerCase();
}
readonly timespan = signal<{ from: number; to: number } | null>(null);
// full OpenAlex ids in the requested order — the source of truth for colour + order
readonly authorIds = signal<string[]>([]);
@@ -344,15 +397,18 @@ export class CompareAuthorsComponent implements OnInit {
label: 'Unternehmensgründungen',
hint: 'Handelsregister-Verbindungen über den Namen',
select: (a) => a.companies,
nameMatched: true,
},
{
label: 'News-Artikel',
hint: 'Nachrichtenartikel, die die Person namentlich nennen',
select: (a) => a.news,
nameMatched: true,
},
{
label: 'Patente',
hint: 'Der Person zugeordnete Patente',
nameMatched: true,
select: (a) => a.patents,
},
]),
@@ -374,6 +430,65 @@ export class CompareAuthorsComponent implements OnInit {
}));
});
// treemap (section 3): one author's full topic hierarchy, switchable via tabs
readonly selectedTreemapAuthor = signal(0);
// drill-down state of the treemap for the selected author
readonly treemapNodeId = signal<string | undefined>(undefined);
readonly treemapProfile = computed<AuthorTopicProfile | null>(() => {
const profiles = this.orderedProfiles();
if (profiles.length === 0) return null;
const index = Math.min(this.selectedTreemapAuthor(), profiles.length - 1);
return profiles[index];
});
// maps the selected author's field_tree onto the shared treemap data model
readonly treemapData = computed<TopicTreemapData | undefined>(() => {
const profile = this.treemapProfile();
if (!profile) return undefined;
return {
institution_id: profile.author_id,
organization_name: profile.display_name,
years: [],
fields: (profile.field_tree ?? []).map((field) => ({
id: field.id,
name: field.name,
total: field.count,
values: [],
subfields: (field.subfields ?? []).map((subfield) => ({
id: subfield.id,
name: subfield.name,
total: subfield.count,
values: [],
topics: (subfield.topics ?? []).map((topic) => ({
id: topic.id,
name: topic.name,
total: topic.count,
values: [],
})),
})),
})),
};
});
selectTreemapAuthor(index: number): void {
this.selectedTreemapAuthor.set(index);
// reset the drill-down when switching author
this.treemapNodeId.set(undefined);
}
authorColor(authorId: string): string {
return (
this.summary().find((a) => a.authorId === authorId)?.color ?? OTHER_COLOR
);
}
authorProfileId(authorId: string): string {
const parts = authorId.split('/');
return parts[parts.length - 1];
}
// colours the author names on the chart axes like the legend chips
private authorAxisLabel(profiles: AuthorTopicProfile[]) {
const rich: Record<string, { color: string; fontWeight: number }> = {};
@@ -612,6 +727,7 @@ export class CompareAuthorsComponent implements OnInit {
})),
segments: [],
groupCells: [],
nameMatched: def.nameMatched ?? false,
};
});
}
@@ -636,9 +752,14 @@ export class CompareAuthorsComponent implements OnInit {
groupCells: this.summary().map((a) => ({
values: segs.map((s) => s.select(a)),
})),
nameMatched: false,
};
}
hasNameMatchedRow(rows: MetricRow[]): boolean {
return rows.some((row) => row.nameMatched);
}
ngOnInit(): void {
// everything is read from the URL so a shared link lands on the same view
const rawAuthors = this.route.snapshot.queryParamMap.get('authors') ?? '';
@@ -651,12 +772,14 @@ export class CompareAuthorsComponent implements OnInit {
const authorIds = this.parseList(rawAuthors);
const keywords = this.parseList(rawKeywords);
this.keywords.set(keywords);
this.resolveKeywordColors(keywords);
if (authorIds.length === 0 || keywords.length === 0) {
return;
}
const operator = rawOperator === 'and' ? 'and' : 'or';
this.operator.set(operator);
const publication_types = rawPubType
? this.parseList(rawPubType)
.map((s) => this.getPublicationType(s))
@@ -743,6 +866,25 @@ export class CompareAuthorsComponent implements OnInit {
}
}
private resolveKeywordColors(keywords: string[]): void {
if (keywords.length === 0) return;
this.topicsService.vectorSearchTopicsBatch({ keywords }).subscribe({
next: ({ results }) => {
const topics: Record<string, Topic> = {};
for (const result of results) {
if (result.topic) {
topics[this.normalizeKeyword(result.keyword)] = result.topic;
}
}
this.keywordTopics.set(topics);
},
error: (error) => {
console.error('Error resolving keyword topics:', error);
},
});
}
private parseList(raw: string): string[] {
return raw
.split(',')
@@ -63,7 +63,7 @@
matTooltip="Anzahl der Publikationen im ausgewählten Zeitraum"
matTooltipPosition="above">
<div class="statistics-icon statistics-icon--publications">
<mat-icon>menu_book</mat-icon>
<mat-icon>{{ MENU_BOOK_ICON }}</mat-icon>
</div>
<div>
<span>Publikationen</span>
@@ -85,7 +85,7 @@
matTooltip="Anzahl der Personen im ausgewählten Zeitraum"
matTooltipPosition="above">
<div class="statistics-icon statistics-icon--persons">
<mat-icon>groups</mat-icon>
<mat-icon>{{ GROUPS_ICON }}</mat-icon>
</div>
<div>
<span>Personen</span>
@@ -130,7 +130,7 @@
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden EU-Projekte im ausgewählten Zeitraum"
matTooltipPosition="above">
<div class="statistics-icon statistics-icon--eu-projects">
<mat-icon>public</mat-icon>
<mat-icon>{{ PUBLIC_ICON }}</mat-icon>
</div>
<div>
<span>EU-Projekte</span>
@@ -152,7 +152,7 @@
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden Bund-Projekte im ausgewählten Zeitraum"
matTooltipPosition="above">
<div class="statistics-icon statistics-icon--bund-projects">
<mat-icon>account_balance</mat-icon>
<mat-icon>{{ ACCOUNT_BALANCE_ICON }}</mat-icon>
</div>
<div>
<span>Bund-Projekte</span>
@@ -174,7 +174,7 @@
matTooltip="Anzahl der laufenden, abgeschlossenen und kommenden DFG-Projekte im ausgewählten Zeitraum"
matTooltipPosition="above">
<div class="statistics-icon statistics-icon--dfg-projects">
<mat-icon>science</mat-icon>
<mat-icon>{{ SCIENCE_ICON }}</mat-icon>
</div>
<div>
<span>DFG-Projekte</span>
@@ -299,7 +299,7 @@
<div class="project-status-loading" role="status" aria-live="polite">
<app-loading
text="Projektstatus wird geladen …"
icon="stacked_bar_chart"
[icon]="STACKED_BAR_CHART_ICON"
size="64"
diameter="64"></app-loading>
</div>
@@ -347,7 +347,7 @@
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="Treemap-Daten für den gewählten Zeitraum werden geladen …"
icon="account_tree"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
@@ -372,8 +372,8 @@
<div>
<h2>DFG-Projekt-Topics</h2>
<p>
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
Gematchte DFG-Projekte nach Field, Subfield und Topic. Ein Klick auf
ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (dfgProjectTopics) {
@@ -388,7 +388,7 @@
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="DFG-Topics werden geladen …"
icon="account_tree"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
@@ -415,8 +415,8 @@
<div>
<h2>EU-Projekt-Topics</h2>
<p>
Gematchte EU-Projekte nach Field, Subfield und Topic. Ein Klick
auf ein Topic zeigt die zugehörigen Keywords.
Gematchte EU-Projekte nach Field, Subfield und Topic. Ein Klick auf
ein Topic zeigt die zugehörigen Keywords.
</p>
</div>
@if (euProjectTopics) {
@@ -431,7 +431,7 @@
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="EU-Topics werden geladen …"
icon="account_tree"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
@@ -474,7 +474,7 @@
<div class="topic-heatmap-loading" role="status" aria-live="polite">
<app-loading
text="BUND-Topics werden geladen …"
icon="account_tree"
[icon]="ACCOUNT_TREE_ICON"
size="72"
diameter="72"></app-loading>
</div>
@@ -535,6 +535,7 @@
[queryParams]="authorQueryParams(dataset, entry)"
[appComponentTooltip]="AuthorTooltipComponent"
[tooltipInputs]="{ authorId: entry.id }"
[tooltipMaxWidth]="'500px'"
[title]="authorDisplayName(dataset, entry)">
{{ authorDisplayName(dataset, entry) }}
</a>
@@ -16,7 +16,18 @@ import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component';
import { PATENT_ICON } from '../../shared/ui/icons';
import {
ACCOUNT_BALANCE_ICON,
ACCOUNT_TREE_ICON,
ARTICLE_ICON,
DESCRIPTION_ICON,
GROUPS_ICON,
MENU_BOOK_ICON,
PATENT_ICON,
PUBLIC_ICON,
SCIENCE_ICON,
STACKED_BAR_CHART_ICON,
} from '../../shared/ui/icons';
import { EuProjectStatusChartComponent } from './eu-project-status-chart/eu-project-status-chart.component';
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
@@ -91,6 +102,14 @@ export class DashboardComponent implements OnInit, AfterViewInit {
readonly AuthorTooltipComponent = AppAuthorTooltipComponent;
readonly patentIcon = PATENT_ICON;
readonly MENU_BOOK_ICON = MENU_BOOK_ICON;
readonly GROUPS_ICON = GROUPS_ICON;
readonly PUBLIC_ICON = PUBLIC_ICON;
readonly ACCOUNT_BALANCE_ICON = ACCOUNT_BALANCE_ICON;
readonly SCIENCE_ICON = SCIENCE_ICON;
readonly STACKED_BAR_CHART_ICON = STACKED_BAR_CHART_ICON;
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
statistics?: Partial<DashboardStatistics>;
statisticsLoading = false;
statisticsError = false;
@@ -255,26 +274,30 @@ export class DashboardComponent implements OnInit, AfterViewInit {
return [
{
title: 'Publikationen',
icon: 'menu_book',
icon: MENU_BOOK_ICON,
entries: this.topAuthors?.works ?? [],
},
{
title: 'EU-Projekte',
icon: 'public',
icon: PUBLIC_ICON,
entries: this.topAuthors?.eu_projects ?? [],
},
{
title: 'Patente',
icon: 'description',
icon: DESCRIPTION_ICON,
entries: this.topAuthors?.patents ?? [],
},
{
title: 'DFG Projekte',
icon: 'account_tree',
icon: ACCOUNT_TREE_ICON,
entries: this.topAuthors?.projects ?? [],
stripAuthorTitle: true,
},
{ title: 'News', icon: 'article', entries: this.topAuthors?.news ?? [] },
{
title: 'News',
icon: ARTICLE_ICON,
entries: this.topAuthors?.news ?? [],
},
];
}
@@ -332,10 +355,7 @@ export class DashboardComponent implements OnInit, AfterViewInit {
name: subfieldName,
total:
group.topics[0]?.subfield_project_count ??
group.topics.reduce(
(sum, topic) => sum + topic.project_count,
0,
),
group.topics.reduce((sum, topic) => sum + topic.project_count, 0),
values: [],
topics: group.topics.map((topic) => ({
id: topic.id,
@@ -350,10 +370,7 @@ export class DashboardComponent implements OnInit, AfterViewInit {
name: fieldName,
total:
[...subfields.values()][0]?.topics[0]?.field_project_count ??
mappedSubfields.reduce(
(sum, subfield) => sum + subfield.total,
0,
),
mappedSubfields.reduce((sum, subfield) => sum + subfield.total, 0),
values: [],
subfields: mappedSubfields,
};
@@ -641,8 +658,7 @@ export class DashboardComponent implements OnInit, AfterViewInit {
this.selectedTopicTreemapNode = params.get('treemapNode') ?? undefined;
this.selectedDfgTopicTreemapNode =
params.get('dfgTreemapNode') ?? undefined;
this.selectedEuTopicTreemapNode =
params.get('euTreemapNode') ?? undefined;
this.selectedEuTopicTreemapNode = params.get('euTreemapNode') ?? undefined;
this.selectedBundTopicTreemapNode =
params.get('bundTreemapNode') ?? undefined;
}
@@ -22,7 +22,7 @@
type="button"
aria-label="Dialog schließen"
mat-dialog-close>
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
</div>
@@ -32,7 +32,7 @@
<span
class="topic-context-icon topic-context-icon--field"
aria-hidden="true">
<mat-icon>category</mat-icon>
<mat-icon>{{ CATEGORY_ICON }}</mat-icon>
</span>
<span class="topic-context-copy">
<span class="topic-context-label">Field</span>
@@ -41,14 +41,14 @@
}}</strong>
</span>
</div>
<mat-icon class="topic-context-arrow" aria-hidden="true"
>chevron_right</mat-icon
>
<mat-icon class="topic-context-arrow" aria-hidden="true">{{
CHEVRON_RIGHT_ICON
}}</mat-icon>
<div class="topic-context-item">
<span
class="topic-context-icon topic-context-icon--subfield"
aria-hidden="true">
<mat-icon>account_tree</mat-icon>
<mat-icon>{{ ACCOUNT_TREE_ICON }}</mat-icon>
</span>
<span class="topic-context-copy">
<span class="topic-context-label">Subfield</span>
@@ -57,14 +57,14 @@
}}</strong>
</span>
</div>
<mat-icon class="topic-context-arrow" aria-hidden="true"
>chevron_right</mat-icon
>
<mat-icon class="topic-context-arrow" aria-hidden="true">{{
CHEVRON_RIGHT_ICON
}}</mat-icon>
<div class="topic-context-item topic-context-item--topic">
<span
class="topic-context-icon topic-context-icon--topic"
aria-hidden="true">
<mat-icon>label</mat-icon>
<mat-icon>{{ LABEL_ICON }}</mat-icon>
</span>
<span class="topic-context-copy">
<span class="topic-context-label">Topic</span>
@@ -90,7 +90,7 @@
@if (loading) {
<div class="word-cloud-state">
<span class="state-icon state-icon--loading" aria-hidden="true">
<mat-icon>hourglass_top</mat-icon>
<mat-icon>{{ HOURGLASS_ICON }}</mat-icon>
</span>
<strong>Wordcloud wird erstellt</strong>
<span>Die wichtigsten Keywords werden geladen …</span>
@@ -98,7 +98,7 @@
} @else if (loadFailed) {
<div class="word-cloud-state word-cloud-state--error">
<span class="state-icon" aria-hidden="true"
><mat-icon>cloud_off</mat-icon></span
><mat-icon>{{ CLOUD_OFF_ICON }}</mat-icon></span
>
<strong>Wordcloud nicht verfügbar</strong>
<span>Die Keywords konnten nicht geladen werden.</span>
@@ -106,7 +106,7 @@
} @else if (words.length) {
<div class="keyword-toolbar" aria-label="Ausgewählte Keywords">
<div class="keyword-toolbar-label">
<mat-icon aria-hidden="true">tune</mat-icon>
<mat-icon aria-hidden="true">{{ TUNE_ICON }}</mat-icon>
<span>
<strong>Keyword-Auswahl</strong>
<small
@@ -124,7 +124,7 @@
[attr.aria-label]="word.name + ' aus Auswahl entfernen'"
(click)="toggleWord(word)">
{{ word.name }}
<mat-icon aria-hidden="true">close</mat-icon>
<mat-icon aria-hidden="true">{{ CLOSE_ICON }}</mat-icon>
</button>
} @empty {
<span class="keyword-selection-empty">Noch nichts ausgewählt</span>
@@ -157,7 +157,7 @@
? $event.preventDefault()
: closeForSearchNavigation()
">
<mat-icon aria-hidden="true">manage_search</mat-icon>
<mat-icon aria-hidden="true">{{ MANAGE_SEARCH_ICON }}</mat-icon>
Suche in Keywords
</a>
<a
@@ -178,7 +178,7 @@
? $event.preventDefault()
: closeForSearchNavigation()
">
<mat-icon aria-hidden="true">search</mat-icon>
<mat-icon aria-hidden="true">{{ SEARCH_ICON }}</mat-icon>
Suche in Themen
</a>
</div>
@@ -208,7 +208,7 @@
} @else {
<div class="word-cloud-state">
<span class="state-icon" aria-hidden="true"
><mat-icon>search_off</mat-icon></span
><mat-icon>{{ SEARCH_OFF_ICON }}</mat-icon></span
>
<strong>Keine Keywords gefunden</strong>
<span
@@ -14,6 +14,19 @@ import {
DashboardStatisticsService,
TopicWordCloudWord,
} from '../dashboard-statistics.service';
import {
ACCOUNT_TREE_ICON,
CATEGORY_ICON,
CHEVRON_RIGHT_ICON,
CLOSE_ICON,
CLOUD_OFF_ICON,
HOURGLASS_ICON,
LABEL_ICON,
MANAGE_SEARCH_ICON,
SEARCH_ICON,
SEARCH_OFF_ICON,
TUNE_ICON,
} from '../../../shared/ui/icons';
export interface TopicWordCloudDialogData {
topicId: string;
@@ -47,6 +60,18 @@ interface DisplayWord extends TopicWordCloudWord {
styleUrl: './topic-wordcloud-dialog.component.scss',
})
export class TopicWordCloudDialogComponent {
readonly CLOSE_ICON = CLOSE_ICON;
readonly CATEGORY_ICON = CATEGORY_ICON;
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
readonly LABEL_ICON = LABEL_ICON;
readonly HOURGLASS_ICON = HOURGLASS_ICON;
readonly CLOUD_OFF_ICON = CLOUD_OFF_ICON;
readonly TUNE_ICON = TUNE_ICON;
readonly MANAGE_SEARCH_ICON = MANAGE_SEARCH_ICON;
readonly SEARCH_ICON = SEARCH_ICON;
readonly SEARCH_OFF_ICON = SEARCH_OFF_ICON;
readonly data = inject<TopicWordCloudDialogData>(MAT_DIALOG_DATA);
private readonly dialogRef = inject(
MatDialogRef<TopicWordCloudDialogComponent>,
@@ -1,35 +1,63 @@
<div class="error-container">
<mat-card class="error-card" appearance="outlined">
<mat-card
class="error-card"
appearance="outlined"
role="alert"
aria-labelledby="error-title"
aria-describedby="error-message">
<mat-card-content class="error-content">
<div class="icon-wrapper">
<mat-icon class="error-icon">warning</mat-icon>
<div class="icon-wrapper" aria-hidden="true">
<mat-icon class="error-icon">{{ WARNING_ICON }}</mat-icon>
</div>
<span class="status-code">Fehler {{ statusCode() }}</span>
<h1 class="error-title">{{ title() }}</h1>
<p class="error-message">{{ message() }}</p>
<span class="status-code"> Fehler {{ error().statusCode }} </span>
<button
class="back-button"
mat-flat-button
color="primary"
(click)="goBack()">
<mat-icon>arrow_back</mat-icon>
Zurück
</button>
<h1 id="error-title" class="error-title">
{{ error().title }}
</h1>
@if (errorDetails()) {
<p id="error-message" class="error-message">
{{ error().message }}
</p>
@if (error().referenceId; as referenceId) {
<p class="reference-id">
Referenznummer:
<code>{{ referenceId }}</code>
</p>
}
<div class="error-actions">
<button
class="back-button"
mat-flat-button
color="primary"
type="button"
(click)="goBack()">
<mat-icon aria-hidden="true">{{ ARROW_BACK_ICON }}</mat-icon>
Zurück
</button>
<a mat-button routerLink="/" aria-label="Zur Startseite">
<mat-icon aria-hidden="true">{{ HOME_ICON }}</mat-icon>
Startseite
</a>
</div>
@if (error().errorDetails; as details) {
<mat-expansion-panel
class="diagnostics-panel"
elevation="0"
appearance="outlined">
appearance="outlined"
(opened)="isDetailsOpen.set(true)"
(closed)="isDetailsOpen.set(false)">
<mat-expansion-panel-header>
<mat-panel-title class="diagnostics-title">
ERWEITERTE DIAGNOSE
Erweiterte Diagnose
</mat-panel-title>
</mat-expansion-panel-header>
<pre class="diagnostics-code">{{ errorDetails() }}</pre>
<pre class="diagnostics-code">{{ details }}</pre>
</mat-expansion-panel>
}
</mat-card-content>
@@ -1,56 +1,81 @@
import { Component, input, OnInit, signal, inject } from '@angular/core';
import {
Component,
computed,
inject,
input,
numberAttribute,
signal,
} from '@angular/core';
import { Location } from '@angular/common';
import { Router } from '@angular/router';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatIconModule } from '@angular/material/icon';
import { ErrorService } from '../../shared/services/error.service';
import { ErrorService, ErrorState } from '../../shared/services/error.service';
import { RouterLink } from '@angular/router';
import {
ARROW_BACK_ICON,
HOME_ICON,
WARNING_ICON,
} from '../../shared/ui/icons';
@Component({
selector: 'app-error-page',
standalone: true,
imports: [MatButtonModule, MatCardModule, MatIconModule, MatExpansionModule],
imports: [
MatButtonModule,
MatCardModule,
MatIconModule,
MatExpansionModule,
RouterLink,
],
templateUrl: './error-page.component.html',
styleUrl: './error-page.component.scss',
})
export class ErrorPageComponent implements OnInit {
routeStatusCode = input<number>(500);
routeTitle = input<string>('Da ist was schiefgelaufen');
routeMessage = input<string>(
export class ErrorPageComponent {
readonly WARNING_ICON = WARNING_ICON;
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
readonly HOME_ICON = HOME_ICON;
readonly routeStatusCode = input(500, { transform: numberAttribute });
readonly routeTitle = input('Da ist was schiefgelaufen');
readonly routeMessage = input(
'Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.',
);
routeErrorDetails = input<string | undefined>(undefined);
readonly routeErrorDetails = input<string | undefined>();
statusCode = signal<number>(500);
title = signal<string>('');
message = signal<string>('');
errorDetails = signal<string | undefined>(undefined);
isDetailsOpen = signal<boolean>(false);
readonly isDetailsOpen = signal(false);
private readonly errorService = inject(ErrorService);
private readonly location = inject(Location);
private readonly router = inject(Router);
ngOnInit() {
const savedError = this.errorService.getError();
readonly error = signal<ErrorState>(
this.errorService.consumeError() ?? {
statusCode: 500,
title: 'Da ist was schiefgelaufen',
message:
'Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.',
},
);
readonly routeError = computed<ErrorState>(() => ({
statusCode: this.routeStatusCode(),
title: this.routeTitle(),
message: this.routeMessage(),
errorDetails: this.routeErrorDetails(),
}));
if (savedError) {
this.statusCode.set(savedError.statusCode);
this.title.set(savedError.title);
this.message.set(savedError.message);
this.errorDetails.set(savedError.errorDetails);
this.errorService.clearError(); // Speicher aufräumen
} else {
this.statusCode.set(this.routeStatusCode());
this.title.set(this.routeTitle());
this.message.set(this.routeMessage());
this.errorDetails.set(this.routeErrorDetails());
}
}
toggleDetails() {
toggleDetails(): void {
this.isDetailsOpen.update((isOpen) => !isOpen);
}
goBack() {
window.history.back();
goBack(): void {
if (history.length > 1) {
this.location.back();
return;
}
void this.router.navigateByUrl('/');
}
}
@@ -13,7 +13,7 @@
<div class="login-form">
<div class="code-intro">
<mat-icon>
{{ rateLimited() ? 'hourglass_empty' : 'mark_email_unread' }}
{{ rateLimited() ? HOURGLASS_EMPTY_ICON : EMAIL_UNREAD_ICON }}
</mat-icon>
<div>
@if (rateLimited()) {
@@ -35,7 +35,7 @@
@if (errorMessage()) {
<div class="code-intro">
<mat-icon>error_outline</mat-icon>
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
<div>
<strong>Fehler</strong>
<span>{{ errorMessage() }}</span>
@@ -75,7 +75,7 @@
@if (errorMessage()) {
<div class="code-intro">
<mat-icon>error_outline</mat-icon>
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
<div>
<strong>Fehler</strong>
<span>{{ errorMessage() }}</span>
@@ -13,6 +13,11 @@ import { MatInputModule } from '@angular/material/input';
import { MatIconModule } from '@angular/material/icon';
import { CredentialService } from '../../shared/services/credential.service';
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
import {
EMAIL_UNREAD_ICON,
ERROR_OUTLINE_ICON,
HOURGLASS_EMPTY_ICON,
} from '../../shared/ui/icons';
@Component({
selector: 'app-forgot-password',
@@ -30,6 +35,10 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
standalone: true,
})
export class ForgotPasswordComponent {
readonly HOURGLASS_EMPTY_ICON = HOURGLASS_EMPTY_ICON;
readonly EMAIL_UNREAD_ICON = EMAIL_UNREAD_ICON;
readonly ERROR_OUTLINE_ICON = ERROR_OUTLINE_ICON;
private readonly credentialService = inject(CredentialService);
private readonly snackBar = inject(MatSnackBar);
@@ -1,7 +1,7 @@
@if (loading) {
<app-loading
text="Patentdaten werden geladen..."
icon="workspace_premium"
[icon]="PATENT_ICON"
[size]="150"
[diameter]="150" />
} @else if (error) {
@@ -25,7 +25,7 @@
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="rule"></mat-icon>
<mat-icon matPrefix [fontIcon]="RULE_ICON"></mat-icon>
<mat-select
[value]="activeMatchType"
(selectionChange)="setMatchType($event.value)">
@@ -36,214 +36,31 @@
<mat-option value="both">Beides</mat-option>
</mat-select>
</mat-form-field>
<app-source-filter
[value]="activeFilter"
(valueChange)="setFilter($event)" />
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
<mat-select
[value]="activeFilter"
(selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
<mat-option value="all">Alle</mat-option>
<mat-option value="EPO">EPO</mat-option>
<mat-option value="USPTO">USPTO</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="sort"></mat-icon>
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-select
[value]="sortColumn"
(selectionChange)="setSort($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger>
<mat-option value="year">Jahr</mat-option>
<mat-option value="publication_year">Jahr</mat-option>
<mat-option value="title">Titel</mat-option>
<mat-option value="source">Quelle</mat-option>
<mat-option value="matchType">Match-Typ</mat-option>
<mat-option value="match_type">Match-Typ</mat-option>
</mat-select>
</mat-form-field>
</div>
<table>
<thead>
<tr>
<th>Patent</th>
<th
class="sortable"
[class.sort-active]="sortColumn === 'source'"
(click)="setSort('source')">
Quelle
@if (sortColumn === 'source') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th
class="sortable"
[class.sort-active]="sortColumn === 'year'"
(click)="setSort('year')">
Jahr
@if (sortColumn === 'year') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th>Erfinder</th>
<th>Applicant/Assignee</th>
<th
class="sortable"
[class.sort-active]="sortColumn === 'matchType'"
(click)="setSort('matchType')">
Match-Typ
@if (sortColumn === 'matchType') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th>Personen</th>
</tr>
</thead>
<tbody>
@for (
patent of getPagedPatents();
track trackPatent($index, patent)
) {
<tr
[class.selected]="selectedPatent === patent"
(click)="selectPatent(patent)">
<td class="patent-title">
{{ patent.title ?? patent.patent_id }}
</td>
<td>
<span
class="source-badge source-badge--{{
patent.source.toLowerCase()
}}">
{{ patent.source }}
</span>
</td>
<td>
@if (patent.publication_year) {
<span class="year-badge">{{
patent.publication_year
}}</span>
} @else {
<span>-</span>
}
</td>
<td class="patent-people">
@if (patent.inventors && patent.inventors.length) {
<div class="person-chips">
@for (
inventor of patent.inventors.slice(0, 2);
track inventor
) {
<span class="person-chip">
<mat-icon>person</mat-icon>
{{ inventor }}
</span>
}
@if (patent.inventors.length > 2) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>person</mat-icon>
{{ patent.inventors[2] }}
</span>
@if (patent.inventors.length > 3) {
<span class="person-chip person-chip--more"
>+{{ patent.inventors.length - 3 }}</span
>
}
</span>
}
</div>
} @else {
<span>-</span>
}
</td>
<td class="patent-people">
@if (patent.assignees && patent.assignees.length) {
<div class="person-chips">
@for (
assignee of patent.assignees.slice(0, 2);
track assignee
) {
<span class="person-chip">
<mat-icon>{{
isAssigneeLikelyPerson(assignee, patent)
? 'person'
: 'apartment'
}}</mat-icon>
{{ assignee }}
</span>
}
@if (patent.assignees.length > 2) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>{{
isAssigneeLikelyPerson(
patent.assignees[2],
patent
)
? 'person'
: 'apartment'
}}</mat-icon>
{{ patent.assignees[2] }}
</span>
@if (patent.assignees.length > 3) {
<span class="person-chip person-chip--more"
>+{{ patent.assignees.length - 3 }}</span
>
}
</span>
}
</div>
} @else {
<span>-</span>
}
</td>
<td>
<span
class="match-badge match-badge--{{ patent.match_type }}">
{{ getMatchTypeLabel(patent) }}
</span>
</td>
<td>
<div class="cell-authors">
@if (
patent.matched_authors && patent.matched_authors.length
) {
@for (
author of patent.matched_authors.slice(0, 2);
track author.openalex_author_id
) {
<a
class="author-link"
[routerLink]="[
'/person',
author.openalex_author_id,
]"
[appComponentTooltip]="AuthorTooltipComponent"
[tooltipInputs]="{
authorId: author.openalex_author_id,
}"
(click)="$event.stopPropagation()">
{{ author.author_name }}
</a>
}
} @else {
<span>-</span>
}
</div>
</td>
</tr>
}
</tbody>
</table>
<app-patent-table
[patents]="getPagedPatents()"
[selectedPatent]="selectedPatent"
[showMatchType]="true"
(selectPatent)="selectPatent($event)"
(handleSortChange)="onSortChange($event)" />
<app-query-param-paginator
[total]="totalPatents"
@@ -314,7 +131,8 @@
[appComponentTooltip]="AuthorTooltipComponent"
[tooltipInputs]="{
authorId: author.openalex_author_id,
}">
}"
[tooltipMaxWidth]="'500px'">
{{ author.author_name }}
</a>
</li>
@@ -337,7 +155,7 @@
<span class="patent-detail-action__label"
>Patentdetails anzeigen</span
>
<mat-icon aria-hidden="true">chevron_right</mat-icon>
<mat-icon aria-hidden="true">{{ CHEVRON_RIGHT_ICON }}</mat-icon>
</button>
<p class="patent-detail-hint">
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
@@ -57,134 +57,6 @@ app-query-param-paginator {
margin-bottom: 18px;
flex-wrap: wrap;
}
table {
width: 100%;
border-collapse: collapse;
th {
text-align: left;
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
font-size: 12px;
font-weight: 700;
color: var(--sg-text-muted);
&.sortable {
display: table-cell;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
}
.sort-icon {
vertical-align: middle;
margin-left: 2px;
width: 14px;
height: 14px;
font-size: 14px;
}
}
tr {
cursor: pointer;
color: var(--sg-text);
transition: background-color 0.15s ease;
&:hover td {
background: var(--sg-surface-soft);
}
&.selected td {
background: var(--sg-primary-soft);
}
}
td {
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
color: var(--sg-text);
font-size: 13px;
transition: background-color 0.15s ease;
}
.patent-title {
color: var(--sg-text);
font-weight: 600;
max-width: 320px;
white-space: normal;
word-break: break-word;
}
.patent-people {
max-width: 220px;
}
.cell-authors {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 120px;
}
}
}
.year-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 26px;
padding: 2px 10px;
border-radius: 999px;
border: 1px solid var(--sg-border);
color: var(--sg-text);
font-size: 0.8rem;
font-weight: 600;
}
.person-chips {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.person-chip-row {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
.person-chip {
display: inline-flex;
align-items: center;
gap: 4px;
max-width: 100%;
padding: 2px 8px;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
background: var(--sg-surface-soft);
color: var(--sg-text);
font-size: 0.75rem;
line-height: 1.4;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
mat-icon {
flex-shrink: 0;
width: 14px;
height: 14px;
font-size: 14px;
color: var(--sg-text-soft);
}
&--more {
color: var(--sg-text-muted);
font-weight: 600;
}
}
.match-badge {
@@ -4,6 +4,7 @@ import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatIconModule } from '@angular/material/icon';
import { Sort } from '@angular/material/sort';
import { PatentsService } from '../../api/api/patents.service';
import { OrgPatentEntry } from '../../api/model/orgPatentEntry';
import {
@@ -15,8 +16,17 @@ import { PageEvent } from '@angular/material/paginator';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
import { AppAuthorTooltipComponent } from '../../shared/ui/app-author-tooltip/app-author-tooltip.component';
import { PatentTableComponent } from '../../shared/ui/patent-table/patent-table.component';
import { SourceFilterComponent } from '../../shared/ui/source-filter/source-filter.component';
import {
CHEVRON_RIGHT_ICON,
FILTER_ICON,
PATENT_ICON,
RULE_ICON,
SORT_ICON,
} from '../../shared/ui/icons';
type SortColumn = 'title' | 'year' | 'source' | 'matchType';
type SortColumn = 'title' | 'publication_year' | 'source' | 'match_type';
type SortDirection = 'asc' | 'desc';
type SourceFilter = 'all' | 'EPO' | 'USPTO';
type OrgPatentMatchTypeFilter = 'all' | 'institution' | 'name' | 'both';
@@ -32,11 +42,19 @@ type OrgPatentMatchTypeFilter = 'all' | 'institution' | 'name' | 'both';
MatIconModule,
QueryParamPaginatorComponent,
ComponentTooltipDirective,
PatentTableComponent,
SourceFilterComponent,
],
templateUrl: './institution-patents.component.html',
styleUrl: './institution-patents.component.scss',
})
export class InstitutionPatentsComponent implements OnInit {
readonly PATENT_ICON = PATENT_ICON;
readonly RULE_ICON = RULE_ICON;
readonly FILTER_ICON = FILTER_ICON;
readonly SORT_ICON = SORT_ICON;
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
readonly AuthorTooltipComponent = AppAuthorTooltipComponent;
private route = inject(ActivatedRoute);
private router = inject(Router);
@@ -53,7 +71,7 @@ export class InstitutionPatentsComponent implements OnInit {
activeFilter: SourceFilter = 'all';
activeMatchType: OrgPatentMatchTypeFilter = 'all';
sortColumn: SortColumn = 'year';
sortColumn: SortColumn = 'publication_year';
sortDirection: SortDirection = 'desc';
pageIndex = 0;
@@ -111,12 +129,22 @@ export class InstitutionPatentsComponent implements OnInit {
this.reloadPatents();
}
onSortChange(sort: Sort): void {
if (!sort.direction || !this.isValidSortColumn(sort.active)) {
return;
}
this.sortColumn = sort.active;
this.sortDirection = sort.direction;
this.filteredPatents = this.sortPatents(this.patents);
this.updateQueryParams();
}
setSort(column: SortColumn): void {
if (this.sortColumn === column) {
this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
} else {
this.sortColumn = column;
this.sortDirection = column === 'year' ? 'desc' : 'asc';
this.sortDirection = column === 'publication_year' ? 'desc' : 'asc';
}
this.filteredPatents = this.sortPatents(this.patents);
this.updateQueryParams();
@@ -186,14 +214,14 @@ export class InstitutionPatentsComponent implements OnInit {
const direction = this.sortDirection === 'asc' ? 1 : -1;
return [...patents].sort((a, b) => {
switch (this.sortColumn) {
case 'year': {
case 'publication_year': {
const yearA = a.publication_date ?? String(a.publication_year ?? '');
const yearB = b.publication_date ?? String(b.publication_year ?? '');
return direction * yearA.localeCompare(yearB);
}
case 'source':
return direction * a.source.localeCompare(b.source);
case 'matchType':
case 'match_type':
return direction * a.match_type.localeCompare(b.match_type);
default:
return (
@@ -239,9 +267,9 @@ export class InstitutionPatentsComponent implements OnInit {
private isValidSortColumn(value: string | null): value is SortColumn {
return (
value === 'title' ||
value === 'year' ||
value === 'publication_year' ||
value === 'source' ||
value === 'matchType'
value === 'match_type'
);
}
@@ -288,15 +316,6 @@ export class InstitutionPatentsComponent implements OnInit {
return this.patents.filter((p) => p.match_type === 'both').length;
}
trackPatent(_index: number, patent: OrgPatentEntry): string {
return [
patent.source,
patent.patent_id,
patent.publication_date ?? '',
patent.kind ?? patent.application_type ?? '',
].join('|');
}
getAbstractPreview(abstract: string | null | undefined): string | null {
if (!abstract?.trim()) {
return null;
@@ -324,50 +343,4 @@ export class InstitutionPatentsComponent implements OnInit {
return patent.match_type;
}
}
private static readonly ORG_SUFFIX_PATTERN =
/\b(Inc|Ltd|LLC|LLP|GmbH|Corp(oration)?|Co|KG|AG|SE|S\.?A\.?|N\.?V\.?|B\.?V\.?|PLC|Universit(y|ät|é)|Institut(e)?|Foundation|Laborator(y|ies)|Labs?|Group|Holdings?|Company|Gesellschaft)\b\.?/i;
private static readonly PERSON_SUFFIX_PATTERN =
/\b(Dr|Prof|PhD|Ph\.D|M\.D|Jr|Sr)\b\.?/i;
private normalizeNameForComparison(name: string): string {
return name
.normalize('NFD')
.replace(/[̀-ͯ]/g, '')
.replace(/[.,]/g, '')
.toUpperCase()
.split(/\s+/)
.filter(Boolean)
.sort()
.join(' ');
}
isAssigneeLikelyPerson(assignee: string, patent: OrgPatentEntry): boolean {
if (InstitutionPatentsComponent.ORG_SUFFIX_PATTERN.test(assignee)) {
return false;
}
const normalizedAssignee = this.normalizeNameForComparison(
assignee.replace(InstitutionPatentsComponent.PERSON_SUFFIX_PATTERN, ''),
);
const matchesInventor = (patent.inventors ?? []).some(
(inventor) =>
this.normalizeNameForComparison(inventor) === normalizedAssignee,
);
if (matchesInventor) {
return true;
}
return InstitutionPatentsComponent.PERSON_SUFFIX_PATTERN.test(assignee);
}
getMatchedAuthorsPreview(patent: OrgPatentEntry): string {
if (!patent.matched_authors?.length) {
return '-';
}
return patent.matched_authors
.slice(0, 2)
.map((author) => author.author_name)
.join(', ');
}
}
@@ -41,9 +41,7 @@
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
" />
<app-info-card
[description]="
'Durchschnittliche jährliche Förderung durch die Europäische Union'
"
[description]="'Durchschnittliche jährliche Förderung durch die Europäische Union'"
[value]="
(euAverageAnnualFunding()
| currency: 'EUR' : 'symbol' : '1.0-0' : 'de') ?? undefined
@@ -83,7 +81,7 @@
<ng-template #euProjectActionsTmp let-row>
<a mat-icon-button color="primary" [routerLink]="['/projects/eu', row.id]">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</ng-template>
@@ -92,7 +90,7 @@
mat-icon-button
color="primary"
[routerLink]="['/projects/bund', row.id]">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</ng-template>
</div>
@@ -32,6 +32,8 @@ import {
LinkTabNavBarComponent,
LinkTabNavBarItem,
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
import { OPEN_IN_NEW_ICON } from '../../shared/ui/icons';
type BundProjectRow = {
id: string;
topic: string;
@@ -71,6 +73,8 @@ type EuProjectRow = {
styleUrl: './institution-projects.component.scss',
})
export class InstitutionProjectsComponent implements OnInit {
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
fundingStartTmp = viewChild.required<TemplateRef<any>>('fundingStartTmp');
fundingEndTmp = viewChild.required<TemplateRef<any>>('fundingEndTmp');
fundingAmountTmp = viewChild.required<TemplateRef<any>>('fundingAmountTmp');
@@ -3,4 +3,4 @@
flex-direction: column;
gap: 1rem;
padding: 1rem;
}
}
@@ -13,6 +13,7 @@ import {
} from '../../shared/ui/card-search/card-search.component';
import { FilterObserver } from '../../shared/ui/selected-filters/selected-filters.component';
import { AppInstitutionCardComponent } from '../../shared/ui/app-institution-card/app-institution-card.component';
import { SEARCH_ICON } from '../../shared/ui/icons';
@Component({
selector: 'app-institutions',
@@ -35,7 +36,7 @@ export class InstitutionsComponent {
{
id: 'name',
queryParamKey: 'search',
icon: 'search',
icon: SEARCH_ICON,
},
];
@@ -4,7 +4,7 @@
@if (runsLoading() && runs().length === 0) {
<app-loading
text="Läufe werden geladen …"
icon="history"
[icon]="HISTORY_ICON"
[size]="48"
[diameter]="48" />
} @else if (runsError()) {
@@ -60,7 +60,7 @@
type="button"
[disabled]="selectedRunId() == null"
(click)="downloadLogs()">
<mat-icon>download</mat-icon>
<mat-icon>{{ DOWNLOAD_ICON }}</mat-icon>
Herunterladen
</button>
<button
@@ -71,7 +71,7 @@
matTooltipPosition="above"
[disabled]="loading() || runsLoading()"
(click)="loadRuns()">
<mat-icon>refresh</mat-icon>
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
</button>
</div>
</div>
@@ -80,7 +80,7 @@
@if (loading() && !logs()) {
<app-loading
text="Logs werden geladen …"
icon="description"
[icon]="DESCRIPTION_ICON"
[size]="48"
[diameter]="48" />
} @else {
@@ -29,6 +29,12 @@ import {
formatUtcDateAsLocal,
statusMeta,
} from '../jobs.utils';
import {
DESCRIPTION_ICON,
DOWNLOAD_ICON,
HISTORY_ICON,
REFRESH_ICON,
} from '../../../shared/ui/icons';
export interface JobLogsDialogData {
task: BackgroundJobTask;
@@ -51,6 +57,11 @@ export interface JobLogsDialogData {
standalone: true,
})
export class JobLogsDialogComponent implements OnInit {
readonly HISTORY_ICON = HISTORY_ICON;
readonly DOWNLOAD_ICON = DOWNLOAD_ICON;
readonly REFRESH_ICON = REFRESH_ICON;
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
private readonly dialogRef = inject(MatDialogRef<JobLogsDialogComponent>);
private readonly backgroundJobsService = inject(BackgroundJobsService);
private readonly destroyRef = inject(DestroyRef);
+10 -10
View File
@@ -13,7 +13,7 @@
type="button"
class="new-job-button"
(click)="openCreateDialog()">
<mat-icon>add</mat-icon>
<mat-icon>{{ ADD_ICON }}</mat-icon>
Neuer Job
</button>
</header>
@@ -48,7 +48,7 @@
matTooltip="Docker-Status aktualisieren"
[disabled]="dockerHealthLoading()"
(click)="refreshDockerHealth()">
<mat-icon>refresh</mat-icon>
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
</button>
</mat-card-content>
</mat-card>
@@ -93,7 +93,7 @@
matTooltip="Nexus-Status aktualisieren"
[disabled]="registryHealthLoading()"
(click)="refreshRegistryHealth()">
<mat-icon>refresh</mat-icon>
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
</button>
</mat-card-content>
</mat-card>
@@ -116,7 +116,7 @@
matTooltipPosition="above"
[disabled]="row.status === 'running' || row.status === 'stopping'"
(click)="openEditDialog(row)">
<mat-icon>edit</mat-icon>
<mat-icon>{{ EDIT_ICON }}</mat-icon>
</button>
<div class="task-name-text">
<strong>{{ row.name }}</strong>
@@ -191,7 +191,7 @@
matTooltip="Jobs aktualisieren"
matTooltipPosition="above"
(click)="refreshTasks()">
<mat-icon>refresh</mat-icon>
<mat-icon>{{ REFRESH_ICON }}</mat-icon>
</button>
</div>
</ng-template>
@@ -206,7 +206,7 @@
matTooltipPosition="above"
[disabled]="row.status === 'running' || row.status === 'stopping'"
(click)="runNow(row)">
<mat-icon>play_arrow</mat-icon>
<mat-icon>{{ PLAY_ARROW_ICON }}</mat-icon>
</button>
<button
mat-icon-button
@@ -216,7 +216,7 @@
matTooltipPosition="above"
[disabled]="row.status !== 'running'"
(click)="stopNow(row)">
<mat-icon>stop</mat-icon>
<mat-icon>{{ STOP_ICON }}</mat-icon>
</button>
<button
mat-icon-button
@@ -226,7 +226,7 @@
matTooltipPosition="above"
[disabled]="!row.last_run"
(click)="openLogsDialog(row)">
<mat-icon>description</mat-icon>
<mat-icon>{{ DESCRIPTION_ICON }}</mat-icon>
</button>
<button
mat-icon-button
@@ -235,7 +235,7 @@
matTooltip="Zeitplan bearbeiten"
matTooltipPosition="above"
(click)="openScheduleDialog(row)">
<mat-icon>edit_calendar</mat-icon>
<mat-icon>{{ EDIT_CALENDAR_ICON }}</mat-icon>
</button>
<button
mat-icon-button
@@ -255,7 +255,7 @@
diameter="18"
mode="indeterminate"></mat-progress-spinner>
} @else {
<mat-icon>delete</mat-icon>
<mat-icon>{{ DELETE_ICON }}</mat-icon>
}
</button>
</div>
@@ -58,6 +58,16 @@ import {
TaskEditDialogComponent,
TaskEditDialogData,
} from './task-edit-dialog/task-edit-dialog.component';
import {
ADD_ICON,
DELETE_ICON,
DESCRIPTION_ICON,
EDIT_CALENDAR_ICON,
EDIT_ICON,
PLAY_ARROW_ICON,
REFRESH_ICON,
STOP_ICON,
} from '../../shared/ui/icons';
const MAX_IDLE_POLL_WAIT_MS = 60000;
@@ -79,6 +89,15 @@ const MAX_IDLE_POLL_WAIT_MS = 60000;
standalone: true,
})
export class JobsComponent implements OnInit {
readonly ADD_ICON = ADD_ICON;
readonly REFRESH_ICON = REFRESH_ICON;
readonly EDIT_ICON = EDIT_ICON;
readonly PLAY_ARROW_ICON = PLAY_ARROW_ICON;
readonly STOP_ICON = STOP_ICON;
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
readonly EDIT_CALENDAR_ICON = EDIT_CALENDAR_ICON;
readonly DELETE_ICON = DELETE_ICON;
private readonly dialog = inject(MatDialog);
private readonly snackBar = inject(MatSnackBar);
private readonly backgroundJobsService = inject(BackgroundJobsService);
+17 -6
View File
@@ -1,4 +1,11 @@
import { JobRun } from '../../api';
import {
CHECK_CIRCLE_ICON,
ERROR_ICON,
JOBS_ICON,
SCHEDULE_ICON,
STOP_CIRCLE_ICON,
} from '../../shared/ui/icons';
export interface StatusMeta {
label: string;
@@ -7,28 +14,32 @@ export interface StatusMeta {
}
const STATUS_META: Record<string, StatusMeta> = {
running: { label: 'Läuft', icon: 'sync', cssClass: 'task-status--running' },
running: {
label: 'Läuft',
icon: JOBS_ICON,
cssClass: 'task-status--running',
},
stopping: {
label: 'Wird gestoppt',
icon: 'stop_circle',
icon: STOP_CIRCLE_ICON,
cssClass: 'task-status--running',
},
succeeded: {
label: 'Erfolgreich',
icon: 'check_circle',
icon: CHECK_CIRCLE_ICON,
cssClass: 'task-status--success',
},
failed: {
label: 'Fehlgeschlagen',
icon: 'error',
icon: ERROR_ICON,
cssClass: 'task-status--failed',
},
stopped: {
label: 'Gestoppt',
icon: 'stop_circle',
icon: STOP_CIRCLE_ICON,
cssClass: 'task-status--stopped',
},
idle: { label: 'Bereit', icon: 'schedule', cssClass: 'task-status--idle' },
idle: { label: 'Bereit', icon: SCHEDULE_ICON, cssClass: 'task-status--idle' },
};
export function statusMeta(status: string): StatusMeta {
@@ -9,7 +9,7 @@
matSuffix
class="field-info"
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
@if (form.controls.name.invalid) {
<mat-error>Bitte einen Namen eingeben.</mat-error>
@@ -28,7 +28,7 @@
matSuffix
class="field-info"
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
</mat-form-field>
@@ -48,7 +48,7 @@
matSuffix
class="field-info"
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
@if (form.controls.image.invalid && form.controls.image.touched) {
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error>
@@ -63,7 +63,7 @@
matSuffix
class="field-info"
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?"
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
</mat-form-field>
@@ -74,7 +74,7 @@
matSuffix
class="field-info"
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
</mat-form-field>
@@ -89,7 +89,7 @@
matSuffix
class="field-info"
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint>
@if (form.controls.env.hasError('invalidEnv')) {
@@ -111,7 +111,7 @@
type="button"
[disabled]="creating()"
(click)="submit()">
<mat-icon>add</mat-icon>
<mat-icon>{{ ADD_ICON }}</mat-icon>
Anlegen
</button>
</mat-dialog-actions>
@@ -15,6 +15,7 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip';
import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
import { ADD_ICON, INFO_OUTLINE_ICON } from '../../../shared/ui/icons';
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
@@ -36,6 +37,9 @@ const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
standalone: true,
})
export class TaskCreateDialogComponent implements OnInit {
readonly INFO_OUTLINE_ICON = INFO_OUTLINE_ICON;
readonly ADD_ICON = ADD_ICON;
private readonly dialogRef =
inject<
MatDialogRef<TaskCreateDialogComponent, BackgroundJobTask | undefined>
@@ -9,7 +9,7 @@
matSuffix
class="field-info"
matTooltip="Eindeutiger Anzeigename des Jobs, z.B. „News-Themen-Mapping (Testlauf)“."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
@if (form.controls.name.invalid) {
<mat-error>Bitte einen Namen eingeben.</mat-error>
@@ -28,7 +28,7 @@
matSuffix
class="field-info"
matTooltip="Wird beim Start direkt im Container ausgeführt — wie in einem Terminal, z.B. „python sync.py --update-keywords --target-index docker-job_test“. Leer = Standard-Befehl des Images."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
</mat-form-field>
@@ -48,7 +48,7 @@
matSuffix
class="field-info"
matTooltip="Docker-Image für den Job. Tippen filtert die aus Nexus verfügbaren Images; du kannst auch einen eigenen Wert eingeben. Images aus unserer Registry (docker.nes.uni-due.de) erhalten die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch, fremde Images nicht."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
@if (form.controls.image.invalid && form.controls.image.touched) {
<mat-error>Bitte ein Image auswählen oder eingeben.</mat-error>
@@ -63,7 +63,7 @@
matSuffix
class="field-info"
matTooltip="Freitext für die Job-Tabelle: Was macht der Job, was sollte man vor dem Start wissen?"
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
</mat-form-field>
@@ -74,7 +74,7 @@
matSuffix
class="field-info"
matTooltip="Reine Anzeige-Info in der Tabelle. In welchen Index der Job wirklich schreibt, bestimmt allein der Befehl (z.B. --target-index / --output-index)."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
</mat-form-field>
@@ -89,7 +89,7 @@
matSuffix
class="field-info"
matTooltip="Zusätzliche Umgebungsvariablen für den Container, eine pro Zeile im Format KEY=value. Das Standard-Image bekommt die INSE-Zugangsdaten (Elasticsearch/LLM) automatisch — hier ist nur Spezielles nötig."
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
<mat-hint>Eine Variable pro Zeile im Format KEY=value.</mat-hint>
@if (form.controls.env.hasError('invalidEnv')) {
@@ -111,7 +111,7 @@
type="button"
[disabled]="saving()"
(click)="submit()">
<mat-icon>save</mat-icon>
<mat-icon>{{ SAVE_ICON }}</mat-icon>
Speichern
</button>
</mat-dialog-actions>
@@ -19,6 +19,7 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip';
import { BackgroundJobTask, BackgroundJobsService } from '../../../api';
import { INFO_OUTLINE_ICON, SAVE_ICON } from '../../../shared/ui/icons';
const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/;
@@ -44,6 +45,9 @@ export interface TaskEditDialogData {
standalone: true,
})
export class TaskEditDialogComponent implements OnInit {
readonly INFO_OUTLINE_ICON = INFO_OUTLINE_ICON;
readonly SAVE_ICON = SAVE_ICON;
private readonly dialogRef =
inject<
MatDialogRef<TaskEditDialogComponent, BackgroundJobTask | undefined>
@@ -123,7 +123,7 @@
<mat-dialog-actions align="end">
<button mat-button type="button" (click)="close()">Abbrechen</button>
<button mat-flat-button color="primary" type="button" (click)="submit()">
<mat-icon>save</mat-icon>
<mat-icon>{{ SAVE_ICON }}</mat-icon>
Speichern
</button>
</mat-dialog-actions>
@@ -18,6 +18,7 @@ import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { BackgroundJobTask } from '../../../api';
import { formatUtcDateAsLocal } from '../jobs.utils';
import { SAVE_ICON } from '../../../shared/ui/icons';
export interface TaskScheduleDialogData {
task: BackgroundJobTask;
@@ -127,6 +128,8 @@ function toTime(hour: string, minute: string): string {
standalone: true,
})
export class TaskScheduleDialogComponent {
readonly SAVE_ICON = SAVE_ICON;
private readonly dialogRef =
inject<
MatDialogRef<
@@ -1,7 +1,7 @@
@if (loading()) {
<app-loading
text="Patentdaten werden geladen..."
icon="workspace_premium"
[icon]="PATENT_ICON"
[size]="150"
[diameter]="150" />
} @else if (error()) {
@@ -13,168 +13,29 @@
<div class="patents-content">
<div class="patents-list">
<div class="patents-list-toolbar">
<app-source-filter
[value]="activeFilter()"
(valueChange)="setFilter($event)" />
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
<mat-select
[value]="activeFilter()"
(selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
<mat-option value="all">Alle</mat-option>
<mat-option value="EPO">EPO</mat-option>
<mat-option value="USPTO">USPTO</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="sort"></mat-icon>
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-select
[value]="sortColumn()"
(selectionChange)="setSort($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger>
<mat-option value="year">Jahr</mat-option>
<mat-option value="publication_year">Jahr</mat-option>
<mat-option value="title">Titel</mat-option>
<mat-option value="source">Quelle</mat-option>
</mat-select>
</mat-form-field>
</div>
<table>
<thead>
<tr>
<th>Patent</th>
<th
class="sortable"
[class.sort-active]="sortColumn() === 'source'"
(click)="setSort('source')">
Quelle
@if (sortColumn() === 'source') {
<mat-icon class="sort-icon">{{
sortDirection() === 'asc'
? 'arrow_upward'
: 'arrow_downward'
}}</mat-icon>
}
</th>
<th
class="sortable"
[class.sort-active]="sortColumn() === 'year'"
(click)="setSort('year')">
Jahr
@if (sortColumn() === 'year') {
<mat-icon class="sort-icon">{{
sortDirection() === 'asc'
? 'arrow_upward'
: 'arrow_downward'
}}</mat-icon>
}
</th>
<th>Erfinder</th>
<th>Anmelder</th>
</tr>
</thead>
<tbody>
@for (item of getPagedMatches(); track trackMatch($index, item)) {
<tr
[class.selected]="selectedMatch() === item"
(click)="selectMatch(item)">
<td class="patent-title">
{{ item.patent.title ?? item.patent.patent_id }}
</td>
<td>
<span
class="source-badge source-badge--{{
item.patent.source.toLowerCase()
}}">
{{ item.patent.source }}
</span>
</td>
<td>
@if (item.patent.publication_year) {
<span class="year-badge">{{
item.patent.publication_year
}}</span>
} @else {
<span>-</span>
}
</td>
<td class="patent-people">
@if (item.patent.inventors && item.patent.inventors.length) {
<div class="person-chips">
@for (
inventor of item.patent.inventors.slice(0, 2);
track inventor
) {
<span class="person-chip">
<mat-icon>person</mat-icon>
{{ inventor }}
</span>
}
@if (item.patent.inventors.length > 2) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>person</mat-icon>
{{ item.patent.inventors[2] }}
</span>
@if (item.patent.inventors.length > 3) {
<span class="person-chip person-chip--more"
>+{{ item.patent.inventors.length - 3 }}</span
>
}
</span>
}
</div>
} @else {
<span>-</span>
}
</td>
<td class="patent-people">
@if (item.patent.assignees && item.patent.assignees.length) {
<div class="person-chips">
@for (
assignee of item.patent.assignees.slice(0, 2);
track assignee
) {
<span class="person-chip">
<mat-icon>{{
isAssigneeLikelyPerson(assignee, item.patent)
? 'person'
: 'apartment'
}}</mat-icon>
{{ assignee }}
</span>
}
@if (item.patent.assignees.length > 2) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>{{
isAssigneeLikelyPerson(
item.patent.assignees[2],
item.patent
)
? 'person'
: 'apartment'
}}</mat-icon>
{{ item.patent.assignees[2] }}
</span>
@if (item.patent.assignees.length > 3) {
<span class="person-chip person-chip--more"
>+{{ item.patent.assignees.length - 3 }}</span
>
}
</span>
}
</div>
} @else {
<span>-</span>
}
</td>
</tr>
}
</tbody>
</table>
<app-patent-table
[patents]="getPagedPatents()"
[selectedPatent]="selectedPatent()"
(selectPatent)="selectPatentFromTable($event)"
(handleSortChange)="onSortChange($event)" />
<app-query-param-paginator
[total]="filteredMatches().length"
@@ -228,7 +89,7 @@
<span class="patent-detail-action__label"
>Patentdetails anzeigen</span
>
<mat-icon aria-hidden="true">chevron_right</mat-icon>
<mat-icon aria-hidden="true">{{ CHEVRON_RIGHT_ICON }}</mat-icon>
</button>
<p class="patent-detail-hint">
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
@@ -88,126 +88,6 @@ app-query-param-paginator {
margin-bottom: 18px;
flex-wrap: wrap;
}
table {
width: 100%;
border-collapse: collapse;
th {
text-align: left;
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
font-size: 12px;
font-weight: 700;
color: var(--sg-text-muted);
&.sortable {
display: table-cell;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
}
.sort-icon {
vertical-align: middle;
margin-left: 2px;
width: 14px;
height: 14px;
font-size: 14px;
}
}
tr {
cursor: pointer;
transition: background-color 0.15s ease;
&:hover td {
background: rgba(16, 26, 61, 0.04);
}
&.selected td {
background: var(--sg-primary-soft);
}
}
td {
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
color: var(--sg-text);
font-size: 13px;
transition: background-color 0.15s ease;
}
.patent-title {
color: var(--sg-text);
font-weight: 600;
max-width: 400px;
white-space: normal;
word-break: break-word;
}
.patent-people {
max-width: 220px;
}
}
}
.year-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 26px;
padding: 2px 10px;
border-radius: 999px;
border: 1px solid var(--sg-border);
color: var(--sg-text);
font-size: 0.8rem;
font-weight: 600;
}
.person-chips {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.person-chip-row {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
.person-chip {
display: inline-flex;
align-items: center;
gap: 4px;
max-width: 100%;
padding: 2px 8px;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
background: var(--sg-surface-soft);
color: var(--sg-text);
font-size: 0.75rem;
line-height: 1.4;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
mat-icon {
flex-shrink: 0;
width: 14px;
height: 14px;
font-size: 14px;
color: var(--sg-text-soft);
}
&--more {
color: var(--sg-text-muted);
font-weight: 600;
}
}
.source-badge {
@@ -1,9 +1,17 @@
import { Component, computed, inject, input, output, signal } from '@angular/core';
import {
Component,
computed,
inject,
input,
output,
signal,
} from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatSelectModule } from '@angular/material/select';
import { PageEvent } from '@angular/material/paginator';
import { Sort } from '@angular/material/sort';
import { ActivatedRoute, Router } from '@angular/router';
import { PatentEntry } from '../../../api/model/patentEntry';
import { KeywordPatentMatch } from '../../../api/model/keywordPatentMatch';
@@ -14,11 +22,25 @@ import {
getPublicationStageLabel,
} from '../../patent-detail/patent-detail.utils';
import { KeywordPatentMappingStatus } from '../../../api';
import { PatentTableComponent } from '../../../shared/ui/patent-table/patent-table.component';
import { SourceFilterComponent } from '../../../shared/ui/source-filter/source-filter.component';
import {
CHEVRON_RIGHT_ICON,
FILTER_ICON,
PATENT_ICON,
SORT_ICON,
} from '../../../shared/ui/icons';
type SourceFilter = 'all' | 'EPO' | 'USPTO';
type SortColumn = 'title' | 'year' | 'source';
type SortColumn = 'title' | 'publication_year' | 'source';
type SortDirection = 'asc' | 'desc';
function isValidSortColumn(value: string | null): value is SortColumn {
return (
value === 'title' || value === 'publication_year' || value === 'source'
);
}
@Component({
selector: 'app-keywords-patents',
imports: [
@@ -27,11 +49,18 @@ type SortDirection = 'asc' | 'desc';
MatSelectModule,
LoadingComponent,
QueryParamPaginatorComponent,
PatentTableComponent,
SourceFilterComponent,
],
templateUrl: './keywords-patents.component.html',
styleUrl: './keywords-patents.component.scss',
})
export class KeywordsPatentsComponent {
readonly PATENT_ICON = PATENT_ICON;
readonly FILTER_ICON = FILTER_ICON;
readonly SORT_ICON = SORT_ICON;
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
private readonly route = inject(ActivatedRoute);
private readonly router = inject(Router);
private readonly queryParams = toSignal(this.route.queryParams);
@@ -45,7 +74,7 @@ export class KeywordsPatentsComponent {
readonly reload = output<void>();
activeFilter = signal<SourceFilter>('all');
sortColumn = signal<SortColumn>('year');
sortColumn = signal<SortColumn>('publication_year');
sortDirection = signal<SortDirection>('desc');
selectedMatch = signal<KeywordPatentMatch | null>(null);
@@ -68,6 +97,10 @@ export class KeywordsPatentsComponent {
return this.sortMatches(items);
});
readonly selectedPatent = computed(
() => this.selectedMatch()?.patent ?? null,
);
emptyMessage(): string {
switch (this.mappingStatus()) {
case 'search_error':
@@ -82,57 +115,42 @@ export class KeywordsPatentsComponent {
return this.filteredMatches().slice(start, start + this.pageSize());
}
getPagedPatents(): PatentEntry[] {
return this.getPagedMatches().map((item) => item.patent);
}
setFilter(filter: SourceFilter): void {
this.activeFilter.set(filter);
this.selectedMatch.set(null);
this.resetPage();
}
onSortChange(sort: Sort): void {
if (!sort.direction || !isValidSortColumn(sort.active)) {
return;
}
this.sortColumn.set(sort.active);
this.sortDirection.set(sort.direction);
this.selectedMatch.set(null);
this.resetPage();
}
setSort(column: SortColumn): void {
if (this.sortColumn() === column) {
this.sortDirection.set(this.sortDirection() === 'asc' ? 'desc' : 'asc');
} else {
this.sortColumn.set(column);
this.sortDirection.set(column === 'year' ? 'desc' : 'asc');
this.sortDirection.set(column === 'publication_year' ? 'desc' : 'asc');
}
this.selectedMatch.set(null);
this.resetPage();
}
isAssigneeLikelyPerson(assignee: string, patent: PatentEntry): boolean {
if (KeywordsPatentsComponent.ORG_SUFFIX_PATTERN.test(assignee)) {
return false;
selectPatentFromTable(patent: PatentEntry): void {
const match = this.matches().find((item) => item.patent === patent);
if (match) {
this.selectMatch(match);
}
const normalizedAssignee = this.normalizeNameForComparison(
assignee.replace(KeywordsPatentsComponent.PERSON_SUFFIX_PATTERN, ''),
);
const matchesInventor = (patent.inventors ?? []).some(
(inventor) =>
this.normalizeNameForComparison(inventor) === normalizedAssignee,
);
if (matchesInventor) {
return true;
}
return KeywordsPatentsComponent.PERSON_SUFFIX_PATTERN.test(assignee);
}
private static readonly ORG_SUFFIX_PATTERN =
/\b(Inc|Ltd|LLC|LLP|GmbH|Corp(oration)?|Co|KG|AG|SE|S\.?A\.?|N\.?V\.?|B\.?V\.?|PLC|Universit(y|ät|é)|Institut(e)?|Foundation|Laborator(y|ies)|Labs?|Group|Holdings?|Company|Gesellschaft)\b\.?/i;
private static readonly PERSON_SUFFIX_PATTERN =
/\b(Dr|Prof|PhD|Ph\.D|M\.D|Jr|Sr)\b\.?/i;
private normalizeNameForComparison(name: string): string {
return name
.normalize('NFD')
.replace(/[̀-ͯ]/g, '')
.replace(/[.,]/g, '')
.toUpperCase()
.split(/\s+/)
.filter(Boolean)
.sort()
.join(' ');
}
onPatentPageChange(_event: PageEvent): void {
@@ -186,23 +204,12 @@ export class KeywordsPatentsComponent {
return `${text.slice(0, 160).trimEnd()}…`;
}
trackMatch(_index: number, item: KeywordPatentMatch): string {
const patent = item.patent;
return [
patent.source,
patent.patent_id,
patent.publication_date ?? '',
patent.kind ?? patent.application_type ?? '',
item.match_score,
].join('|');
}
private sortMatches(items: KeywordPatentMatch[]): KeywordPatentMatch[] {
const column = this.sortColumn();
const direction = this.sortDirection() === 'asc' ? 1 : -1;
return [...items].sort((a, b) => {
switch (column) {
case 'year': {
case 'publication_year': {
const yearA =
a.patent.publication_date ??
String(a.patent.publication_year ?? '');
@@ -23,7 +23,7 @@
[color]="isExtracting() ? 'warn' : 'primary'"
(click)="onExtractKeywordsClick()">
<mat-icon>
{{ isExtracting() ? 'close' : 'troubleshoot' }}
{{ isExtracting() ? CLOSE_ICON : TROUBLESHOOT_ICON }}
</mat-icon>
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
</button>
@@ -49,7 +49,7 @@
class="extract-btn"
(click)="onExtractKeywordsClick()">
<mat-icon>
{{ isExtracting() ? 'close' : 'troubleshoot' }}
{{ isExtracting() ? CLOSE_ICON : TROUBLESHOOT_ICON }}
</mat-icon>
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
</button>
@@ -74,7 +74,7 @@
class="extract-btn"
(click)="onExtractKeywordsClick()">
<mat-icon>
{{ isExtracting() ? 'close' : 'troubleshoot' }}
{{ isExtracting() ? CLOSE_ICON : TROUBLESHOOT_ICON }}
</mat-icon>
{{ isExtracting() ? 'Abbrechen' : 'Keywords extrahieren' }}
</button>
@@ -113,7 +113,7 @@
(click)="deselectAll()"
[disabled]="isExtracting()"
matTooltip="Alle extrahierten Keywords abwählen">
<mat-icon>select_all</mat-icon>
<mat-icon>{{ SELECT_ALL_ICON }}</mat-icon>
<span>Alle abwählen</span>
</button>
} @else {
@@ -123,7 +123,7 @@
[disabled]="isExtracting()"
(click)="selectAll()"
matTooltip="Alle extrahierten Keywords auswählen">
<mat-icon>select_all</mat-icon>
<mat-icon>{{ SELECT_ALL_ICON }}</mat-icon>
<span>Alle auswählen</span>
</button>
}
@@ -133,7 +133,7 @@
[disabled]="isExtracting()"
(click)="clearKeywords()"
matTooltip="Alle extrahierten Keywords löschen">
<mat-icon>delete_outline</mat-icon>
<mat-icon>{{ DELETE_OUTLINE_ICON }}</mat-icon>
<span>Alle löschen</span>
</button>
</div>
@@ -147,14 +147,14 @@
[disabled]="isExtracting()"
value="llm"
matTooltip="Extrahierte Keywords">
<mat-icon>text_fields</mat-icon>
<mat-icon>{{ TEXT_FIELDS_ICON }}</mat-icon>
<span>Extrahierte Keywords</span>
</mat-button-toggle>
<mat-button-toggle
[disabled]="isExtracting()"
value="topic"
matTooltip="Die Abbildung der extrahierten Keywords auf die bekannten Themenbereiche">
<mat-icon>account_tree</mat-icon>
<mat-icon>{{ ACCOUNT_TREE_ICON }}</mat-icon>
<span>Ähnliche Themen</span>
</mat-button-toggle>
</mat-button-toggle-group>
@@ -233,7 +233,7 @@
color="warn"
aria-label="Manuelles Keyword entfernen"
(click)="removeManualKeyword(keyword)">
<mat-icon>cancel</mat-icon>
<mat-icon>{{ CANCEL_ICON }}</mat-icon>
</button>
</div>
}
@@ -265,7 +265,10 @@
<div class="table-body">
<div class="table-col broad-col">
@if (isExtracting() && broadKeywords().length === 0) {
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
<app-loading
[icon]="MANAGE_SEARCH_ICON"
[size]="60"
[diameter]="60" />
} @else {
<ng-container
*ngTemplateOutlet="
@@ -280,7 +283,10 @@
<div class="table-col coarse-col">
@if (isExtracting() && coarseKeywords().length === 0) {
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
<app-loading
[icon]="MANAGE_SEARCH_ICON"
[size]="60"
[diameter]="60" />
} @else {
<ng-container
*ngTemplateOutlet="
@@ -295,7 +301,10 @@
<div class="table-col fine-col thick-border">
@if (isExtracting() && fineKeywords().length === 0) {
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
<app-loading
[icon]="MANAGE_SEARCH_ICON"
[size]="60"
[diameter]="60" />
} @else {
<ng-container
*ngTemplateOutlet="
@@ -323,7 +332,10 @@
</ng-template>
<div class="mobile-tab-panel">
@if (isExtracting() && broadKeywords().length === 0) {
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
<app-loading
[icon]="MANAGE_SEARCH_ICON"
[size]="60"
[diameter]="60" />
} @else {
<ng-container
*ngTemplateOutlet="
@@ -344,7 +356,10 @@
</ng-template>
<div class="mobile-tab-panel">
@if (isExtracting() && coarseKeywords().length === 0) {
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
<app-loading
[icon]="MANAGE_SEARCH_ICON"
[size]="60"
[diameter]="60" />
} @else {
<ng-container
*ngTemplateOutlet="
@@ -365,7 +380,10 @@
</ng-template>
<div class="mobile-tab-panel">
@if (isExtracting() && fineKeywords().length === 0) {
<app-loading icon="manage_search" [size]="60" [diameter]="60" />
<app-loading
[icon]="MANAGE_SEARCH_ICON"
[size]="60"
[diameter]="60" />
} @else {
<ng-container
*ngTemplateOutlet="
@@ -394,7 +412,7 @@
<!-- @if (isExtracting() && !keywordsExist()) {
<app-loading
text="{{ statusMessage() }}"
icon="manage_search"
[icon]="MANAGE_SEARCH_ICON"
[size]="200"
[diameter]="200" />
} -->
@@ -425,7 +443,7 @@
class="search-btn"
[disabled]="isSearchDisabled()"
(click)="search()">
<mat-icon>search</mat-icon>
<mat-icon>{{ SEARCH_ICON }}</mat-icon>
Suchen
</button>
</div>
@@ -55,6 +55,17 @@ import { A11yModule } from '@angular/cdk/a11y';
import { DomSanitizer } from '@angular/platform-browser';
import { SearchResultsPayload } from './search-results/search-results-state.service';
import { clearPatentsCache } from './patent-search.utils';
import {
ACCOUNT_TREE_ICON,
CANCEL_ICON,
CLOSE_ICON,
DELETE_OUTLINE_ICON,
MANAGE_SEARCH_ICON,
SEARCH_ICON,
SELECT_ALL_ICON,
TEXT_FIELDS_ICON,
TROUBLESHOOT_ICON,
} from '../../shared/ui/icons';
type InputMode = 'url' | 'text' | 'file';
type KeywordCategory = 'broad' | 'coarse' | 'fine' | 'manual';
type KeywordView = 'llm' | 'topic';
@@ -89,6 +100,16 @@ type KeywordPatentLevel = 'broad' | 'coarse' | 'fine' | 'custom';
styleUrl: './keywords-search.component.scss',
})
export class KeywordsSearchComponent {
readonly CLOSE_ICON = CLOSE_ICON;
readonly TROUBLESHOOT_ICON = TROUBLESHOOT_ICON;
readonly SELECT_ALL_ICON = SELECT_ALL_ICON;
readonly DELETE_OUTLINE_ICON = DELETE_OUTLINE_ICON;
readonly TEXT_FIELDS_ICON = TEXT_FIELDS_ICON;
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
readonly CANCEL_ICON = CANCEL_ICON;
readonly MANAGE_SEARCH_ICON = MANAGE_SEARCH_ICON;
readonly SEARCH_ICON = SEARCH_ICON;
private readonly formBuilder = inject(FormBuilder);
private readonly sanitizer = inject(DomSanitizer);
private readonly route = inject(ActivatedRoute);
@@ -6,7 +6,7 @@
[options]="relevanceOptions"
[queryParamKey]="keywordsNewsQueryParamKeys.relevance"
label="Relevanz"
icon="check_circle"
[icon]="CHECK_CIRCLE_ICON"
[multiple]="true" />
<app-query-param-selector
@@ -14,7 +14,7 @@
[options]="sortOrderOptions"
[queryParamKey]="keywordsNewsQueryParamKeys.sortOrder"
label="Sortierung"
icon="sort" />
[icon]="SORT_ICON" />
</app-filter-card>
<app-year-range-slider
@@ -33,19 +33,68 @@
type="button"
(click)="resetFilters()"
aria-label="Filter zurücksetzen">
<mat-icon>filter_alt_off</mat-icon>
<mat-icon>{{ FILTER_OFF_ICON }}</mat-icon>
<span>Zurücksetzen</span>
</button>
}
</div>
<ng-template #expandTmp let-article>
@if (article.snippet) {
@let expanded = isSnippetExpanded(article);
<button
mat-icon-button
class="expand-toggle"
[attr.aria-expanded]="expanded"
[matTooltip]="
expanded ? 'Textstelle ausblenden' : 'Textstelle anzeigen'
"
[attr.aria-label]="
expanded ? 'Textstelle ausblenden' : 'Textstelle anzeigen'
">
<mat-icon class="expand-icon" [class.is-expanded]="expanded">
{{ EXPAND_MORE_ICON }}
</mat-icon>
</button>
}
</ng-template>
<ng-template #titleTmp let-article>
<div class="title-cell">
<a class="title" [routerLink]="['/news', article.id]">
<a
class="title"
[routerLink]="['/news', article.id]"
(click)="$event.stopPropagation()">
{{ article.maintitle || 'Kein Titel' }}
</a>
@if (article.snippet) {
<span class="snippet" [innerHTML]="article.snippet"></span>
</div>
</ng-template>
<ng-template #snippetTmp let-article>
<div class="snippet-detail">
@if (snippetSegments().get(article.id); as segments) {
<span class="snippet-label">Fundstelle im Artikel</span>
<p class="snippet">
@for (segment of segments; track $index) {
@if (segment.isSearchMatch) {
<mark
class="snippet-mark"
[class.has-topic]="!!segment.color"
[style.--t]="segment.color"
[matTooltip]="segment.tooltip ?? ''"
matTooltipPosition="above"
>{{ segment.text }}</mark
>
} @else {
<span>{{ segment.text }}</span>
}
}
</p>
} @else {
<span class="empty-text">
Für diesen Artikel liegt keine Textstelle zu den gesuchten Keywords
vor.
</span>
}
</div>
</ng-template>
@@ -61,12 +110,12 @@
<ng-template #relevanceTmp let-article>
@if (article.relevant === true) {
<span class="relevance-badge is-relevant">
<mat-icon>check_circle</mat-icon>
<mat-icon>{{ CHECK_CIRCLE_ICON }}</mat-icon>
Relevant
</span>
} @else if (article.relevant === false) {
<span class="relevance-badge not-relevant">
<mat-icon>cancel</mat-icon>
<mat-icon>{{ CANCEL_ICON }}</mat-icon>
Nicht relevant
</span>
} @else {
@@ -74,7 +123,7 @@
class="relevance-badge undetermined"
[matTooltip]="relevanceHelp"
matTooltipPosition="above">
<mat-icon>help</mat-icon>
<mat-icon>{{ HELP_ICON }}</mat-icon>
Nicht bestimmt
</span>
}
@@ -86,7 +135,10 @@
@let visibleTopics =
topicsExpanded ? topics : topics.slice(0, topicPreviewCount);
<div class="topic-chips" aria-label="Themen">
<div
class="topic-chips"
aria-label="Themen"
(click)="$event.stopPropagation()">
@for (topic of visibleTopics; track topic.id ?? topic.display_name) {
<app-topic-chip-2
size="mini"
@@ -113,8 +165,9 @@
mat-icon-button
color="primary"
[routerLink]="['/news', article.id]"
matTooltip="Details anzeigen">
<mat-icon>open_in_new</mat-icon>
matTooltip="Details anzeigen"
(click)="$event.stopPropagation()">
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</ng-template>
@@ -141,7 +194,10 @@
</div>
} @else {
<div class="table-wrap">
<app-data-table [columns]="columns()" [data]="elements()" />
<app-data-table
[columns]="columns()"
[data]="elements()"
[detailTemplate]="snippetTmp" />
</div>
<app-query-param-paginator
@@ -54,8 +54,7 @@
::ng-deep .table-wrap table {
width: 100%;
min-width: 960px;
border-collapse: separate;
border-spacing: 0 10px;
border-collapse: collapse;
box-shadow: none;
background: transparent;
}
@@ -77,15 +76,19 @@
}
::ng-deep .table-wrap {
.mat-column-date,
.mat-column-relevant,
.mat-mdc-header-cell {
text-align: center;
}
.mat-column-topics {
overflow: visible;
}
.mat-column-expand {
width: 48px;
padding-right: 0;
}
.detail-row .mat-mdc-cell {
padding: 0;
border-bottom: none;
}
}
/* ============================================================
@@ -114,16 +117,54 @@
}
}
.expand-icon {
color: var(--sg-text-muted);
transition: transform 150ms ease-in-out;
&.is-expanded {
transform: rotate(180deg);
}
}
/* ============================================================
EXPANDED DETAIL ROW
============================================================ */
.snippet-detail {
display: flex;
flex-direction: column;
gap: 0.375rem;
padding: 0.875rem 1rem 1rem 3rem;
background: var(--sg-surface-soft);
}
.snippet-label {
color: var(--sg-text-muted);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.02em;
text-transform: uppercase;
}
.snippet {
margin: 0;
font-size: 12.5px;
line-height: 1.5;
line-height: 1.6;
color: var(--sg-text-secondary);
overflow-wrap: anywhere;
}
::ng-deep em {
font-style: normal;
font-weight: 700;
color: var(--sg-blue-highlight);
.snippet-mark {
background: transparent;
color: var(--sg-blue-highlight);
font-weight: 700;
cursor: help;
&.has-topic {
color: var(--t);
text-decoration: underline;
text-decoration-color: var(--t);
text-decoration-thickness: 2px;
text-underline-offset: 2px;
}
}
@@ -32,9 +32,30 @@ import { NEWS_MIN_YEAR } from '../../../../shared/ui/news-card/news-card.compone
import { keywordsNewsQueryParamKeys } from '../../../../resolvers/keywords-news-page.resolver';
import { SearchResultsStateService } from '../search-results-state.service';
import { YearRangeSliderComponent } from '../../../../shared/ui/year-range-slider/year-range-slider.component';
import {
CANCEL_ICON,
CHECK_CIRCLE_ICON,
EXPAND_MORE_ICON,
FILTER_OFF_ICON,
HELP_ICON,
OPEN_IN_NEW_ICON,
SORT_ICON,
} from '../../../../shared/ui/icons';
import {
keywordTooltip,
splitByKeywords,
topicKeywordColors,
} from '../../../../resolvers/utils/keyword-highlight';
type NewsResult = NewsPage['results'][number];
interface SnippetSegment {
text: string;
color: string | null;
tooltip: string | null;
isSearchMatch: boolean;
}
@Component({
selector: 'app-news-results',
imports: [
@@ -54,6 +75,14 @@ type NewsResult = NewsPage['results'][number];
styleUrl: './news-results.component.scss',
})
export class KeywordsToNewsResultsComponent {
readonly CHECK_CIRCLE_ICON = CHECK_CIRCLE_ICON;
readonly SORT_ICON = SORT_ICON;
readonly FILTER_OFF_ICON = FILTER_OFF_ICON;
readonly EXPAND_MORE_ICON = EXPAND_MORE_ICON;
readonly CANCEL_ICON = CANCEL_ICON;
readonly HELP_ICON = HELP_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
protected readonly keywordsNewsQueryParamKeys = keywordsNewsQueryParamKeys;
private readonly state = inject(SearchResultsStateService);
@@ -136,13 +165,22 @@ export class KeywordsToNewsResultsComponent {
return baseTopicIds.length > 0 || this.selectedTopicIds().length > 0;
});
expandTmp = viewChild.required<TemplateRef<any>>('expandTmp');
titleTmp = viewChild.required<TemplateRef<any>>('titleTmp');
dateTmp = viewChild.required<TemplateRef<any>>('dateTmp');
relevanceTmp = viewChild.required<TemplateRef<any>>('relevanceTmp');
topicsTmp = viewChild.required<TemplateRef<any>>('topicsTmp');
actionsTmp = viewChild.required<TemplateRef<any>>('actionsTmp');
private readonly dataTable = viewChild(DataTableComponent);
readonly columns = computed<GenericColumn<NewsResult>[]>(() => [
{
id: 'expand',
header: '',
type: 'display',
cellTemplate: this.expandTmp(),
},
{
id: 'maintitle',
header: 'Titel',
@@ -222,6 +260,85 @@ export class KeywordsToNewsResultsComponent {
return !!topic.id && this.selectedTopicIds().includes(topic.id);
}
isSnippetExpanded(article: NewsResult): boolean {
return this.dataTable()?.expandedElement() === article;
}
readonly snippetSegments = computed(() => {
const byArticleId = new Map<string, SnippetSegment[]>();
for (const article of this.elements()) {
const segments = this.buildSnippetSegments(article);
if (segments.length) {
byArticleId.set(article.id, segments);
}
}
return byArticleId;
});
private buildSnippetSegments(article: NewsResult): SnippetSegment[] {
const snippet = article.snippet;
if (!snippet) {
return [];
}
const keywordColors = topicKeywordColors(article.topics);
const searchMatch = /<em>([\s\S]*?)<\/em>/g;
const segments: SnippetSegment[] = [];
let lastIndex = 0;
let match: RegExpExecArray | null;
const pushPlain = (raw: string) => {
const text = this.decodeHtml(raw);
if (text) {
segments.push({
text,
color: null,
tooltip: null,
isSearchMatch: false,
});
}
};
while ((match = searchMatch.exec(snippet)) !== null) {
pushPlain(snippet.slice(lastIndex, match.index));
const term = this.decodeHtml(match[1]);
const parts = splitByKeywords(term, keywordColors);
const hasTopic = parts.some((part) => part.match);
for (const part of parts) {
segments.push({
text: part.text,
color: part.match?.color ?? null,
tooltip: part.match
? keywordTooltip(part.match.keyword, part.match.topicNames)
: hasTopic
? null
: keywordTooltip(term, []),
isSearchMatch: true,
});
}
lastIndex = searchMatch.lastIndex;
}
pushPlain(snippet.slice(lastIndex));
return segments;
}
private decodeHtml(value: string): string {
return value
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#(?:39|x27);/g, "'")
.replace(/&amp;/g, '&');
}
isTopicsExpanded(article: NewsResult): boolean {
return this.expandedTopicsIds().has(article.id);
}
@@ -5,7 +5,7 @@
<p class="results-hint">Lädt…</p>
} @else if (authors().length === 0) {
<div class="results-placeholder">
<mat-icon>groups</mat-icon>
<mat-icon>{{ GROUPS_ICON }}</mat-icon>
<h2>Keine Autoren gefunden</h2>
<p>Passe die Keywords oder die Gewichtung an.</p>
</div>
@@ -19,7 +19,7 @@
color="primary"
[disabled]="!canCompare()"
(click)="compare()">
<mat-icon>insights</mat-icon>
<mat-icon>{{ INSIGHTS_ICON }}</mat-icon>
Vergleichen
</button>
</div>
@@ -67,34 +67,27 @@
<div class="filter-section-header">
<h3>Filter</h3>
<button mat-stroked-button color="primary" (click)="resetFilters()">
<mat-icon>restart_alt</mat-icon>
<mat-icon>{{ RESTART_ICON }}</mat-icon>
Zurücksetzen
</button>
</div>
<div class="weight-row filter-row pub-type-row" style="display: block">
<div class="filter-fields">
<mat-form-field
appearance="outline"
style="width: 100%; margin-bottom: -1.25em">
class="filter-field"
subscriptSizing="dynamic">
<mat-icon matPrefix>{{ ARTICLE_ICON }}</mat-icon>
<mat-label>Art der Work</mat-label>
<mat-select
multiple
[ngModel]="selectedPubTypes()"
(ngModelChange)="onPubTypesChange($event)">
<div class="pub-type-search">
<mat-icon
class="search-icon"
style="
margin-left: 16px;
margin-right: 8px;
color: rgba(0, 0, 0, 0.54);
"
>search</mat-icon
>
<mat-icon class="search-icon">{{ SEARCH_ICON }}</mat-icon>
<input
matInput
placeholder="Suchen..."
style="flex: 1; outline: none; border: none; padding: 12px 0"
[ngModel]="pubTypeSearchTerm()"
(ngModelChange)="pubTypeSearchTerm.set($event)"
(keydown)="onPubTypeKeydown($event)"
@@ -106,22 +99,24 @@
pubTypeSearchTerm.set(''); $event.stopPropagation()
"
style="margin-right: 8px; transform: scale(0.8)">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
}
</div>
@for (pt of filteredPubTypes(); track pt) {
<mat-option [value]="pt">{{ pt }}</mat-option>
@for (pt of filteredPubTypes(); track pt.type) {
<mat-option [value]="pt.type"
>{{ pt.type }} ({{ pt.count }})</mat-option
>
}
</mat-select>
</mat-form-field>
</div>
<div
class="weight-row filter-row keyword-operator-row"
style="display: block">
<mat-form-field appearance="outline" style="width: 100%">
<mat-form-field
appearance="outline"
class="filter-field"
subscriptSizing="dynamic">
<mat-icon matPrefix>{{ LINK_ICON }}</mat-icon>
<mat-label>Keyword-Verknüpfung</mat-label>
<mat-select
[ngModel]="keywordOperator()"
@@ -133,12 +128,12 @@
}
</mat-select>
</mat-form-field>
</div>
<div
class="weight-row filter-row career-stage-row"
style="display: block">
<mat-form-field appearance="outline" style="width: 100%">
<mat-form-field
appearance="outline"
class="filter-field"
subscriptSizing="dynamic">
<mat-icon matPrefix>{{ TRENDING_UP_ICON }}</mat-icon>
<mat-label>Karrierestufe</mat-label>
<mat-select
multiple
@@ -151,12 +146,12 @@
}
</mat-select>
</mat-form-field>
</div>
<div
class="weight-row filter-row company-filter-row"
style="display: block">
<mat-form-field appearance="outline" style="width: 100%">
<mat-form-field
appearance="outline"
class="filter-field"
subscriptSizing="dynamic">
<mat-icon matPrefix>{{ BUSINESS_ICON }}</mat-icon>
<mat-label>Unternehmen</mat-label>
<mat-select
[ngModel]="companyStatus()"
@@ -168,36 +163,15 @@
}
</mat-select>
</mat-form-field>
</div>
<div class="weight-row filter-row timespan-row">
<div class="weight-label">
<mat-icon class="icon-small">date_range</mat-icon>
<span>Zeitraum</span>
</div>
<div class="slider-container">
<div class="slider-labels timespan-range-label">
<span>{{ timespanFrom() }} – {{ timespanTo() }}</span>
</div>
<mat-slider
class="timespan-slider"
[min]="minYear"
[max]="maxYear"
[step]="1"
discrete>
<input
matSliderStartThumb
[value]="timespanFrom()"
(valueChange)="timespanFrom.set($event)"
(dragEnd)="onTimespanChange()" />
<input
matSliderEndThumb
[value]="timespanTo()"
(valueChange)="timespanTo.set($event)"
(dragEnd)="onTimespanChange()" />
</mat-slider>
</div>
<app-year-range-slider
class="filter-field filter-field-year"
[minYear]="minYear"
[maxYear]="maxYear"
[(startYear)]="timespanFrom"
[(endYear)]="timespanTo"
(startYearChange)="onTimespanChange()"
(endYearChange)="onTimespanChange()" />
</div>
</section>
</app-weights-sliders>
@@ -122,6 +122,14 @@
}
}
.filter-fields {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
align-items: flex-start;
width: 100%;
}
/* divider between filter rows — not before the first one */
::ng-deep .filter-section .filter-row + .filter-row {
margin-top: 0.5rem;
@@ -144,15 +152,37 @@
::ng-deep .timespan-slider {
width: 100%;
margin: 0;
}
.filter-field {
flex: 1 1 220px;
min-width: 200px;
mat-icon[matPrefix] {
margin-right: 0.4rem;
color: var(--sg-text-secondary, rgba(0, 0, 0, 0.54));
}
}
.filter-field-year {
flex: 1 1 100%;
}
::ng-deep .pub-type-search {
display: flex;
align-items: center;
gap: 0.4rem;
position: sticky;
top: 0;
z-index: 10;
background: var(--sg-surface);
padding: 0.4rem 0.6rem;
border-bottom: 1px solid var(--sg-border);
input {
flex: 1;
border: none;
outline: none;
padding: 0.4rem 0;
}
}
@@ -7,7 +7,6 @@ import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon';
import { MatSliderModule } from '@angular/material/slider';
import { MatSnackBar } from '@angular/material/snack-bar';
import { FormsModule } from '@angular/forms';
import { MatSelectModule } from '@angular/material/select';
@@ -21,15 +20,32 @@ import {
WeightsSlidersValue,
} from '../../../../shared/ui/weights-sliders/weights-sliders.component';
import { QueryParamPaginatorComponent } from '../../../../shared/ui/query-param-paginator/query-param-paginator.component';
import { YearRangeSliderComponent } from '../../../../shared/ui/year-range-slider/year-range-slider.component';
import {
CareerStage,
KeywordToAuthorRequest,
PublicationTypeCount,
PublicationTypeCountsRequest,
RankedAuthor,
RankingService,
} from '../../../../api';
import { SearchResultsStateService } from '../search-results-state.service';
import {
ARTICLE_ICON,
BUSINESS_ICON,
CITATION_ICON,
CLOSE_ICON,
GROUPS_ICON,
INSIGHTS_ICON,
LINK_ICON,
PATENT_ICON,
RESTART_ICON,
SEARCH_ICON,
TRENDING_UP_ICON,
VISIBILITY_ICON,
} from '../../../../shared/ui/icons';
@Component({
selector: 'app-persons-results',
@@ -41,18 +57,28 @@ import { SearchResultsStateService } from '../search-results-state.service';
MatCardModule,
MatCheckboxModule,
MatIconModule,
MatSliderModule,
FormsModule,
MatSelectModule,
MatInputModule,
MatFormFieldModule,
QueryParamPaginatorComponent,
WeightsSlidersComponent,
YearRangeSliderComponent,
],
templateUrl: './persons-results.component.html',
styleUrl: './persons-results.component.scss',
})
export class KeywordsToPersonsResultsComponent implements OnInit {
readonly GROUPS_ICON = GROUPS_ICON;
readonly INSIGHTS_ICON = INSIGHTS_ICON;
readonly RESTART_ICON = RESTART_ICON;
readonly ARTICLE_ICON = ARTICLE_ICON;
readonly SEARCH_ICON = SEARCH_ICON;
readonly CLOSE_ICON = CLOSE_ICON;
readonly LINK_ICON = LINK_ICON;
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
readonly BUSINESS_ICON = BUSINESS_ICON;
// injects the state set by the parent route — no duplicate parsing here
private readonly state = inject(SearchResultsStateService);
private readonly rankingService = inject(RankingService);
@@ -96,7 +122,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
{
key: 'works',
label: 'Works',
icon: 'article',
icon: ARTICLE_ICON,
description:
'Gewichtet die Anzahl und Relevanz wissenschaftlicher Arbeiten.',
defaultValue: 0.5,
@@ -105,7 +131,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
{
key: 'citations',
label: 'Zitationen',
icon: 'format_quote',
icon: CITATION_ICON,
description: 'Gewichtet wissenschaftlichen Einfluss über Zitationen.',
defaultValue: 0.5,
queryParamName: 'wCitations',
@@ -113,26 +139,29 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
{
key: 'companies',
label: 'Unternehmensgründungen',
icon: 'business',
icon: BUSINESS_ICON,
description:
'Gewichtet die Anzahl der Unternehmensgründungen (Handelsregister-Verbindungen).',
nameMatched: true,
defaultValue: 0.5,
queryParamName: 'wCompanies',
},
{
key: 'news',
label: 'Medien-Sichtbarkeit',
icon: 'visibility',
icon: VISIBILITY_ICON,
description:
'Gewichtet die öffentliche Sichtbarkeit über Nennungen in Nachrichtenartikeln.',
nameMatched: true,
defaultValue: 0.5,
queryParamName: 'wNews',
},
{
key: 'patents',
label: 'Patente',
icon: 'workspace_premium',
icon: PATENT_ICON,
description: 'Gewichtet Innovations- und Transferleistung über Patente.',
nameMatched: true,
defaultValue: 0.5,
queryParamName: 'wPatents',
},
@@ -174,33 +203,8 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
];
readonly companyStatus = signal<'all' | 'active' | 'deleted'>('all');
// publication types
readonly ALL_PUBLICATION_TYPES = [
'article',
'other',
'dataset',
'book-chapter',
'book',
'dissertation',
'preprint',
'paratext',
'libguides',
'review',
'letter',
'reference-entry',
'editorial',
'peer-review',
'report',
'standard',
'erratum',
'retraction',
'supplementary-materials',
'book-section',
'database',
'software',
'report-component',
'grant',
];
// publication types: counted from the index (count-by), largest first
readonly publicationTypeCounts = signal<PublicationTypeCount[]>([]);
readonly pubTypeSearchTerm = signal('');
@@ -213,10 +217,9 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
readonly filteredPubTypes = computed(() => {
const term = this.pubTypeSearchTerm().toLowerCase();
if (!term) return this.ALL_PUBLICATION_TYPES;
return this.ALL_PUBLICATION_TYPES.filter((pt) =>
pt.toLowerCase().includes(term),
);
const counts = this.publicationTypeCounts();
if (!term) return counts;
return counts.filter((pt) => pt.type.toLowerCase().includes(term));
});
onPubTypesChange(selected: string[]) {
@@ -253,6 +256,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
replaceUrl: true,
});
this.loadAuthors();
this.loadPublicationTypeCounts();
}
readonly CAREER_STAGE_OPTIONS = [
@@ -314,6 +318,8 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
if (operator === 'and' || operator === 'or') {
this.keywordOperator.set(operator);
}
this.loadPublicationTypeCounts();
}
// reads a year query param, clamped to the valid range; falls back on invalid input
@@ -400,6 +406,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
}
this.writeTimespanToUrl();
this.loadAuthors();
this.loadPublicationTypeCounts();
}
// the backend returns the full OpenAlex url; the profile route needs only the id
@@ -494,4 +501,30 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
},
});
}
// counts, by publication type, of the works matching the current keyword/
// career-stage/timespan filters — drives the "Art der Work" filter options
private loadPublicationTypeCounts(): void {
const request: PublicationTypeCountsRequest = {
keywords: this.state.topicsList(),
operator: this.keywordOperator(),
filter_type: 'topic',
career_stages:
this.careerStages().length > 0 ? this.careerStages() : undefined,
timespan: {
from: this.timespanFrom(),
to: this.timespanTo(),
},
};
this.rankingService
.publicationTypeCountsApiRankPublicationTypeCountsPost(request)
.subscribe({
next: (counts) => this.publicationTypeCounts.set(counts),
error: (error) => {
console.error(error);
this.publicationTypeCounts.set([]);
},
});
}
}
@@ -1,7 +1,7 @@
import { Injectable, computed, signal } from '@angular/core';
import { KeywordEntryWithTopic } from '../../../api/model/keywordEntryWithTopic';
import { Topic } from '../../../api';
import { TopicHierarchyColorInput } from '../../../resolvers/utils/topic-colors';
export type KeywordPatentLevel = 'broad' | 'coarse' | 'fine' | 'custom';
export interface PatentKeywordEntry {
@@ -127,14 +127,69 @@ export class SearchResultsStateService {
});
readonly keywordsList = this.keywords;
readonly keywordTopicMap = computed(() => {
const map = new Map<string, Topic>();
for (const entry of this.selectedKeywordEntries()) {
const keyword = entry.llm_keyword?.keyword?.trim().toLowerCase();
const topic = entry.topic_mapping?.topic;
if (keyword && topic) {
map.set(this.normalize(keyword), topic);
}
}
return map;
});
private normalize(str: string): string {
return str.toLowerCase().replace(/[^a-z0-9]+/g, '');
}
private toTopicInput(topic: Topic): TopicHierarchyColorInput {
return {
id: topic.id,
name: topic.display_name,
field_id: topic.field?.id,
field_name: topic.field?.display_name,
domain_id: topic.domain?.id,
domain_name: topic.domain?.display_name,
};
}
// Resolve a topic for a given keyword term, using the following strategy:
// 1. Exact / case-insensitive match (cheap, most common case)
// 2. Normalized match — catches "machine learning" vs "machine-learning"
// 3. Last-resort fuzzy substring match, also normalized
public resolveTopicForTerm(term: string): TopicHierarchyColorInput | null {
const directMap = this.keywordTopicMap();
// 1. Exact / case-insensitive match (cheap, most common case)
const exact = directMap.get(term) ?? directMap.get(term.toLowerCase());
if (exact) return this.toTopicInput(exact);
// 2. Normalized match — catches "machine learning" vs "machine-learning"
const normalizedTerm = this.normalize(term);
if (normalizedTerm) {
const normalized = directMap.get(normalizedTerm);
if (normalized) return this.toTopicInput(normalized);
// 3. Last-resort fuzzy substring match, also normalized
for (const [keyword, mappedTopic] of directMap) {
const normalizedKeyword = this.normalize(keyword);
if (normalizedKeyword) {
if (
normalizedKeyword.includes(normalizedTerm) ||
normalizedTerm.includes(normalizedKeyword)
) {
return this.toTopicInput(mappedTopic);
}
}
}
}
return null;
}
// Parallel topic-name list for trend dashboard strategies. Entries
// without a resolvable keyword are skipped when building the lookup map
// so they can never collide on an `undefined` key and shadow a real one.
readonly topicsList = computed(() => {
const list = this.keywords()
.map((kw) => {
const normalized = kw.trim().toLowerCase();
const normalized = this.normalize(kw);
const entry = this.selectedKeywordEntries().find(
(e) =>
e.llm_keyword?.keyword?.trim().toLowerCase() === normalized ||
@@ -1,7 +1,7 @@
<div class="search-results-page">
<div class="search-results-header">
<button mat-stroked-button color="primary" (click)="goBackToSearch()">
<mat-icon>arrow_back</mat-icon>
<mat-icon>{{ ARROW_BACK_ICON }}</mat-icon>
Keywords anpassen
</button>
</div>
@@ -22,9 +22,14 @@
<span class="mode-badge">
<mat-slide-toggle
labelPosition="before"
matTooltip="Wenn aktiviert, werden die extrahierten Keywords auf bekannte Themenbereiche abgebildet, man kann dann nach Themen filtern. Wenn deaktiviert, werden die Keywords direkt für die Suche verwendet."
[matTooltip]="
isPersonsTab()
? 'Auf dem Personen-Tab wird immer nach Themen gerankt, daher ist Fuzzy Search hier fest aktiviert.'
: 'Wenn aktiviert, werden die extrahierten Keywords auf bekannte Themenbereiche abgebildet, man kann dann nach Themen filtern. Wenn deaktiviert, werden die Keywords direkt für die Suche verwendet.'
"
(change)="onToggleFuzzySearch($event)"
[checked]="state.fuzzySearch()">
[checked]="state.fuzzySearch()"
[disabled]="isPersonsTab()">
Fuzzy Search
</mat-slide-toggle>
</span>
@@ -72,8 +77,8 @@
[active]="rla.isActive"
[queryParams]="{
keywords: state.payload()?.keywords?.join(','),
fuzzy: state.payload()?.options?.fuzzy,
topics: state.payload()?.options?.fuzzy ? state.topicIds() : null,
fuzzy: tabFuzzyValue(route),
topics: tabFuzzyValue(route) ? state.topicIds() : null,
topicId: null,
}"
queryParamsHandling="replace">
@@ -89,7 +94,7 @@
} @else {
<mat-card class="empty-card">
<mat-card-content class="empty-state">
<mat-icon>manage_search</mat-icon>
<mat-icon>{{ MANAGE_SEARCH_ICON }}</mat-icon>
<h2>Keine Suchdaten</h2>
<p>Starte eine neue Suche, um Ergebnisse zu sehen.</p>
<button mat-flat-button color="primary" (click)="goBackToSearch()">
@@ -24,6 +24,16 @@ import {
SearchResultsPayload,
SearchResultsStateService,
} from './search-results-state.service';
import {
ARTICLE_ICON,
ARROW_BACK_ICON,
BAR_CHART_ICON,
MANAGE_SEARCH_ICON,
NEWS_ICON,
PATENT_ICON,
PERSONS_ICON,
PROJECT_ICON,
} from '../../../shared/ui/icons';
@Component({
selector: 'app-keywords-search-results',
@@ -45,6 +55,9 @@ import {
styleUrl: './search-results.component.scss',
})
export class KeywordsSearchResultsComponent {
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
readonly MANAGE_SEARCH_ICON = MANAGE_SEARCH_ICON;
private readonly router = inject(Router);
private readonly route = inject(ActivatedRoute);
@@ -55,14 +68,16 @@ export class KeywordsSearchResultsComponent {
private readonly HANDOFF_KEY = 'search-results-handoff';
protected readonly childRoutes = [
{ path: 'persons', label: 'Personen', icon: 'groups' },
{ path: 'projects', label: 'Projekte', icon: 'work' },
{ path: 'patents', label: 'Patente', icon: 'workspace_premium' },
{ path: 'works', label: 'Publikationen', icon: 'article' },
{ path: 'news', label: 'Nachrichten', icon: 'newspaper' },
{ path: 'trends', label: 'Visualisierung', icon: 'bar_chart' },
{ path: 'persons', label: 'Personen', icon: PERSONS_ICON },
{ path: 'projects', label: 'Projekte', icon: PROJECT_ICON },
{ path: 'patents', label: 'Patente', icon: PATENT_ICON },
{ path: 'works', label: 'Publikationen', icon: ARTICLE_ICON },
{ path: 'news', label: 'Nachrichten', icon: NEWS_ICON },
{ path: 'trends', label: 'Visualisierung', icon: BAR_CHART_ICON },
];
private readonly lastUserFuzzy = signal(false);
readonly selectedKeywordCount = computed(() => this.state.keywords().length);
readonly allKeywordEntries = computed(() => {
const seen = new Set<string>();
@@ -85,7 +100,12 @@ export class KeywordsSearchResultsComponent {
// previous search never gets silently applied to a new one.
this.route.queryParamMap.pipe(takeUntilDestroyed()).subscribe((params) => {
const keywords = this.parseKeywordList(params.get('keywords'));
const fuzzySearch = params.get('fuzzy') === 'true';
const onPersonsTab = this.isPersonsTab();
const fuzzySearch = onPersonsTab || params.get('fuzzy') === 'true';
if (!onPersonsTab) {
this.lastUserFuzzy.set(params.get('fuzzy') === 'true');
}
const cached = this.readHandoffCache();
const cacheMatches =
@@ -100,8 +120,22 @@ export class KeywordsSearchResultsComponent {
? cached!.patentKeywordEntries
: undefined,
});
if (onPersonsTab && params.get('fuzzy') !== 'true') {
this.updateQueryParams(true);
}
});
}
// the Fuzzy Search toggle is locked on while the Personen tab is active
isPersonsTab(): boolean {
return this.route.snapshot.firstChild?.routeConfig?.path === 'persons';
}
tabFuzzyValue(route: { path: string }): boolean {
if (route.path === 'persons') return true;
return this.lastUserFuzzy();
}
goBackToSearch(): void {
void this.router.navigate(['/keywords'], {
queryParamsHandling: 'merge',
@@ -4,19 +4,19 @@
class="back-link"
(click)="navigateBack()"
aria-label="Zurück zu den Nachrichten">
<mat-icon>arrow_back</mat-icon>
<mat-icon>{{ ARROW_BACK_ICON }}</mat-icon>
Alle Nachrichten
</button>
@if (loading) {
<app-loading
text="Nachricht wird geladen..."
icon="newspaper"
[icon]="NEWS_ICON"
[size]="60"
[diameter]="60" />
} @else if (notFound || !article) {
<div class="state error-state">
<mat-icon>search_off</mat-icon>
<mat-icon>{{ SEARCH_OFF_ICON }}</mat-icon>
<h2>Nachricht nicht gefunden</h2>
<p>Der Artikel konnte nicht geladen werden.</p>
<a mat-stroked-button routerLink="/persons">Zur Personensuche</a>
@@ -37,17 +37,17 @@
@if (article.relevant === true) {
<span class="relevance-badge is-relevant">
<mat-icon>check_circle</mat-icon>
<mat-icon>{{ CHECK_CIRCLE_ICON }}</mat-icon>
Relevant
</span>
} @else if (article.relevant === false) {
<span class="relevance-badge not-relevant">
<mat-icon>cancel</mat-icon>
<mat-icon>{{ CANCEL_ICON }}</mat-icon>
Nicht relevant
</span>
} @else {
<span class="relevance-badge undetermined">
<mat-icon>help</mat-icon>
<mat-icon>{{ HELP_ICON }}</mat-icon>
Relevanz nicht bestimmt
</span>
}
@@ -55,10 +55,11 @@
<div class="article-body">
@if (article.full_content) {
<p
<app-highlighted-text
#articleBody
class="content"
[innerHTML]="highlightedContent"></p>
[content]="article.full_content"
[highlights]="articleHighlights" />
} @else {
<p class="placeholder">Kein Inhalt verfügbar.</p>
}
@@ -71,7 +72,7 @@
[href]="article.url"
target="_blank"
rel="noopener">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
Originalartikel öffnen
</a>
</div>
@@ -86,14 +87,14 @@
class="accordion-header"
(click)="openPanel = openPanel === 'persons' ? null : 'persons'"
[attr.aria-expanded]="openPanel === 'persons'">
<mat-icon>group</mat-icon>
<mat-icon>{{ GROUP_ICON }}</mat-icon>
<span class="accordion-title">Erwähnte Personen</span>
<mat-icon
class="info-icon"
matTooltip="Personen, die im Text erwähnt wurden. Klicke auf eine der UDE angehörige Person, um zu ihrem Profil zu gelangen."
matTooltipPosition="above"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
@if (article.authors?.length) {
<span class="count-badge">{{ article.authors!.length }}</span>
@@ -101,7 +102,7 @@
<mat-icon
class="chevron"
[class.rotated]="openPanel !== 'persons'"
>expand_more</mat-icon
>{{ EXPAND_MORE_ICON }}</mat-icon
>
</button>
@if (openPanel === 'persons') {
@@ -140,7 +141,7 @@
class="page-btn"
[disabled]="personsPage === 0"
(click)="personsPage = personsPage - 1">
<mat-icon>chevron_left</mat-icon>
<mat-icon>{{ CHEVRON_LEFT_ICON }}</mat-icon>
</button>
<span class="page-indicator"
>{{ personsPage + 1 }} / {{ personsPageCount }}</span
@@ -150,7 +151,7 @@
class="page-btn"
[disabled]="personsPage === personsPageCount - 1"
(click)="personsPage = personsPage + 1">
<mat-icon>chevron_right</mat-icon>
<mat-icon>{{ CHEVRON_RIGHT_ICON }}</mat-icon>
</button>
</div>
}
@@ -169,20 +170,22 @@
class="accordion-header"
(click)="openPanel = openPanel === 'topics' ? null : 'topics'"
[attr.aria-expanded]="openPanel === 'topics'">
<mat-icon>label</mat-icon>
<mat-icon>{{ LABEL_ICON }}</mat-icon>
<span class="accordion-title">Themen & Schlüsselwörter</span>
<mat-icon
class="info-icon"
matTooltip="Themen, die mit den extrahierten Schlüsselwörtern des Artikels assoziiert werden. Klicke auf ein Schlüsselwort, um zum hervorgehobenen Begriff im Text zu springen."
matTooltipPosition="above"
(click)="$event.stopPropagation()"
>info_outline</mat-icon
>{{ INFO_OUTLINE_ICON }}</mat-icon
>
@if (article.topics?.length) {
<span class="count-badge">{{ article.topics!.length }}</span>
}
<mat-icon class="chevron" [class.rotated]="openPanel !== 'topics'"
>expand_more</mat-icon
<mat-icon
class="chevron"
[class.rotated]="openPanel !== 'topics'"
>{{ EXPAND_MORE_ICON }}</mat-icon
>
</button>
@if (openPanel === 'topics') {
@@ -206,8 +209,8 @@
}}</span>
<mat-icon>{{
expandedTopicId === topic.id
? 'expand_less'
: 'expand_more'
? EXPAND_LESS_ICON
: EXPAND_MORE_ICON
}}</mat-icon>
</button>
@if (expandedTopicId === topic.id) {
@@ -221,7 +224,7 @@
class="analyse-btn"
matTooltip="Suche nach dem Schlüsselwort"
(click)="analyseKeyword(topic.source_keyword)">
<mat-icon>search</mat-icon>
<mat-icon>{{ SEARCH_ICON }}</mat-icon>
</button>
<button
type="button"
@@ -587,8 +587,6 @@ main {
--topic-color: var(--sg-error);
}
// ── Keyword highlights in article text ───────────────────────────────────────
@keyframes kw-flash {
0% {
background: color-mix(in srgb, var(--t) 45%, var(--sg-color-mix-base));
@@ -600,25 +598,3 @@ main {
background: transparent;
}
}
:host ::ng-deep .kw-mark {
background: transparent;
color: var(--t);
text-decoration: underline;
text-decoration-color: var(--t);
text-decoration-style: solid;
text-decoration-thickness: 2px;
text-underline-offset: 2px;
font-weight: inherit;
border-radius: 2px;
padding: 0 1px;
transition: background 0.15s;
&:hover {
background: color-mix(in srgb, var(--t) 15%, var(--sg-color-mix-base));
}
&.kw-flash {
animation: kw-flash 2.4s ease-out forwards;
}
}
@@ -12,11 +12,34 @@ import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import {
HighlightedTextComponent,
HighlightTerm,
} from '../../shared/ui/highlighted-text/highlighted-text.component';
import { WorksService } from '../../api';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import {
highlightKeywords,
topicKeywordColors,
} from '../../resolvers/utils/keyword-highlight';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import {
ARROW_BACK_ICON,
CANCEL_ICON,
CHECK_CIRCLE_ICON,
CHEVRON_LEFT_ICON,
CHEVRON_RIGHT_ICON,
EXPAND_LESS_ICON,
EXPAND_MORE_ICON,
GROUP_ICON,
HELP_ICON,
INFO_OUTLINE_ICON,
LABEL_ICON,
NEWS_ICON,
OPEN_IN_NEW_ICON,
SEARCH_ICON,
SEARCH_OFF_ICON,
} from '../../shared/ui/icons';
interface MentionedPerson {
name: string;
@@ -54,21 +77,37 @@ interface NewsArticleDetail {
MatTooltipModule,
RouterLink,
LoadingComponent,
HighlightedTextComponent,
],
templateUrl: './news-detail.component.html',
styleUrl: './news-detail.component.scss',
})
export class NewsDetailComponent implements OnInit {
@ViewChild('articleBody') articleBodyRef?: ElementRef<HTMLElement>;
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
readonly NEWS_ICON = NEWS_ICON;
readonly SEARCH_OFF_ICON = SEARCH_OFF_ICON;
readonly CHECK_CIRCLE_ICON = CHECK_CIRCLE_ICON;
readonly CANCEL_ICON = CANCEL_ICON;
readonly HELP_ICON = HELP_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly GROUP_ICON = GROUP_ICON;
readonly INFO_OUTLINE_ICON = INFO_OUTLINE_ICON;
readonly EXPAND_MORE_ICON = EXPAND_MORE_ICON;
readonly EXPAND_LESS_ICON = EXPAND_LESS_ICON;
readonly CHEVRON_LEFT_ICON = CHEVRON_LEFT_ICON;
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
readonly LABEL_ICON = LABEL_ICON;
readonly SEARCH_ICON = SEARCH_ICON;
@ViewChild('articleBody', { read: ElementRef })
articleBodyRef?: ElementRef<HTMLElement>;
private readonly router = inject(Router);
private readonly destroyRef = inject(DestroyRef);
private readonly route = inject(ActivatedRoute);
private readonly httpClient = inject(HttpClient);
private readonly worksService = inject(WorksService);
private readonly sanitizer = inject(DomSanitizer);
article: NewsArticleDetail | null = null;
highlightedContent: SafeHtml = this.sanitizer.bypassSecurityTrustHtml('');
loading = false;
notFound = false;
@@ -172,7 +211,6 @@ export class NewsDetailComponent implements OnInit {
.subscribe({
next: (article) => {
this.article = article;
this.highlightedContent = this.buildHighlightedContent(article);
this.expandedTopicId = null;
this.personsPage = 0;
this.loading = false;
@@ -184,56 +222,33 @@ export class NewsDetailComponent implements OnInit {
});
}
private buildHighlightedContent(article: NewsArticleDetail): SafeHtml {
const text = article.full_content;
if (!text) return this.sanitizer.bypassSecurityTrustHtml('');
const keywords = article.keywords ?? [];
get articleHighlights(): HighlightTerm[] {
const article = this.article;
if (!article) return [];
const keywordColorMap = new Map<string, string>();
const topicByKeyword = new Map<string, MatchedTopic>();
for (const topic of article.topics ?? []) {
if (topic.source_keyword) {
keywordColorMap.set(
topic.source_keyword.toLowerCase(),
this.getTopicColor(topic),
);
topicByKeyword.set(topic.source_keyword.toLowerCase(), topic);
}
}
let html = this.escapeHtml(text);
[...keywords]
.sort((a, b) => b.length - a.length)
.forEach((kw) => {
const color = keywordColorMap.get(kw.toLowerCase());
if (!color) return;
const kwHtml = this.escapeHtml(kw);
const escaped = this.escapeRegex(kwHtml);
const before = '(?<![\\w\\u00C0-\\u024F])';
const acronymLike =
kw.length <= 3 ||
(kw === kw.toUpperCase() && kw !== kw.toLowerCase());
const re = new RegExp(
acronymLike
? `${before}(${escaped})(?![\\w\\u00C0-\\u024F])`
: `${before}(${escaped}[\\w\\u00C0-\\u024F]*)`,
'gi',
);
html = html.replace(
re,
`<mark class="kw-mark" style="--t:${color}" data-kw="${kwHtml}">$1</mark>`,
);
const highlights: HighlightTerm[] = [];
for (const keyword of article.keywords ?? []) {
const topic = topicByKeyword.get(keyword.toLowerCase());
if (!topic) continue;
highlights.push({
term: keyword,
topic: {
id: topic.id,
name: topic.display_name,
field_name: topic.field_name,
domain_name: topic.domain_name,
},
});
return this.sanitizer.bypassSecurityTrustHtml(html);
}
}
private escapeHtml(text: string): string {
return text
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;');
}
private escapeRegex(text: string): string {
return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
return highlights;
}
}
@@ -24,7 +24,7 @@
[options]="relevanceOptions"
queryParamKey="relevance"
label="Relevanz"
icon="check_circle"
[icon]="CHECK_CIRCLE_ICON"
[multiple]="true" />
@if (!isSearching()) {
@@ -33,7 +33,7 @@
[options]="sortingDirectionOptionsAll"
queryParamKey="sorting_order"
label="Sortierung"
icon="sort" />
[icon]="SORT_ICON" />
}
</app-filter-card>
@@ -28,6 +28,7 @@ import {
} from '../../shared/ui/query-param-selector/query-param-selector.component';
import { FilterCardComponent } from '../../shared/ui/filter-card/filter-card.component';
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
import { CHECK_CIRCLE_ICON, SORT_ICON } from '../../shared/ui/icons';
interface NewsArticle extends NewsArticleBase {
author?: string | null;
@@ -56,6 +57,9 @@ type SortOrder = 'desc' | 'asc';
styleUrl: './news.component.scss',
})
export class NewsComponent implements OnInit {
readonly CHECK_CIRCLE_ICON = CHECK_CIRCLE_ICON;
readonly SORT_ICON = SORT_ICON;
private readonly destroyRef = inject(DestroyRef);
private readonly route = inject(ActivatedRoute);
private readonly router = inject(Router);
@@ -32,7 +32,7 @@
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Institution hinzufügen</mat-label>
<mat-icon matPrefix>search</mat-icon>
<mat-icon matPrefix>{{ SEARCH_ICON }}</mat-icon>
<input
matInput
type="text"
@@ -64,7 +64,7 @@
<div class="institution-list" aria-live="polite">
@for (entry of institutions(); track entry.id) {
<article class="institution-item">
<mat-icon class="institution-icon">apartment</mat-icon>
<mat-icon class="institution-icon">{{ APARTMENT_ICON }}</mat-icon>
<div class="institution-details">
<strong>{{ entry.institution.display_name }}</strong>
<span class="institution-id">{{ entry.id }}</span>
@@ -86,7 +86,7 @@
type="button"
aria-label="Manuelle Auswahl entfernen"
(click)="removeInstitution(entry)">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
}
</article>
@@ -112,7 +112,7 @@
type="button"
[disabled]="isLoadingAssociations()"
(click)="submit()">
<mat-icon>save</mat-icon>
<mat-icon>{{ SAVE_ICON }}</mat-icon>
Speichern
</button>
</mat-dialog-actions>
@@ -44,6 +44,12 @@ import {
UpdateOrganizationRequest,
} from '../../../api';
import { InstitutionRemovalDialogComponent } from './institution-removal-dialog.component';
import {
APARTMENT_ICON,
CLOSE_ICON,
SAVE_ICON,
SEARCH_ICON,
} from '../../../shared/ui/icons';
type Relationship = InstitutionAssociation.RelationshipEnum;
@@ -58,10 +64,11 @@ interface EditableInstitution {
institution: Institution;
manuallySelected: boolean;
origins: InstitutionOrigin[];
relationship?: Relationship;
}
interface OriginLabel {
relationship: 'selected' | Relationship;
relationship: Relationship | 'selected';
label: string;
tooltip?: string;
}
@@ -109,6 +116,11 @@ const cleanInstitutionId = (id: string): string =>
standalone: true,
})
export class OrganizationDialogComponent {
readonly SEARCH_ICON = SEARCH_ICON;
readonly APARTMENT_ICON = APARTMENT_ICON;
readonly CLOSE_ICON = CLOSE_ICON;
readonly SAVE_ICON = SAVE_ICON;
private readonly dialogRef =
inject<
MatDialogRef<
@@ -2,13 +2,16 @@
<header class="page-header">
<h1>Organisationen</h1>
<div class="page-header-meta">
<p>Organisationen verwalten, OpenAlex-Institutionen zuordnen und Status festlegen</p>
<p>
Organisationen verwalten, OpenAlex-Institutionen zuordnen und Status
festlegen
</p>
<button
mat-flat-button
color="primary"
type="button"
(click)="startCreate()">
<mat-icon>add_business</mat-icon>
<mat-icon>{{ ADD_BUSINESS_ICON }}</mat-icon>
Neue Organisation
</button>
</div>
@@ -63,7 +66,7 @@
type="button"
aria-label="Bearbeiten"
(click)="startEdit(row)">
<mat-icon>edit</mat-icon>
<mat-icon>{{ EDIT_ICON }}</mat-icon>
</button>
<button
mat-icon-button
@@ -71,7 +74,7 @@
aria-label="Deaktivieren"
[disabled]="row.deleted || isCurrentOrganization(row)"
(click)="deleteOrganization(row)">
<mat-icon>delete</mat-icon>
<mat-icon>{{ DELETE_ICON }}</mat-icon>
</button>
</div>
</ng-template>
@@ -30,6 +30,11 @@ import {
OrganizationWithInstitutions,
} from '../../resolvers/organizations-organizations.resolver';
import { CredentialService } from '../../shared/services/credential.service';
import {
ADD_BUSINESS_ICON,
DELETE_ICON,
EDIT_ICON,
} from '../../shared/ui/icons';
@Component({
selector: 'app-organizations',
@@ -49,6 +54,10 @@ import { CredentialService } from '../../shared/services/credential.service';
standalone: true,
})
export class OrganizationsComponent implements OnInit {
readonly ADD_BUSINESS_ICON = ADD_BUSINESS_ICON;
readonly EDIT_ICON = EDIT_ICON;
readonly DELETE_ICON = DELETE_ICON;
private readonly router = inject(Router);
private readonly dialog = inject(MatDialog);
private readonly snackBar = inject(MatSnackBar);
@@ -125,10 +134,7 @@ export class OrganizationsComponent implements OnInit {
protected deleteOrganization(
organization: OrganizationWithInstitutions,
): void {
if (
organization.deleted ||
this.isCurrentOrganization(organization)
) {
if (organization.deleted || this.isCurrentOrganization(organization)) {
return;
}
@@ -216,8 +222,8 @@ export class OrganizationsComponent implements OnInit {
this.isProtectedOrganizationError(error)
? 'Die eigene Organisation kann nicht deaktiviert werden.'
: error.status === 409
? 'Eine Organisation mit diesem Namen existiert bereits.'
: 'Organisation konnte nicht gespeichert werden.',
? 'Eine Organisation mit diesem Namen existiert bereits.'
: 'Organisation konnte nicht gespeichert werden.',
),
});
}
@@ -4,19 +4,19 @@
class="back-link"
(click)="navigateBack()"
aria-label="Zurück zu den Patenten">
<mat-icon>arrow_back</mat-icon>
<mat-icon>{{ ARROW_BACK_ICON }}</mat-icon>
Alle Patente
</button>
@if (loading) {
<app-loading
text="Patent wird geladen..."
icon="workspace_premium"
[icon]="PATENT_ICON"
[size]="60"
[diameter]="60" />
} @else if (notFound || !patent) {
<div class="state error-state">
<mat-icon>search_off</mat-icon>
<mat-icon>{{ SEARCH_OFF_ICON }}</mat-icon>
<h2>Patent nicht gefunden</h2>
<p>Das Patent konnte nicht geladen werden.</p>
<a mat-stroked-button routerLink="/patents"> Zur Patentübersicht </a>
@@ -55,7 +55,7 @@
target="_blank"
rel="noopener">
{{ link.label }}
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
}
</div>
@@ -63,17 +63,17 @@
<div class="metrics" aria-label="Patentkennzahlen">
<div>
<mat-icon>groups</mat-icon>
<mat-icon>{{ GROUPS_ICON }}</mat-icon>
<strong>{{ patent.inventors?.length ?? 0 }}</strong>
<span>Erfinder</span>
</div>
<div>
<mat-icon>business</mat-icon>
<mat-icon>{{ BUSINESS_ICON }}</mat-icon>
<strong>{{ patent.assignees?.length ?? 0 }}</strong>
<span>Anmelder</span>
</div>
<div>
<mat-icon>category</mat-icon>
<mat-icon>{{ CATEGORY_ICON }}</mat-icon>
<strong>{{
(patent.ipc?.length ?? 0) + (patent.cpc?.length ?? 0)
}}</strong>
@@ -87,7 +87,7 @@
@if (patent.abstract) {
<section class="card abstract-card">
<div class="section-title">
<mat-icon>subject</mat-icon>
<mat-icon>{{ SUBJECT_ICON }}</mat-icon>
<h2>Abstract</h2>
</div>
<p>{{ patent.abstract }}</p>
@@ -96,7 +96,7 @@
<section class="card">
<div class="section-title">
<mat-icon>engineering</mat-icon>
<mat-icon>{{ ENGINEERING_ICON }}</mat-icon>
<h2>Erfinder</h2>
<span>{{ patent.inventors?.length ?? 0 }}</span>
</div>
@@ -112,7 +112,7 @@
@if (patent.assignees?.length) {
<section class="card">
<div class="section-title">
<mat-icon>account_balance</mat-icon>
<mat-icon>{{ ACCOUNT_BALANCE_ICON }}</mat-icon>
<h2>Anmelder</h2>
<span>{{ patent.assignees?.length ?? 0 }}</span>
</div>
@@ -129,7 +129,7 @@
@if (patent.openalex_topics?.length) {
<section class="card">
<div class="section-title">
<mat-icon>topic</mat-icon>
<mat-icon>{{ TOPIC_ICON }}</mat-icon>
<h2>OpenAlex Themen</h2>
</div>
<div class="tags">
@@ -154,7 +154,7 @@
<section
class="card classification-card-section classification-card-section--ipc">
<div class="section-title">
<mat-icon>label</mat-icon>
<mat-icon>{{ LABEL_ICON }}</mat-icon>
<h2>Klassifikation (IPC)</h2>
</div>
<div class="classification-cards">
@@ -228,7 +228,7 @@
} @else if (patent.ipc?.length) {
<section class="card">
<div class="section-title">
<mat-icon>label</mat-icon>
<mat-icon>{{ LABEL_ICON }}</mat-icon>
<h2>Klassifikation (IPC)</h2>
</div>
<div class="tags">
@@ -243,7 +243,7 @@
<section
class="card classification-card-section classification-card-section--cpc">
<div class="section-title">
<mat-icon>label</mat-icon>
<mat-icon>{{ LABEL_ICON }}</mat-icon>
<h2>Klassifikation (CPC)</h2>
</div>
<div class="classification-cards">
@@ -317,7 +317,7 @@
} @else if (patent.cpc?.length) {
<section class="card">
<div class="section-title">
<mat-icon>label</mat-icon>
<mat-icon>{{ LABEL_ICON }}</mat-icon>
<h2>Klassifikation (CPC)</h2>
</div>
<div class="tags">
@@ -332,7 +332,7 @@
<aside>
<section class="card facts-card">
<div class="section-title">
<mat-icon>info</mat-icon>
<mat-icon>{{ INFO_ICON }}</mat-icon>
<h2>Patentdaten</h2>
</div>
<dl>
@@ -359,14 +359,14 @@
@if (externalLinks().length) {
<section class="card">
<div class="section-title">
<mat-icon>link</mat-icon>
<mat-icon>{{ LINK_ICON }}</mat-icon>
<h2>Externe Links</h2>
</div>
<div class="link-list">
@for (link of externalLinks(); track link.url) {
<a [href]="link.url" target="_blank" rel="noopener">
<span>{{ link.label }}</span>
<mat-icon>north_east</mat-icon>
<mat-icon>{{ NORTH_EAST_ICON }}</mat-icon>
</a>
}
</div>
@@ -15,6 +15,23 @@ import {
topicHierarchyColor,
} from '../../resolvers/utils/topic-colors';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import {
ACCOUNT_BALANCE_ICON,
ARROW_BACK_ICON,
BUSINESS_ICON,
CATEGORY_ICON,
ENGINEERING_ICON,
GROUPS_ICON,
INFO_ICON,
LABEL_ICON,
LINK_ICON,
NORTH_EAST_ICON,
OPEN_IN_NEW_ICON,
PATENT_ICON,
SEARCH_OFF_ICON,
SUBJECT_ICON,
TOPIC_ICON,
} from '../../shared/ui/icons';
import {
ClassificationCard,
ClassificationSystem,
@@ -40,6 +57,22 @@ import {
styleUrl: './patent-detail.component.scss',
})
export class PatentDetailComponent implements OnInit {
readonly ARROW_BACK_ICON = ARROW_BACK_ICON;
readonly PATENT_ICON = PATENT_ICON;
readonly SEARCH_OFF_ICON = SEARCH_OFF_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly GROUPS_ICON = GROUPS_ICON;
readonly BUSINESS_ICON = BUSINESS_ICON;
readonly CATEGORY_ICON = CATEGORY_ICON;
readonly SUBJECT_ICON = SUBJECT_ICON;
readonly ENGINEERING_ICON = ENGINEERING_ICON;
readonly ACCOUNT_BALANCE_ICON = ACCOUNT_BALANCE_ICON;
readonly TOPIC_ICON = TOPIC_ICON;
readonly LABEL_ICON = LABEL_ICON;
readonly INFO_ICON = INFO_ICON;
readonly LINK_ICON = LINK_ICON;
readonly NORTH_EAST_ICON = NORTH_EAST_ICON;
private readonly destroyRef = inject(DestroyRef);
private readonly route = inject(ActivatedRoute);
private readonly patentsService = inject(PatentsService);
@@ -122,6 +122,52 @@ export function getDescriptionPreview(text: string | null): string {
return `${text.slice(0, DESCRIPTION_PREVIEW_LENGTH).trimEnd()}…`;
}
const ORG_SUFFIX_PATTERN =
/\b(Inc|Ltd|LLC|LLP|GmbH|Corp(oration)?|Co|KG|AG|SE|S\.?A\.?|N\.?V\.?|B\.?V\.?|PLC|Universit(y|ät|é)|Institut(e)?|Foundation|Laborator(y|ies)|Labs?|Group|Holdings?|Company|Gesellschaft)\b\.?/i;
const PERSON_SUFFIX_PATTERN = /\b(Dr|Prof|PhD|Ph\.D|M\.D|Jr|Sr)\b\.?/i;
function normalizeNameForComparison(name: string): string {
return name
.normalize('NFD')
.replace(/[̀-ͯ]/g, '')
.replace(/[.,]/g, '')
.toUpperCase()
.split(/\s+/)
.filter(Boolean)
.sort()
.join(' ');
}
export function isAssigneeLikelyPerson(
assignee: string,
inventors: string[] | undefined,
): boolean {
if (ORG_SUFFIX_PATTERN.test(assignee)) {
return false;
}
const normalizedAssignee = normalizeNameForComparison(
assignee.replace(PERSON_SUFFIX_PATTERN, ''),
);
const matchesInventor = (inventors ?? []).some(
(inventor) => normalizeNameForComparison(inventor) === normalizedAssignee,
);
if (matchesInventor) {
return true;
}
return PERSON_SUFFIX_PATTERN.test(assignee);
}
export function trackPatentEntry(patent: PatentEntry): string {
return [
patent.source,
patent.patent_id,
patent.publication_date ?? '',
patent.kind ?? patent.application_type ?? '',
].join('|');
}
export function patentExternalLinks(
patent: PatentEntry,
): { label: string; url: string }[] {
@@ -3,49 +3,7 @@
<mat-divider />
<div class="search-and-filter">
<mat-form-field style="width: 100%">
<mat-label>Suche nach Titel oder Patent-Nr.</mat-label>
<input
matInput
type="search"
[value]="searchTerm"
(input)="onSearchInput($event)" />
<mat-icon matPrefix>search</mat-icon>
<button matIconButton matSuffix (click)="clearSearch()">
<mat-icon>clear</mat-icon>
</button>
</mat-form-field>
<div class="filter-row">
<mat-chip-listbox
[value]="selectedSources"
multiple
(change)="handleSourceChipChange($event)">
<mat-chip-option value="EPO">EPO</mat-chip-option>
<mat-chip-option value="USPTO">USPTO</mat-chip-option>
</mat-chip-listbox>
<app-year-range-slider
class="patent-year-filter"
[minYear]="minYear"
[maxYear]="maxYear"
[(startYear)]="selectedStartYear"
[(endYear)]="selectedEndYear"
(startYearChange)="onYearRangeChange()"
(endYearChange)="onYearRangeChange()" />
</div>
</div>
<mat-divider />
@if (loading) {
<app-loading
text="Patentdaten werden geladen..."
icon="workspace_premium"
[size]="150"
[diameter]="150" />
} @else if (error) {
@if (error) {
<p class="state-message error">Fehler beim Laden der Patente.</p>
} @else if (showDetail && selectedPatent) {
<div class="detail-view">
@@ -295,62 +253,83 @@
</div>
}
</div>
} @else if (patents.length === 0) {
<div class="no-results">
<p>Keine Patente gefunden.</p>
</div>
} @else {
<div class="cards">
@for (
patent of patents;
track patent.patent_id + (patent.publication_date ?? '')
) {
<mat-card
class="card"
appearance="outlined"
(click)="selectPatent(patent)">
<mat-card-header>
<mat-card-title>{{
patent.title ?? patent.patent_id
}}</mat-card-title>
<mat-card-subtitle>
<span
class="source-badge source-badge--{{
patent.source.toLowerCase()
}}"
>{{ patent.source }}</span
>
</mat-card-subtitle>
</mat-card-header>
<mat-card-content class="card-content">
<mat-divider />
<div class="card-metadata">
<span>{{ patent.patent_id }}</span>
<span>{{ formatDate(patent.publication_date ?? '') }}</span>
</div>
<mat-divider />
</mat-card-content>
<mat-card-footer>
<mat-card-actions>
<button
mat-button
(click)="selectPatent(patent); $event.stopPropagation()">
<mat-icon>info</mat-icon>
Übersicht
</button>
</mat-card-actions>
</mat-card-footer>
</mat-card>
}
</div>
<app-card-search
[loading]="loading"
[page]="cardSearchPage()"
[cardTmp]="cardTmp"
[additionalFiltersTmp]="filtersTmp"
[noResultsTmp]="noResultsTmp"
[cardMinWidth]="500"
searchLabel="Suche nach Titel oder Patent-Nr." />
<ng-template #filtersTmp>
<div class="additional-filters">
<app-filter-card>
<mat-chip-listbox
[value]="selectedSources"
multiple
(change)="handleSourceChipChange($event)">
<mat-chip-option value="EPO">EPO</mat-chip-option>
<mat-chip-option value="USPTO">USPTO</mat-chip-option>
</mat-chip-listbox>
</app-filter-card>
<app-year-range-slider
class="patent-year-filter"
[minYear]="minYear"
[maxYear]="maxYear"
[(startYear)]="selectedStartYear"
[(endYear)]="selectedEndYear"
(startYearChange)="onYearRangeChange()"
(endYearChange)="onYearRangeChange()" />
</div>
</ng-template>
<ng-template #noResultsTmp>
<div class="no-results">
<p>Keine Patente gefunden.</p>
</div>
</ng-template>
<ng-template #cardTmp let-patent>
<mat-card
class="card"
appearance="outlined"
(click)="selectPatent(patent)">
<mat-card-header>
<mat-card-title>{{
patent.title ?? patent.patent_id
}}</mat-card-title>
<mat-card-subtitle>
<span
class="source-badge source-badge--{{
patent.source.toLowerCase()
}}"
>{{ patent.source }}</span
>
</mat-card-subtitle>
</mat-card-header>
<mat-card-content class="card-content">
<mat-divider />
<div class="card-metadata">
<span>{{ patent.patent_id }}</span>
<span>{{ formatDate(patent.publication_date ?? '') }}</span>
</div>
<mat-divider />
</mat-card-content>
<mat-card-footer>
<mat-card-actions>
<button
mat-button
type="button"
(click)="selectPatent(patent); $event.stopPropagation()">
<mat-icon>{{ INFO_ICON }}</mat-icon>
Übersicht
</button>
</mat-card-actions>
</mat-card-footer>
</mat-card>
</ng-template>
}
<mat-divider />
<mat-paginator
[length]="total"
[pageSize]="pageSize"
[pageIndex]="page"
[pageSizeOptions]="[10, 25, 50]"
(page)="handlePageChange($event)" />
</div>
@@ -20,22 +20,27 @@ h1 {
gap: 0.5rem;
}
.filter-row {
.additional-filters {
display: flex;
justify-content: space-between;
align-items: center;
align-items: stretch;
flex-wrap: wrap;
gap: 1rem;
gap: 1.5rem;
padding: 0 1rem 1rem;
}
.patent-year-filter {
display: flex;
width: min(400px, 100%);
}
::ng-deep app-year-range-slider .year-filter {
height: 100%;
}
.mat-mdc-standard-chip {
border-radius: var(--sg-radius-sm);
}
.patent-year-filter {
width: min(285px, 100%);
}
.state-message {
display: flex;
align-items: center;
@@ -72,24 +77,36 @@ mat-paginator {
background-color: var(--sg-background);
}
:host {
::ng-deep .mat-mdc-card-header-text {
min-width: 0;
width: 100%;
}
}
.card {
padding: 0.5rem;
background-color: var(--sg-card-bg);
border: 1px solid var(--sg-border);
transition: transform 0.3s ease;
display: flex;
flex-direction: column;
gap: 0.5rem;
&:hover {
cursor: pointer;
transform: scale(1.03);
}
mat-card-title {
display: -webkit-box;
width: 100%;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
line-clamp: 3;
overflow: hidden;
font-size: 14px;
font-weight: 600;
line-height: 1.4;
height: calc(1.4em * 3);
color: var(--sg-text);
}
}
@@ -1,27 +1,28 @@
import { Component, OnInit, inject } from '@angular/core';
import { Component, DestroyRef, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips';
import { MatDividerModule } from '@angular/material/divider';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { debounceTime, distinctUntilChanged, Subject } from 'rxjs';
import { PatentsService } from '../../api/api/patents.service';
import { PatentEntry } from '../../api/model/patentEntry';
import { IpcClassification } from '../../api';
import { OpenAlexTopicTag } from '../../api/model/openAlexTopicTag';
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component';
import {
classificationSectionColor,
topicHierarchyColor,
} from '../../resolvers/utils/topic-colors';
import {
CardSearchComponent,
Page,
} from '../../shared/ui/card-search/card-search.component';
import { FilterCardComponent } from '../../shared/ui/filter-card/filter-card.component';
import { INFO_ICON, PATENT_ICON } from '../../shared/ui/icons';
type PatentSource = 'EPO' | 'USPTO';
@@ -48,32 +49,33 @@ const MIN_YEAR = 1978;
MatIconModule,
MatButtonModule,
MatCardModule,
MatFormFieldModule,
MatInputModule,
MatPaginatorModule,
MatChipsModule,
MatDividerModule,
TopicChipComponent,
LoadingComponent,
YearRangeSliderComponent,
CardSearchComponent,
FilterCardComponent,
],
templateUrl: './patents.component.html',
styleUrl: './patents.component.scss',
})
export class PatentsComponent implements OnInit {
export class PatentsComponent {
readonly PATENT_ICON = PATENT_ICON;
readonly INFO_ICON = INFO_ICON;
private router = inject(Router);
private route = inject(ActivatedRoute);
private patentsApi = inject(PatentsService);
private destroyRef = inject(DestroyRef);
patents: PatentEntry[] = [];
total = 0;
page = 0;
pageIndex = 0;
pageSize = 10;
loading = true;
error = false;
searchTerm = '';
selectedSources: PatentSource[] = ['EPO', 'USPTO'];
sortDirection: string = 'asc';
@@ -83,49 +85,45 @@ export class PatentsComponent implements OnInit {
selectedStartYear = MIN_YEAR;
selectedEndYear = new Date().getFullYear();
private searchSubject = new Subject<string>();
showDetail = false;
selectedPatent: PatentEntry | null = null;
readonly expandedClassificationKeys = new Set<string>();
constructor() {
this.searchSubject
.pipe(debounceTime(300), distinctUntilChanged(), takeUntilDestroyed())
.subscribe((term) => {
this.searchTerm = term;
this.page = 0;
this.loadPatents();
this.updateQueryParams();
this.route.queryParams
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((qp) => {
this.pageIndex = parseInt(qp['page'] ?? '0', 10) || 0;
this.pageSize = parseInt(qp['size'] ?? '10', 10) || 10;
const sourcesParam = qp['sources'];
this.selectedSources = ((sourcesParam ?? 'EPO,USPTO') as string)
.split(',')
.filter((s): s is PatentSource => s === 'EPO' || s === 'USPTO');
const d = qp['sort_direction'];
this.sortDirection = d === 'asc' || d === 'desc' ? d : 'asc';
const sy = parseInt(qp['year_from'] ?? '', 10);
const ey = parseInt(qp['year_to'] ?? '', 10);
this.selectedStartYear = isNaN(sy) ? this.minYear : sy;
this.selectedEndYear = isNaN(ey) ? this.maxYear : ey;
this.loadPatents(qp['search'] ?? '');
});
}
ngOnInit(): void {
const qp = this.route.snapshot.queryParamMap;
this.searchTerm = qp.get('search') ?? '';
this.page = parseInt(qp.get('page') ?? '0', 10);
this.pageSize = parseInt(qp.get('size') ?? '10', 10);
const sourcesParam = qp.get('sources');
this.selectedSources = (sourcesParam ?? 'EPO,USPTO')
.split(',')
.filter((s): s is PatentSource => s === 'EPO' || s === 'USPTO');
const d = qp.get('sort_direction');
if (d === 'asc' || d === 'desc') this.sortDirection = d;
const sy = parseInt(qp.get('year_from') ?? '', 10);
const ey = parseInt(qp.get('year_to') ?? '', 10);
if (!isNaN(sy)) this.selectedStartYear = sy;
if (!isNaN(ey)) this.selectedEndYear = ey;
this.loadPatents();
cardSearchPage(): Page {
return {
page: this.pageIndex,
size: this.pageSize,
total: this.total,
elements: this.patents,
};
}
onYearRangeChange(): void {
this.page = 0;
this.loadPatents();
this.updateQueryParams();
}
private loadPatents(): void {
private loadPatents(searchTerm: string): void {
if (this.selectedSources.length === 0) {
this.patents = [];
this.total = 0;
@@ -141,9 +139,9 @@ export class PatentsComponent implements OnInit {
this.patentsApi
.getAllPatents(
this.page,
this.pageIndex,
this.pageSize,
this.searchTerm || undefined,
searchTerm || undefined,
source,
'date',
this.sortDirection,
@@ -163,37 +161,16 @@ export class PatentsComponent implements OnInit {
});
}
onSearchInput(event: Event): void {
this.searchSubject.next((event.target as HTMLInputElement).value);
}
clearSearch(): void {
this.searchTerm = '';
this.page = 0;
this.loadPatents();
this.updateQueryParams();
}
handleSourceChipChange(change: MatChipListboxChange): void {
const selected = change.value as PatentSource[];
// Deselecting every chip resets back to "all sources", mirroring the
// project-type filter's behavior instead of showing an empty state.
this.selectedSources = selected.length ? selected : ['EPO', 'USPTO'];
this.page = 0;
this.loadPatents();
this.updateQueryParams();
}
setSortDirection(direction: string): void {
this.sortDirection = direction;
this.loadPatents();
this.updateQueryParams();
}
handlePageChange(event: PageEvent): void {
this.page = event.pageIndex;
this.pageSize = event.pageSize;
this.loadPatents();
this.updateQueryParams();
}
@@ -217,8 +194,7 @@ export class PatentsComponent implements OnInit {
this.router.navigate([], {
relativeTo: this.route,
queryParams: {
search: this.searchTerm || null,
page: this.page,
page: 0,
size: this.pageSize,
sources: this.selectedSources.length
? this.selectedSources.join(',')
@@ -1,4 +1,4 @@
<article class="person-card">
<article class="person-card popup">
<a [routerLink]="['/person', person().id, 'overview']" class="card-header">
<!-- Initials Avatar or Profile Image fallback -->
<div [skText]="loading()" class="avatar">
@@ -26,7 +26,7 @@
isBookmarked() ? 'Bookmark entfernen' : 'Person speichern'
">
<mat-icon>{{
isBookmarked() ? 'bookmark' : 'bookmark_border'
isBookmarked() ? BOOKMARK_ICON : BOOKMARK_BORDER_ICON
}}</mat-icon>
</button>
</div>
@@ -68,7 +68,7 @@
margin-right: 4px;
vertical-align: middle;
"
>apartment</mat-icon
>{{ APARTMENT_ICON }}</mat-icon
>
<span
[skText]="loading()"
@@ -93,7 +93,7 @@
class="institution-open-icon"
(click)="openInstitutionPage($event)"
aria-label="Institutionsseite öffnen"
>open_in_new</mat-icon
>{{ OPEN_IN_NEW_ICON }}</mat-icon
>
}
</button>
@@ -124,17 +124,17 @@
<div class="card-footer">
<div class="action-buttons">
<a [routerLink]="['/person', person().id, 'overview']" class="action-btn">
<mat-icon>visibility</mat-icon>
<mat-icon>{{ OVERVIEW_ICON }}</mat-icon>
<span>Übersicht</span>
</a>
<a
[routerLink]="['/person', person().id, 'publications']"
class="action-btn">
<mat-icon>menu_book</mat-icon>
<mat-icon>{{ PUBLICATION_ICON }}</mat-icon>
<span>Publikationen</span>
</a>
<a [routerLink]="['/person', person().id, 'network']" class="action-btn">
<mat-icon>share</mat-icon>
<mat-icon>{{ NETWORK_ICON }}</mat-icon>
<span>Netzwerk</span>
</a>
</div>
@@ -9,6 +9,15 @@ import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.compon
import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component';
import { CareerStageChipComponent } from '../../shared/ui/career-stage-chip/career-stage-chip.component';
import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
import {
APARTMENT_ICON,
BOOKMARK_BORDER_ICON,
BOOKMARK_ICON,
NETWORK_ICON,
OPEN_IN_NEW_ICON,
OVERVIEW_ICON,
PUBLICATION_ICON,
} from '../../shared/ui/icons';
@Component({
selector: 'app-person-card',
@@ -27,6 +36,14 @@ import { topicHierarchyColor } from '../../resolvers/utils/topic-colors';
styleUrl: './person-card.component.scss',
})
export class PersonCardComponent {
readonly BOOKMARK_ICON = BOOKMARK_ICON;
readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON;
readonly APARTMENT_ICON = APARTMENT_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly OVERVIEW_ICON = OVERVIEW_ICON;
readonly PUBLICATION_ICON = PUBLICATION_ICON;
readonly NETWORK_ICON = NETWORK_ICON;
private readonly router = inject(Router);
person = input.required<CustomAuthor>();
@@ -1,7 +1,7 @@
@if (loading) {
<app-loading
text="Verbindungen zu Unternehmen werden geladen ..."
icon="business"
[icon]="BUSINESS_ICON"
[size]="60"
[diameter]="60" />
} @else if (error) {
@@ -55,9 +55,9 @@
? 'Weitere Registerpersonen ausblenden'
: 'Weitere Registerpersonen anzeigen'
">
<mat-icon class="graph-related-persons-icon">
{{ showRelatedPersons ? 'no_accounts' : 'account_circle' }}
</mat-icon>
<mat-icon class="graph-related-persons-icon">{{
showRelatedPersons ? NO_ACCOUNTS_ICON : ACCOUNT_CIRCLE_ICON
}}</mat-icon>
</button>
<div
@@ -189,13 +189,11 @@
relatedOfficers.length
}})
</span>
<mat-icon>
{{
isCompanyOfficersExpanded(connection)
? 'expand_less'
: 'expand_more'
}}
</mat-icon>
<mat-icon>{{
isCompanyOfficersExpanded(connection)
? EXPAND_LESS_ICON
: EXPAND_MORE_ICON
}}</mat-icon>
</button>
@if (isCompanyOfficersExpanded(connection)) {
@@ -243,7 +241,7 @@
relatedOfficer.name +
' öffnen'
">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
} @else {
<span class="officer-open-placeholder"></span>
@@ -27,6 +27,14 @@ import {
import { PersonDataResolved } from '../../resolvers/person.resolver';
import { ChartThemeService } from '../../shared/services/chart-theme.service';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import {
ACCOUNT_CIRCLE_ICON,
BUSINESS_ICON,
EXPAND_LESS_ICON,
EXPAND_MORE_ICON,
NO_ACCOUNTS_ICON,
OPEN_IN_NEW_ICON,
} from '../../shared/ui/icons';
interface RoleLegendItem {
role: string;
@@ -57,6 +65,13 @@ interface GraphSymbols {
styleUrl: './person-company-connections.component.scss',
})
export class PersonCompanyConnectionsComponent implements OnInit {
readonly BUSINESS_ICON = BUSINESS_ICON;
readonly NO_ACCOUNTS_ICON = NO_ACCOUNTS_ICON;
readonly ACCOUNT_CIRCLE_ICON = ACCOUNT_CIRCLE_ICON;
readonly EXPAND_LESS_ICON = EXPAND_LESS_ICON;
readonly EXPAND_MORE_ICON = EXPAND_MORE_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
private readonly route = inject(ActivatedRoute);
private readonly router = inject(Router);
private readonly destroyRef = inject(DestroyRef);
@@ -1,7 +1,7 @@
@if (loading) {
<app-loading
text="Förderdaten werden geladen..."
icon="volunteer_activism"
[icon]="VOLUNTEER_ACTIVISM_ICON"
[size]="150"
[diameter]="150" />
} @else if (error) {
@@ -17,7 +17,7 @@
<mat-form-field
class="funding-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
<mat-icon matPrefix [fontIcon]="FILTER_ICON"></mat-icon>
<mat-select
[value]="activeFilter"
(selectionChange)="setFilter($event.value)">
@@ -31,7 +31,7 @@
<mat-form-field
class="funding-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="sort"></mat-icon>
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-select
[value]="sortColumn"
(selectionChange)="setSort($event.value)">
@@ -44,95 +44,45 @@
</mat-select>
</mat-form-field>
</div>
<table>
<thead>
<tr>
<th
class="sortable"
[class.sort-active]="sortColumn === 'name'"
(click)="setSort('name')">
Förderer
@if (sortColumn === 'name') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th
class="text-center sortable"
[class.sort-active]="sortColumn === 'publications'"
(click)="setSort('publications')">
Publikationen
@if (sortColumn === 'publications') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th
class="text-center sortable"
[class.sort-active]="sortColumn === 'first'"
(click)="setSort('first')">
Erstautor
@if (sortColumn === 'first') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th
class="text-center sortable"
[class.sort-active]="sortColumn === 'middle'"
(click)="setSort('middle')">
Mitautor
@if (sortColumn === 'middle') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th
class="text-center sortable"
[class.sort-active]="sortColumn === 'last'"
(click)="setSort('last')">
Letztautor
@if (sortColumn === 'last') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
</tr>
</thead>
<tbody>
@for (funder of getPagedFunders(); track funder.funder_id) {
<tr
[class.selected]="selectedFunder === funder"
(click)="selectFunder(funder)">
<td class="funder-name">{{ funder.funder_name }}</td>
<td class="text-center">{{ getPublicationCount(funder) }}</td>
<td class="text-center">
<span
class="position-count-badge position-count-badge--first"
>{{ funder.author_position_count.first || 0 }}</span
>
</td>
<td class="text-center">
<span
class="position-count-badge position-count-badge--middle"
>{{ funder.author_position_count.middle || 0 }}</span
>
</td>
<td class="text-center">
<span
class="position-count-badge position-count-badge--last"
>{{ funder.author_position_count.last || 0 }}</span
>
</td>
</tr>
}
</tbody>
</table>
<app-data-table
[columns]="columns()"
[data]="getPagedFunders()"
queryParamSortKey="sortBy"
queryParamSortDirectionKey="sortDir"
(handleSortChange)="onSortChange($event)" />
<ng-template #nameTmp let-funder>
<button
type="button"
class="funder-name-btn"
[class.selected]="isSelectedFunder(funder)"
(click)="selectFunder(funder)">
{{ funder.funder_name }}
</button>
</ng-template>
<ng-template #countTmp let-funder>
{{ getPublicationCount(funder) }}
</ng-template>
<ng-template #firstTmp let-funder>
<span class="position-count-badge position-count-badge--first">{{
funder.author_position_count.first || 0
}}</span>
</ng-template>
<ng-template #middleTmp let-funder>
<span class="position-count-badge position-count-badge--middle">{{
funder.author_position_count.middle || 0
}}</span>
</ng-template>
<ng-template #lastTmp let-funder>
<span class="position-count-badge position-count-badge--last">{{
funder.author_position_count.last || 0
}}</span>
</ng-template>
<app-query-param-paginator
[total]="filteredFunders.length"
queryParamPageKey="funderPage"
@@ -182,15 +132,12 @@
<a
class="publication-more-info"
title="Publikationsdetails öffnen"
[routerLink]="[
'/publication',
getShortPublicationId(id),
]"
[routerLink]="['/publication', getShortPublicationId(id)]"
[state]="{
returnUrl: getCurrentUrl(),
returnLabel: 'Förderungen',
}">
<span class="material-icons">open_in_new</span>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</span>
</li>
@@ -37,63 +37,29 @@ app-query-param-paginator {
flex-wrap: wrap;
}
table {
width: 100%;
border-collapse: collapse;
}
th {
text-align: left;
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
font-size: 12px;
font-weight: 700;
color: var(--sg-text-muted);
.funder-name-btn {
padding: 0;
border: 0;
background: none;
color: var(--sg-text);
font-weight: 600;
font-size: 13px;
cursor: pointer;
&.sortable {
display: table-cell;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
}
&:hover,
&.selected {
color: var(--sg-blue-highlight);
}
}
.sort-icon {
vertical-align: middle;
margin-left: 2px;
width: 14px;
height: 14px;
font-size: 14px;
}
}
tr {
cursor: pointer;
transition: background-color 0.15s ease;
&:hover td {
background: rgba(16, 26, 61, 0.04);
}
&.selected td {
background: var(--sg-primary-soft);
}
}
td {
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
color: var(--sg-text);
font-size: 13px;
transition: background-color 0.15s ease;
}
.funder-name {
color: var(--sg-text);
font-weight: 600;
}
.text-center {
text-align: center;
}
::ng-deep {
.mat-column-publications,
.mat-column-first,
.mat-column-middle,
.mat-column-last {
text-align: center;
}
}
@@ -1,4 +1,10 @@
import { Component, OnInit, inject } from '@angular/core';
import {
Component,
OnInit,
TemplateRef,
inject,
viewChild,
} from '@angular/core';
import { CommonModule } from '@angular/common';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { Router } from '@angular/router';
@@ -6,9 +12,20 @@ import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatIconModule } from '@angular/material/icon';
import { PageEvent } from '@angular/material/paginator';
import { Sort } from '@angular/material/sort';
import { FundingService } from '../../api';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import {
DataTableComponent,
GenericColumn,
} from '../../shared/ui/data-table/data-table.component';
import {
FILTER_ICON,
OPEN_IN_NEW_ICON,
SORT_ICON,
VOLUNTEER_ACTIVISM_ICON,
} from '../../shared/ui/icons';
type SortColumn = 'name' | 'publications' | 'first' | 'middle' | 'last';
type SortDirection = 'asc' | 'desc';
@@ -32,11 +49,17 @@ type FundingPublicationDetail = {
MatIconModule,
LoadingComponent,
QueryParamPaginatorComponent,
DataTableComponent,
],
templateUrl: './person-funding.component.html',
styleUrl: './person-funding.component.scss',
})
export class PersonFundingComponent implements OnInit {
readonly VOLUNTEER_ACTIVISM_ICON = VOLUNTEER_ACTIVISM_ICON;
readonly FILTER_ICON = FILTER_ICON;
readonly SORT_ICON = SORT_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
private route = inject(ActivatedRoute);
private router = inject(Router);
private fundingApi = inject(FundingService);
@@ -59,6 +82,63 @@ export class PersonFundingComponent implements OnInit {
loading = true;
error = false;
nameTmp = viewChild.required<TemplateRef<any>>('nameTmp');
countTmp = viewChild.required<TemplateRef<any>>('countTmp');
firstTmp = viewChild.required<TemplateRef<any>>('firstTmp');
middleTmp = viewChild.required<TemplateRef<any>>('middleTmp');
lastTmp = viewChild.required<TemplateRef<any>>('lastTmp');
columns(): GenericColumn<any>[] {
return [
{
id: 'name',
header: 'Förderer',
type: 'accessor',
accessorKey: 'funder_name',
cellTemplate: this.nameTmp(),
},
{
id: 'publications',
header: 'Publikationen',
type: 'accessor',
accessorKey: 'publication_count',
cellTemplate: this.countTmp(),
},
{
id: 'first',
header: 'Erstautor',
type: 'display',
cellTemplate: this.firstTmp(),
},
{
id: 'middle',
header: 'Mitautor',
type: 'display',
cellTemplate: this.middleTmp(),
},
{
id: 'last',
header: 'Letztautor',
type: 'display',
cellTemplate: this.lastTmp(),
},
];
}
isSelectedFunder(funder: any): boolean {
return this.selectedFunder === funder;
}
onSortChange(sort: Sort): void {
if (!sort.direction || !this.isValidSortColumn(sort.active)) {
return;
}
this.sortColumn = sort.active;
this.sortDirection = sort.direction;
this.applyFilter();
this.updateQueryParams();
}
ngOnInit(): void {
this.route.parent?.paramMap.subscribe((params) => {
const authorId = params.get('id') ?? '';
@@ -3,7 +3,7 @@
<h3>Interessant für</h3>
@if (tags().length > 0) {
<span class="interest-footnote">
<mat-icon class="footnote-icon">article</mat-icon>
<mat-icon class="footnote-icon">{{ ARTICLE_ICON }}</mat-icon>
Anzahl Publikationen zum Thema
</span>
}
@@ -27,7 +27,7 @@
<div class="interest-tags-loading" aria-live="polite">
<app-loading
text="Themen werden geladen ..."
icon="interests"
[icon]="INTERESTS_ICON"
[size]="48"
[diameter]="48" />
</div>
@@ -44,7 +44,10 @@
[color]="tag.color"
[disabled]="!tag.id"
[active]="isTagActive(tag)"
countIcon="article"
[secondaryActionLabel]="tagAction(tag)?.label ?? null"
[secondaryActionLink]="tagAction(tag)?.link ?? null"
[secondaryActionQueryParams]="tagAction(tag)?.queryParams ?? null"
[countIcon]="ARTICLE_ICON"
descriptionTooltipTarget="button"
(chipClick)="onTagClick(tag)">
</app-topic-chip>
@@ -14,6 +14,7 @@ import { CommonModule } from '@angular/common';
import { ActivatedRoute, Router } from '@angular/router';
import { TopicCount } from '../../api';
import { workQueryParamKeys } from '../../resolvers/work-page.resolver';
import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component';
import { TopicLegendComponent } from '../../shared/ui/topic-legend/topic-legend.component';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
@@ -28,6 +29,8 @@ import {
toggleTopicLegendSubfieldSelection,
} from '../../resolvers/utils/topic-legend';
import { ARTICLE_ICON, INTERESTS_ICON } from '../../shared/ui/icons';
interface InterestTag {
id: string;
label: string;
@@ -45,6 +48,12 @@ interface InterestTag {
domainDescription: string;
}
interface InterestTagAction {
label: string;
link: unknown[];
queryParams: Record<string, string | number>;
}
const MAX_TAGS = 5;
@Component({
@@ -60,6 +69,9 @@ const MAX_TAGS = 5;
styleUrl: './person-interesting.component.scss',
})
export class PersonInterestingComponent implements OnInit {
readonly ARTICLE_ICON = ARTICLE_ICON;
readonly INTERESTS_ICON = INTERESTS_ICON;
private static readonly legendExpandedQueryParam =
'interesting_legend_expanded';
@@ -69,6 +81,10 @@ export class PersonInterestingComponent implements OnInit {
readonly topics = input<TopicCount[] | null>(null);
readonly loading = input<boolean>(false);
readonly personPublicationsLink = input<unknown[] | null>(null);
readonly personName = input<string>('');
readonly legendExpanded = signal(false);
readonly activeLegendFieldIds = signal<ReadonlySet<string>>(new Set());
readonly activeLegendSubfieldIds = signal<ReadonlySet<string>>(new Set());
@@ -142,6 +158,36 @@ export class PersonInterestingComponent implements OnInit {
});
}
private readonly tagActions = computed(() => {
const actions = new Map<string, InterestTagAction>();
const link = this.personPublicationsLink();
if (!link) {
return actions;
}
const person = this.personName() || 'dieser Person';
for (const tag of this.tags()) {
if (!tag.id) continue;
actions.set(tag.id, {
label: `Publikationen von ${person}`,
link,
queryParams: {
[workQueryParamKeys.page]: 0,
[workQueryParamKeys.topicId]: tag.id,
},
});
}
return actions;
});
tagAction(tag: InterestTag): InterestTagAction | null {
return this.tagActions().get(tag.id) ?? null;
}
onTagClick(tag: InterestTag): void {
if (!tag.id) return;
this.tagClick.emit({
@@ -21,7 +21,7 @@
(click)="clearSearch()"
matTooltip="Suche zurücksetzen"
aria-label="Suche zurücksetzen">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
</div>
}
@@ -44,7 +44,9 @@
[appComponentTooltip]="AppTopicTooltipComponent"
[tooltipInputs]="getFilterTopicInputs(filter.value)"
[tooltipMaxWidth]="'500px'">
<mat-icon class="filter-topic-chip__icon">label</mat-icon>
<mat-icon class="filter-topic-chip__icon">{{
LABEL_ICON
}}</mat-icon>
<span class="filter-topic-chip__label">{{
filter.value
}}</span>
@@ -56,15 +58,15 @@
[attr.aria-label]="
'Themenfilter ' + filter.value + ' entfernen'
">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
</span>
} @else if (filter.category === 'institutionId') {
<span [skText]="loading" class="active-institution-filter">
<span class="filter-institution-chip">
<mat-icon class="filter-institution-chip__icon"
>apartment</mat-icon
>
<mat-icon class="filter-institution-chip__icon">{{
APARTMENT_ICON
}}</mat-icon>
<span class="filter-institution-chip__name">{{
institutionFilterLabel(filter)
}}</span>
@@ -83,7 +85,7 @@
class="institution-open-icon"
(click)="openInstitutionPage(filter.value, $event)"
aria-label="Institutionsseite öffnen"
>open_in_new</mat-icon
>{{ OPEN_IN_NEW_ICON }}</mat-icon
>
}
</span>
@@ -92,7 +94,7 @@
class="remove-chip-btn"
(click)="removeFilter(filter)"
aria-label="Institutionsfilter entfernen">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
</span>
} @else {
@@ -103,7 +105,7 @@
class="remove-chip-btn"
(click)="removeFilter(filter)"
aria-label="Filter entfernen">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
</span>
}
@@ -170,7 +172,7 @@
</div>
} @else {
<div class="empty-state">
<mat-icon>person_search</mat-icon>
<mat-icon>{{ PERSON_SEARCH_ICON }}</mat-icon>
<h2>Keine Personen gefunden</h2>
<p>
Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter
@@ -194,7 +196,7 @@
<!-- Right Column: Sidebar Filters -->
<aside class="filters-sidebar">
<div class="sidebar-header">
<mat-icon>filter_alt</mat-icon>
<mat-icon>{{ FILTER_ICON }}</mat-icon>
<h2>Filter &amp; Suche</h2>
</div>
@@ -203,7 +205,7 @@
<h3 class="filter-section-title">Themen &amp; Expertise</h3>
<div class="topic-search-wrapper">
<mat-icon>search</mat-icon>
<mat-icon>{{ SEARCH_ICON }}</mat-icon>
<input
type="text"
[formControl]="topicSearchControl"
@@ -214,7 +216,7 @@
class="clear-topic-search"
(click)="topicSearchControl.setValue('')"
aria-label="Themensuche zurücksetzen">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
}
</div>
@@ -232,7 +234,7 @@
<div class="filter-section">
<h3 class="filter-section-title">Institution</h3>
<div class="topic-search-wrapper" [class.is-loading]="loading">
<mat-icon>apartment</mat-icon>
<mat-icon>{{ APARTMENT_ICON }}</mat-icon>
<input
type="text"
[formControl]="institutionControl"
@@ -266,7 +268,7 @@
class="clear-topic-search"
(click)="clearInstitutionFilter()"
aria-label="Institution zurücksetzen">
<mat-icon>close</mat-icon>
<mat-icon>{{ CLOSE_ICON }}</mat-icon>
</button>
}
</div>
@@ -22,7 +22,6 @@ import {
InstitutionsV2Service,
WorkTopic,
} from '../../api';
import { TopicsService } from '../../api/api/topics.service';
import { TopicHierarchyComponent } from '../topic-hierarchy/topic-hierarchy.component';
import { PersonCardComponent } from '../person-card/person-card.component';
import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component';
@@ -48,6 +47,15 @@ import { BookmarkService } from '../../shared/services/bookmark.service';
import { ComponentTooltipDirective } from '../../directives/component-tooltip.directive';
import { AppTopicTooltipComponent } from '../../shared/ui/app-topic-tooltip/app-topic-tooltip.component';
import {
APARTMENT_ICON,
CLOSE_ICON,
FILTER_ICON,
LABEL_ICON,
OPEN_IN_NEW_ICON,
PERSON_SEARCH_ICON,
SEARCH_ICON,
} from '../../shared/ui/icons';
type InstitutionYearFilterMode = 'in' | 'from' | 'between';
@@ -77,11 +85,18 @@ type InstitutionYearFilterMode = 'in' | 'from' | 'between';
standalone: true,
})
export class PersonListComponent {
readonly CLOSE_ICON = CLOSE_ICON;
readonly LABEL_ICON = LABEL_ICON;
readonly APARTMENT_ICON = APARTMENT_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly PERSON_SEARCH_ICON = PERSON_SEARCH_ICON;
readonly FILTER_ICON = FILTER_ICON;
readonly SEARCH_ICON = SEARCH_ICON;
readonly AppTopicTooltipComponent = AppTopicTooltipComponent;
private readonly router = inject(Router);
private readonly route = inject(ActivatedRoute);
private readonly personsService = inject(PersonsService);
private readonly topicsService = inject(TopicsService);
private readonly institutionsService = inject(InstitutionsService);
private readonly institutionsV2Service = inject(InstitutionsV2Service);
private readonly destroyRef = inject(DestroyRef);
@@ -1,12 +1,12 @@
@if (this.isPending()) {
<app-loading
text="Das Netzwerk wird gebaut, kleinen Moment..."
icon="graph_3"
[icon]="GRAPH_ICON"
[size]="150"
[diameter]="150" />
} @else if (this.isFailed()) {
<div class="error">
<mat-icon>error</mat-icon>
<mat-icon>{{ ERROR_ICON }}</mat-icon>
<span class="error-message">{{
this.collaborationGraphError()
? this.collaborationGraphError()
@@ -15,7 +15,7 @@
<app-selected-filters [observers]="observers" />
<button matButton="outlined" type="button" (click)="openFilterDialog()">
<mat-icon>filter_alt</mat-icon>
<mat-icon>{{ FILTER_ICON }}</mat-icon>
Filter
</button>
</div>
@@ -53,7 +53,7 @@
mat-stroked-button
type="button"
(click)="openFilterDialog()">
<mat-icon>filter_alt</mat-icon>
<mat-icon>{{ FILTER_ICON }}</mat-icon>
Filter
</button>
</div>
@@ -111,7 +111,7 @@
mat-icon-button
color="primary"
[routerLink]="['/person', this.stripOpenAlexIdPrefix(element.id)]">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</ng-template>
@@ -131,7 +131,8 @@
[appComponentTooltip]="AppPublicationTooltipComponent"
[tooltipInputs]="{
workId: this.stripOpenAlexIdPrefix(work.id),
}">
}"
[tooltipMaxWidth]="'500px'">
<li>{{ work.display_name }}</li>
</a>
}
@@ -150,7 +151,8 @@
[appComponentTooltip]="AppInstitutionTooltipComponent"
[tooltipInputs]="{
institutionId: this.stripOpenAlexIdPrefix(institution.id),
}">
}"
[tooltipMaxWidth]="'500px'">
<li>{{ institution.display_name }}</li>
</a>
}
@@ -164,7 +166,7 @@
mat-icon-button
color="primary"
[routerLink]="['/publication', this.stripOpenAlexIdPrefix(element.id)]">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</ng-template>
@@ -188,7 +190,8 @@
[appComponentTooltip]="AppAuthorTooltipComponent"
[tooltipInputs]="{
authorId: this.stripOpenAlexIdPrefix(collaborator.id),
}">
}"
[tooltipMaxWidth]="'500px'">
{{ collaborator.display_name }}
</a>
</li>
@@ -203,7 +206,7 @@
mat-icon-button
color="primary"
[routerLink]="['/institution', this.stripOpenAlexIdPrefix(element.id)]">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
</a>
</ng-template>
@@ -227,7 +230,8 @@
[appComponentTooltip]="AppAuthorTooltipComponent"
[tooltipInputs]="{
authorId: this.stripOpenAlexIdPrefix(collaborator.id),
}">
}"
[tooltipMaxWidth]="'500px'">
{{ collaborator.display_name }}
</a>
</li>
@@ -58,6 +58,20 @@ import {
} from '../collaboration-graph/collaboration-graph.component';
import { form } from '@angular/forms/signals';
import { collaborationGraphQueryParamKeys } from '../../resolvers/collaboration-graph.resolver';
import {
APARTMENT_ICON,
CALENDAR_ICON,
ERROR_ICON,
FILTER_ICON,
GRAPH_ICON,
GROUP_ICON,
LABEL_ICON,
NETWORK_ICON,
OPEN_IN_NEW_ICON,
PERSON_ICON,
PUBLICATION_ICON,
SEARCH_ICON,
} from '../../shared/ui/icons';
import {
FilterObserver,
SelectedFiltersComponent,
@@ -122,6 +136,11 @@ interface FilterData {
providers: [],
})
export class PersonNetworkComponent implements OnInit {
readonly GRAPH_ICON = GRAPH_ICON;
readonly ERROR_ICON = ERROR_ICON;
readonly FILTER_ICON = FILTER_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly AppAuthorTooltipComponent = AppAuthorTooltipComponent;
readonly AppInstitutionTooltipComponent = AppInstitutionTooltipComponent;
readonly AppPublicationTooltipComponent = AppPublicationTooltipComponent;
@@ -168,12 +187,12 @@ export class PersonNetworkComponent implements OnInit {
{
id: 'searchTerm',
queryParamKey: 'search_term',
icon: 'search',
icon: SEARCH_ICON,
},
{
id: 'yearFrom',
queryParamKey: collaborationGraphQueryParamKeys.yearFrom,
icon: 'calendar_today',
icon: CALENDAR_ICON,
valueFormatter: (value: string) => {
return value ? `Ab ${value}` : null;
},
@@ -181,7 +200,7 @@ export class PersonNetworkComponent implements OnInit {
{
id: 'yearTo',
queryParamKey: collaborationGraphQueryParamKeys.yearTo,
icon: 'calendar_today',
icon: CALENDAR_ICON,
valueFormatter: (value: string) => {
return value ? `Bis ${value}` : null;
},
@@ -189,7 +208,7 @@ export class PersonNetworkComponent implements OnInit {
{
id: 'minContributors',
queryParamKey: collaborationGraphQueryParamKeys.minCollaborators,
icon: 'person',
icon: PERSON_ICON,
valueFormatter: (value: string) => {
return value ? `Mindestens ${value} Autoren` : null;
},
@@ -197,7 +216,7 @@ export class PersonNetworkComponent implements OnInit {
{
id: 'maxContributors',
queryParamKey: collaborationGraphQueryParamKeys.maxCollaborators,
icon: 'group',
icon: GROUP_ICON,
valueFormatter: (value: string) => {
return value ? `Höchstens ${value} Autoren` : null;
},
@@ -205,7 +224,7 @@ export class PersonNetworkComponent implements OnInit {
{
id: 'topics',
queryParamKey: collaborationGraphQueryParamKeys.topicId,
icon: 'label',
icon: LABEL_ICON,
valueFormatter: (value: string) => {
const topic = this.selectedTopics().elements?.find(
(topic) => topic.id === value,
@@ -217,7 +236,7 @@ export class PersonNetworkComponent implements OnInit {
{
id: 'institutions',
queryParamKey: collaborationGraphQueryParamKeys.institutionId,
icon: 'apartment',
icon: APARTMENT_ICON,
valueFormatter: (value: string) => {
const institution = this.selectedInstitutions().elements?.find(
(inst) => inst.id === value,
@@ -420,22 +439,22 @@ export class PersonNetworkComponent implements OnInit {
readonly summaryCards = computed(() => [
{
icon: 'person',
icon: PERSON_ICON,
value: this.persons(),
description: 'Personen',
},
{
icon: 'apartment',
icon: APARTMENT_ICON,
value: this.institutions(),
description: 'Institutionen',
},
{
icon: 'menu_book',
icon: PUBLICATION_ICON,
value: this.publications(),
description: 'Gemeinsame Publikationen',
},
{
icon: 'share',
icon: NETWORK_ICON,
value: this.connections(),
description: 'Verbindungen im Netzwerk',
},
@@ -171,8 +171,15 @@
type="button"
class="main-topic-button"
[disabled]="!getMainTopicItem(item)?.id"
[attr.aria-label]="
getTopicAriaLabel(getMainTopicItem(item), [item.year])
"
[appComponentTooltip]="AppTopicTooltipComponent"
[tooltipInputs]="{ topicId: getMainTopicItem(item)?.id }"
[tooltipInputs]="
getTopicTooltipInputs(getMainTopicItem(item), [
item.year,
])
"
[tooltipMaxWidth]="'500px'"
(click)="
selectTopic(getMainTopicItem(item), [item.year])
@@ -217,6 +224,16 @@
[color]="getTopicColor(topic)"
[disabled]="!topic.id"
[active]="isTopicActiveByLegend(topic)"
[secondaryActionLabel]="
getTopicAction(topic, [item.year])?.label ?? null
"
[secondaryActionLink]="
getTopicAction(topic, [item.year])?.link ?? null
"
[secondaryActionQueryParams]="
getTopicAction(topic, [item.year])?.queryParams ??
null
"
(chipClick)="selectTopic(topic, [item.year])">
</app-topic-chip>
</ng-container>
@@ -288,8 +305,19 @@
type="button"
class="main-topic-button"
[disabled]="!phase.primaryTopic.id"
[attr.aria-label]="
getTopicAriaLabel(
phase.primaryTopic,
getPhaseYears(phase)
)
"
[appComponentTooltip]="AppTopicTooltipComponent"
[tooltipInputs]="{ topicId: phase.primaryTopic.id }"
[tooltipInputs]="
getTopicTooltipInputs(
phase.primaryTopic,
getPhaseYears(phase)
)
"
[tooltipMaxWidth]="'500px'"
(click)="
selectTopic(phase.primaryTopic, getPhaseYears(phase))
@@ -317,6 +345,16 @@
[color]="getTopicColor(topic)"
[disabled]="!topic.id"
[active]="isTopicActiveByLegend(topic)"
[secondaryActionLabel]="
getTopicAction(topic, getPhaseYears(phase))?.label ?? null
"
[secondaryActionLink]="
getTopicAction(topic, getPhaseYears(phase))?.link ?? null
"
[secondaryActionQueryParams]="
getTopicAction(topic, getPhaseYears(phase))
?.queryParams ?? null
"
(chipClick)="selectTopic(topic, getPhaseYears(phase))">
</app-topic-chip>
</ng-container>
@@ -396,6 +434,16 @@
[color]="getTopicColor(topic)"
[disabled]="!topic.id"
[active]="isTopicActiveByLegend(topic)"
[secondaryActionLabel]="
getTopicAction(topic, [year.year])?.label ?? null
"
[secondaryActionLink]="
getTopicAction(topic, [year.year])?.link ?? null
"
[secondaryActionQueryParams]="
getTopicAction(topic, [year.year])?.queryParams ??
null
"
(chipClick)="selectTopic(topic, [year.year])">
</app-topic-chip>
</ng-container>
@@ -23,12 +23,14 @@ import {
getTopicLegendFieldId,
getTopicLegendSubfieldId,
TopicLegendGroup,
TopicLegendSelectionState,
TopicLegendSubfieldSelection,
TopicLegendTopic,
toggleTopicLegendFieldSelection,
toggleTopicLegendSubfieldSelection,
} from '../../../../resolvers/utils/topic-legend';
import { buildTopicHierarchyTooltip } from '../../../../resolvers/utils/topic-tooltip';
import { workQueryParamKeys } from '../../../../resolvers/work-page.resolver';
export interface TopicTimelineTopic {
id?: string;
@@ -91,6 +93,19 @@ interface TimelineScrollAnchor {
scrollLeft: number;
}
interface TimelineTopicAction {
label: string;
link: unknown[];
queryParams: Record<string, string | number | number[]>;
}
interface TimelineTopicTooltipInputs {
topicId: string | undefined;
secondaryActionLabel: string | null;
secondaryActionLink: unknown[] | null;
secondaryActionQueryParams: Record<string, string | number | number[]> | null;
}
@Component({
selector: 'app-research-timeline',
standalone: true,
@@ -122,6 +137,8 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
@Input() subfieldLegendVisible = true;
@Input() subfieldLegendExpanded = false;
@Input() wordCloudLegendTopics: TopicLegendTopic[] = [];
@Input() personPublicationsLink: unknown[] | null = null;
@Input() personName = '';
@Output() viewModeChange = new EventEmitter<TimelineViewMode>();
@Output() yearRangeChange = new EventEmitter<TimelineYearRange>();
@@ -130,6 +147,8 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
@Output() loadEarlierYears = new EventEmitter<void>();
@Output() subfieldLegendVisibleChange = new EventEmitter<boolean>();
@Output() subfieldLegendExpandedChange = new EventEmitter<boolean>();
@Output() legendSelectionChange =
new EventEmitter<TopicLegendSelectionState>();
timelineViewMode: TimelineViewMode = 'years';
@@ -143,6 +162,11 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
private readonly displayedPhaseTopicLimit = 4;
private readonly scrollRestoreThreshold = 24;
private readonly expandedPhaseIds = new Set<string>();
private readonly topicActionCache = new Map<string, TimelineTopicAction>();
private readonly tooltipInputsCache = new Map<
string,
TimelineTopicTooltipInputs
>();
activeLegendFieldIds: ReadonlySet<string> = new Set();
activeLegendSubfieldIds: ReadonlySet<string> = new Set();
@@ -166,6 +190,11 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
if (changes['elements'] || changes['startYear'] || changes['endYear']) {
this.applyInputYearRange();
}
if (changes['personName'] || changes['personPublicationsLink']) {
this.topicActionCache.clear();
this.tooltipInputsCache.clear();
}
}
ngAfterViewChecked(): void {
@@ -327,6 +356,85 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
return phase.years.map((year) => year.year);
}
getTopicAction(
topic: TopicTimelineTopic | undefined,
years: number[],
): TimelineTopicAction | null {
if (!this.personPublicationsLink || !topic?.id || years.length === 0) {
return null;
}
const selectedYears = this.normalizeSelectedYears(years);
const cacheKey = `${topic.id}|${selectedYears.join(',')}`;
const cached = this.topicActionCache.get(cacheKey);
if (cached) {
return cached;
}
const person = this.personName || 'dieser Person';
const action: TimelineTopicAction = {
label: `Publikationen von ${person} ${this.formatYearRange(selectedYears)}`,
link: this.personPublicationsLink,
queryParams: {
[workQueryParamKeys.page]: 0,
[workQueryParamKeys.years]: selectedYears,
[workQueryParamKeys.topicId]: topic.id,
},
};
this.topicActionCache.set(cacheKey, action);
return action;
}
getTopicTooltipInputs(
topic: TopicTimelineTopic | undefined,
years: number[],
): TimelineTopicTooltipInputs {
const action = this.getTopicAction(topic, years);
const cacheKey = `${topic?.id ?? ''}|${years.join(',')}`;
const cached = this.tooltipInputsCache.get(cacheKey);
if (cached) {
return cached;
}
const inputs: TimelineTopicTooltipInputs = {
topicId: topic?.id,
secondaryActionLabel: action?.label ?? null,
secondaryActionLink: action?.link ?? null,
secondaryActionQueryParams: action?.queryParams ?? null,
};
this.tooltipInputsCache.set(cacheKey, inputs);
return inputs;
}
getTopicAriaLabel(
topic: TopicTimelineTopic | undefined,
years: number[],
): string | null {
if (!topic?.id || years.length === 0) {
return null;
}
const person = this.personName || 'dieser Person';
const selectedYears = this.normalizeSelectedYears(years);
return `Publikationen von ${person} zum Thema ${topic.name} ${this.formatYearRange(selectedYears)}`;
}
private formatYearRange(years: number[]): string {
const firstYear = years[0];
const lastYear = years[years.length - 1];
return firstYear === lastYear
? `(${firstYear})`
: `(${firstYear}–${lastYear})`;
}
getYearPublicationTooltip(item: TopicTimelineElement): string {
return this.getPublicationTooltip(
item.publication_count,
@@ -412,6 +520,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
this.activeLegendFieldIds = selection.fieldIds;
this.activeLegendSubfieldIds = selection.subfieldIds;
this.legendSelectionChange.emit(selection);
}
onLegendSubfieldToggle(selection: TopicLegendSubfieldSelection): void {
@@ -423,6 +532,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked {
this.activeLegendFieldIds = nextSelection.fieldIds;
this.activeLegendSubfieldIds = nextSelection.subfieldIds;
this.legendSelectionChange.emit(nextSelection);
}
isTopicActiveByLegend(topic: TopicTimelineTopic): boolean {
@@ -10,12 +10,14 @@
<button
type="button"
class="word-cloud-word"
[class.word-cloud-word-active]="isWordActiveByLegend(word)"
[style.color]="word.color"
[style.fontSize.px]="word.fontSize"
[style.fontWeight]="word.fontWeight"
[disabled]="!word.topicId"
[attr.aria-label]="wordAriaLabel(word)"
[appComponentTooltip]="AppTopicTooltipComponent"
[tooltipInputs]="{ topicId: word.rawTopicId }"
[tooltipInputs]="tooltipInputsFor(word)"
[tooltipDisabled]="!word.rawTopicId"
[tooltipMaxWidth]="'500px'"
(click)="selectWord(word)">
@@ -20,12 +20,16 @@
appearance: none;
border: none;
background: none;
padding: 0;
padding: 0.1em 0.3em;
margin: 0;
border-radius: 6px;
font-family: 'Open Sans', Arial, sans-serif;
line-height: 1.1;
cursor: pointer;
transition: transform 0.15s ease;
transition:
transform 0.15s ease,
background-color 0.15s ease,
box-shadow 0.15s ease;
&:hover:not(:disabled),
&:focus-visible {
@@ -38,6 +42,11 @@
}
}
.word-cloud-word-active {
background: color-mix(in srgb, currentColor 14%, transparent);
box-shadow: inset 0 0 0 1.5px currentColor;
}
.word-cloud-state {
margin: 0;
min-height: 420px;
@@ -3,7 +3,19 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ComponentTooltipDirective } from '../../../../directives/component-tooltip.directive';
import { AppTopicTooltipComponent } from '../../../../shared/ui/app-topic-tooltip/app-topic-tooltip.component';
import { topicHierarchyColor } from '../../../../resolvers/utils/topic-colors';
import { TopicLegendTopic } from '../../../../resolvers/utils/topic-legend';
import {
getTopicLegendFieldId,
getTopicLegendSubfieldId,
TopicLegendTopic,
} from '../../../../resolvers/utils/topic-legend';
import { workQueryParamKeys } from '../../../../resolvers/work-page.resolver';
interface WordTooltipInputs {
topicId: string;
secondaryActionLabel: string | null;
secondaryActionLink: unknown[] | null;
secondaryActionQueryParams: Record<string, string | number>;
}
export interface WordCloudTopicOccurrence {
name: string;
@@ -21,6 +33,8 @@ export interface WordCloudWord {
name: string;
topicId: string;
rawTopicId: string;
fieldLegendId: string;
subfieldLegendId: string;
color: string;
fontSize: number;
fontWeight: number;
@@ -92,6 +106,10 @@ export function buildResearchWordcloud(
name,
topicId: legendTopic?.id ?? '',
rawTopicId: stripOpenAlexId(legendTopic?.id),
fieldLegendId: legendTopic ? getTopicLegendFieldId(legendTopic) : '',
subfieldLegendId: legendTopic
? getTopicLegendSubfieldId(legendTopic)
: '',
color: topicHierarchyColor(legendTopic),
fontSize: Math.round(
minimumFontSize + scale * (maximumFontSize - minimumFontSize),
@@ -148,12 +166,36 @@ function stripOpenAlexId(id: string | null | undefined): string {
export class ResearchWordcloudComponent {
readonly AppTopicTooltipComponent = AppTopicTooltipComponent;
@Input() words: WordCloudWord[] = [];
@Input() set words(value: WordCloudWord[]) {
this._words = value;
this.rebuildTooltipInputs();
}
get words(): WordCloudWord[] {
return this._words;
}
@Input() set personPublicationsLink(value: unknown[] | null) {
this._personPublicationsLink = value;
this.rebuildTooltipInputs();
}
@Input() set personName(value: string) {
this._personName = value;
this.rebuildTooltipInputs();
}
@Input() loading = false;
@Input() loadFailed = false;
@Input() activeFieldIds: ReadonlySet<string> = new Set();
@Input() activeSubfieldIds: ReadonlySet<string> = new Set();
@Output() wordSelect = new EventEmitter<WordCloudWord>();
private _words: WordCloudWord[] = [];
private _personPublicationsLink: unknown[] | null = null;
private _personName = '';
private tooltipInputsByTopic = new Map<string, WordTooltipInputs>();
selectWord(word: WordCloudWord): void {
if (!word.topicId) {
return;
@@ -161,4 +203,46 @@ export class ResearchWordcloudComponent {
this.wordSelect.emit(word);
}
isWordActiveByLegend(word: WordCloudWord): boolean {
return (
this.activeFieldIds.has(word.fieldLegendId) ||
(word.subfieldLegendId.length > 0 &&
this.activeSubfieldIds.has(word.subfieldLegendId))
);
}
tooltipInputsFor(word: WordCloudWord): WordTooltipInputs | null {
return this.tooltipInputsByTopic.get(word.topicId) ?? null;
}
wordAriaLabel(word: WordCloudWord): string {
return this._personName
? `Publikationen von ${this._personName} zum Thema ${word.name}`
: `Publikationen dieser Person zum Thema ${word.name}`;
}
private rebuildTooltipInputs(): void {
const label = this._personName
? `Publikationen von ${this._personName}`
: 'Publikationen dieser Person';
const link = this._personPublicationsLink;
this.tooltipInputsByTopic = new Map(
this._words
.filter((word) => word.topicId)
.map((word) => [
word.topicId,
{
topicId: word.rawTopicId,
secondaryActionLabel: link ? label : null,
secondaryActionLink: link,
secondaryActionQueryParams: {
[workQueryParamKeys.page]: 0,
[workQueryParamKeys.topicId]: word.topicId,
},
},
]),
);
}
}
@@ -12,18 +12,25 @@
[subfieldLegendVisible]="timelineLegendVisible"
[subfieldLegendExpanded]="timelineLegendExpanded"
[wordCloudLegendTopics]="wordCloudLegendTopics"
[personName]="personName"
[personPublicationsLink]="personPublicationsLink"
(viewModeChange)="onTimelineViewModeChange($event)"
(yearRangeChange)="onTimelineYearRangeChange($event)"
(subfieldLegendVisibleChange)="onTimelineLegendVisibleChange($event)"
(subfieldLegendExpandedChange)="onTimelineLegendExpandedChange($event)"
(topicSelect)="onTimelineTopicSelect($event)"
(yearSelect)="onTimelineYearSelect($event)"
(loadEarlierYears)="onTimelineLoadEarlierYears()">
(loadEarlierYears)="onTimelineLoadEarlierYears()"
(legendSelectionChange)="onLegendSelectionChange($event)">
<app-research-wordcloud
timeline-wordcloud-content
[words]="wordCloudWords"
[loading]="loadingWordCloud"
[loadFailed]="wordCloudLoadFailed"
[activeFieldIds]="activeLegendFieldIds"
[activeSubfieldIds]="activeLegendSubfieldIds"
[personName]="personName"
[personPublicationsLink]="personPublicationsLink"
(wordSelect)="onWordClick($event)" />
</app-research-timeline>
</section>
@@ -1,7 +1,7 @@
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { combineLatest, distinctUntilChanged, map } from 'rxjs';
import { combineLatest, distinctUntilChanged, map, of, switchMap } from 'rxjs';
import { TopicCount, TopicsByYear, WorksService } from '../../api';
import {
@@ -19,7 +19,11 @@ import {
WordCloudWord,
} from './components/research-wordcloud/research-wordcloud.component';
import { workQueryParamKeys } from '../../resolvers/work-page.resolver';
import { TopicLegendTopic } from '../../resolvers/utils/topic-legend';
import {
TopicLegendSelectionState,
TopicLegendTopic,
} from '../../resolvers/utils/topic-legend';
import { PersonDataResolved } from '../../resolvers/person.resolver';
@Component({
selector: 'app-person-overview',
@@ -64,6 +68,10 @@ export class PersonOverviewComponent implements OnInit {
wordCloudLegendTopics: TopicLegendTopic[] = [];
loadingWordCloud = false;
wordCloudLoadFailed = false;
activeLegendFieldIds: ReadonlySet<string> = new Set();
activeLegendSubfieldIds: ReadonlySet<string> = new Set();
personName = '';
personPublicationsLink: unknown[] | null = null;
private rawTopicOccurrences: WordCloudTopicOccurrence[] = [];
@@ -75,10 +83,16 @@ export class PersonOverviewComponent implements OnInit {
takeUntilDestroyed(this.destroyRef),
)
.subscribe((authorId) => {
this.personPublicationsLink =
authorId && authorId !== '0'
? ['/person', authorId, 'publications']
: null;
this.loadTopicTimeline(authorId);
this.loadWordCloud(authorId);
});
this.loadPersonName();
this.route.queryParamMap
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((queryParams) => {
@@ -210,6 +224,11 @@ export class PersonOverviewComponent implements OnInit {
});
}
onLegendSelectionChange(selection: TopicLegendSelectionState): void {
this.activeLegendFieldIds = selection.fieldIds;
this.activeLegendSubfieldIds = selection.subfieldIds;
}
private findAuthorId(paramMaps: readonly ParamMap[]): string {
return (
paramMaps
@@ -327,6 +346,25 @@ export class PersonOverviewComponent implements OnInit {
this.timelineEarlierYearsLoadFailed = false;
}
private loadPersonName(): void {
combineLatest(this.route.pathFromRoot.map((route) => route.data))
.pipe(
map((dataEntries) =>
dataEntries
.map((data) => data['personData'] as PersonDataResolved | undefined)
.find((resolved): resolved is PersonDataResolved =>
Boolean(resolved),
),
),
distinctUntilChanged(),
switchMap((resolved) => resolved?.personData$ ?? of(null)),
takeUntilDestroyed(this.destroyRef),
)
.subscribe((response) => {
this.personName = response?.results?.[0]?.display_name ?? '';
});
}
private loadWordCloud(authorId: string): void {
if (!authorId || authorId === '0') {
this.wordCloudWords = [];
@@ -1,7 +1,7 @@
@if (loading) {
<app-loading
text="Patentdaten werden geladen..."
icon="workspace_premium"
[icon]="PATENT_ICON"
[size]="150"
[diameter]="150" />
} @else if (error) {
@@ -13,167 +13,29 @@
<div class="patents-content">
<div class="patents-list">
<div class="patents-list-toolbar">
<app-source-filter
[value]="activeFilter"
(valueChange)="setFilter($event)" />
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="filter_alt"></mat-icon>
<mat-select
[value]="activeFilter"
(selectionChange)="setFilter($event.value)">
<mat-select-trigger>Filter nach Quelle</mat-select-trigger>
<mat-option value="all">Alle</mat-option>
<mat-option value="EPO">EPO</mat-option>
<mat-option value="USPTO">USPTO</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field
class="patents-toolbar-field"
subscriptSizing="dynamic">
<mat-icon matPrefix fontIcon="sort"></mat-icon>
<mat-icon matPrefix [fontIcon]="SORT_ICON"></mat-icon>
<mat-select
[value]="sortColumn"
(selectionChange)="setSort($event.value)">
<mat-select-trigger>Sortieren nach</mat-select-trigger>
<mat-option value="year">Jahr</mat-option>
<mat-option value="publication_year">Jahr</mat-option>
<mat-option value="title">Titel</mat-option>
<mat-option value="source">Quelle</mat-option>
</mat-select>
</mat-form-field>
</div>
<table>
<thead>
<tr>
<th>Patent</th>
<th
class="sortable"
[class.sort-active]="sortColumn === 'source'"
(click)="setSort('source')">
Quelle
@if (sortColumn === 'source') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th
class="sortable"
[class.sort-active]="sortColumn === 'year'"
(click)="setSort('year')">
Jahr
@if (sortColumn === 'year') {
<mat-icon class="sort-icon">{{
sortDirection === 'asc' ? 'arrow_upward' : 'arrow_downward'
}}</mat-icon>
}
</th>
<th>Erfinder</th>
<th>Anmelder</th>
</tr>
</thead>
<tbody>
@for (
patent of getPagedPatents();
track trackPatent($index, patent)
) {
<tr
[class.selected]="selectedPatent === patent"
(click)="selectPatent(patent)">
<td class="patent-title">
{{ patent.title ?? patent.patent_id }}
</td>
<td>
<span
class="source-badge source-badge--{{
patent.source.toLowerCase()
}}">
{{ patent.source }}
</span>
</td>
<td>
@if (patent.publication_year) {
<span class="year-badge">{{
patent.publication_year
}}</span>
} @else {
<span>-</span>
}
</td>
<td class="patent-people">
@if (patent.inventors && patent.inventors.length) {
<div class="person-chips">
@for (
inventor of patent.inventors.slice(0, 2);
track inventor
) {
<span class="person-chip">
<mat-icon>person</mat-icon>
{{ inventor }}
</span>
}
@if (patent.inventors.length > 2) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>person</mat-icon>
{{ patent.inventors[2] }}
</span>
@if (patent.inventors.length > 3) {
<span class="person-chip person-chip--more"
>+{{ patent.inventors.length - 3 }}</span
>
}
</span>
}
</div>
} @else {
<span>-</span>
}
</td>
<td class="patent-people">
@if (patent.assignees && patent.assignees.length) {
<div class="person-chips">
@for (
assignee of patent.assignees.slice(0, 2);
track assignee
) {
<span class="person-chip">
<mat-icon>{{
isAssigneeLikelyPerson(assignee, patent)
? 'person'
: 'apartment'
}}</mat-icon>
{{ assignee }}
</span>
}
@if (patent.assignees.length > 2) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>{{
isAssigneeLikelyPerson(
patent.assignees[2],
patent
)
? 'person'
: 'apartment'
}}</mat-icon>
{{ patent.assignees[2] }}
</span>
@if (patent.assignees.length > 3) {
<span class="person-chip person-chip--more"
>+{{ patent.assignees.length - 3 }}</span
>
}
</span>
}
</div>
} @else {
<span>-</span>
}
</td>
</tr>
}
</tbody>
</table>
<app-patent-table
[patents]="getPagedPatents()"
[selectedPatent]="selectedPatent"
(selectPatent)="selectPatent($event)"
(handleSortChange)="onSortChange($event)" />
<app-query-param-paginator
[total]="filteredPatents.length"
@@ -230,7 +92,7 @@
<span class="patent-detail-action__label"
>Patentdetails anzeigen</span
>
<mat-icon aria-hidden="true">chevron_right</mat-icon>
<mat-icon aria-hidden="true">{{ CHEVRON_RIGHT_ICON }}</mat-icon>
</button>
<p class="patent-detail-hint">
Abstract, Erfinder, Anmelder und IPC/CPC-Klassifikation
@@ -41,127 +41,6 @@ app-query-param-paginator {
margin-bottom: 18px;
flex-wrap: wrap;
}
table {
width: 100%;
border-collapse: collapse;
th {
text-align: left;
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
font-size: 12px;
font-weight: 700;
color: var(--sg-text-muted);
&.sortable {
display: table-cell;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
}
.sort-icon {
vertical-align: middle;
margin-left: 2px;
width: 14px;
height: 14px;
font-size: 14px;
}
}
tr {
cursor: pointer;
color: var(--sg-text);
transition: background-color 0.15s ease;
&:hover td {
background: var(--sg-surface-soft);
}
&.selected td {
background: var(--sg-primary-soft);
}
}
td {
padding: 12px 16px;
border-bottom: 1px solid var(--sg-border);
color: var(--sg-text);
font-size: 13px;
transition: background-color 0.15s ease;
}
.patent-title {
color: var(--sg-text);
font-weight: 600;
max-width: 320px;
white-space: normal;
word-break: break-word;
}
.patent-people {
max-width: 260px;
}
}
}
.year-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 26px;
padding: 2px 10px;
border-radius: 999px;
border: 1px solid var(--sg-border);
color: var(--sg-text);
font-size: 0.8rem;
font-weight: 600;
}
.person-chips {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.person-chip-row {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
.person-chip {
display: inline-flex;
align-items: center;
gap: 4px;
max-width: 100%;
padding: 2px 8px;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
background: var(--sg-surface-soft);
color: var(--sg-text);
font-size: 0.75rem;
line-height: 1.4;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
mat-icon {
flex-shrink: 0;
width: 14px;
height: 14px;
font-size: 14px;
color: var(--sg-text-soft);
}
&--more {
color: var(--sg-text-muted);
font-weight: 600;
}
}
.match-badges {
@@ -6,6 +6,7 @@ import { finalize, of, switchMap } from 'rxjs';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';
import { MatIconModule } from '@angular/material/icon';
import { Sort } from '@angular/material/sort';
import { PatentEntry } from '../../api/model/patentEntry';
import { PersonPatentsResolved } from '../../resolvers/person-patents.resolver';
import {
@@ -15,8 +16,16 @@ import {
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { PageEvent } from '@angular/material/paginator';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
import { PatentTableComponent } from '../../shared/ui/patent-table/patent-table.component';
import {
CHEVRON_RIGHT_ICON,
FILTER_ICON,
PATENT_ICON,
SORT_ICON,
} from '../../shared/ui/icons';
import { SourceFilterComponent } from '../../shared/ui/source-filter/source-filter.component';
type SortColumn = 'title' | 'year' | 'source';
type SortColumn = 'title' | 'publication_year' | 'source';
type SortDirection = 'asc' | 'desc';
type SourceFilter = 'all' | 'EPO' | 'USPTO';
@@ -29,11 +38,18 @@ type SourceFilter = 'all' | 'EPO' | 'USPTO';
MatSelectModule,
MatIconModule,
QueryParamPaginatorComponent,
PatentTableComponent,
SourceFilterComponent,
],
templateUrl: './person-patents.component.html',
styleUrl: './person-patents.component.scss',
})
export class PersonPatentsComponent {
readonly PATENT_ICON = PATENT_ICON;
readonly FILTER_ICON = FILTER_ICON;
readonly SORT_ICON = SORT_ICON;
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
private route = inject(ActivatedRoute);
private router = inject(Router);
private destroyRef = inject(DestroyRef);
@@ -47,7 +63,7 @@ export class PersonPatentsComponent {
error = false;
activeFilter: SourceFilter = 'all';
sortColumn: SortColumn = 'year';
sortColumn: SortColumn = 'publication_year';
sortDirection: SortDirection = 'desc';
pageIndex = 0;
@@ -119,12 +135,22 @@ export class PersonPatentsComponent {
this.pageSize = event.pageSize;
}
onSortChange(sort: Sort): void {
if (!sort.direction || !this.isValidSortColumn(sort.active)) {
return;
}
this.sortColumn = sort.active;
this.sortDirection = sort.direction;
this.applyFilter();
this.updateQueryParams();
}
setSort(column: SortColumn): void {
if (this.sortColumn === column) {
this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
} else {
this.sortColumn = column;
this.sortDirection = column === 'year' ? 'desc' : 'asc';
this.sortDirection = column === 'publication_year' ? 'desc' : 'asc';
}
this.applyFilter();
this.updateQueryParams();
@@ -154,7 +180,7 @@ export class PersonPatentsComponent {
const direction = this.sortDirection === 'asc' ? 1 : -1;
return [...patents].sort((a, b) => {
switch (this.sortColumn) {
case 'year': {
case 'publication_year': {
const yearA = a.publication_date ?? String(a.publication_year ?? '');
const yearB = b.publication_date ?? String(b.publication_year ?? '');
return direction * yearA.localeCompare(yearB);
@@ -202,7 +228,9 @@ export class PersonPatentsComponent {
}
private isValidSortColumn(value: string | null): value is SortColumn {
return value === 'title' || value === 'year' || value === 'source';
return (
value === 'title' || value === 'publication_year' || value === 'source'
);
}
private isValidSortDirection(value: string | null): value is SortDirection {
@@ -214,42 +242,6 @@ export class PersonPatentsComponent {
return this.filteredPatents.slice(start, start + this.pageSize);
}
private static readonly ORG_SUFFIX_PATTERN =
/\b(Inc|Ltd|LLC|LLP|GmbH|Corp(oration)?|Co|KG|AG|SE|S\.?A\.?|N\.?V\.?|B\.?V\.?|PLC|Universit(y|ät|é)|Institut(e)?|Foundation|Laborator(y|ies)|Labs?|Group|Holdings?|Company|Gesellschaft)\b\.?/i;
private static readonly PERSON_SUFFIX_PATTERN =
/\b(Dr|Prof|PhD|Ph\.D|M\.D|Jr|Sr)\b\.?/i;
private normalizeNameForComparison(name: string): string {
return name
.normalize('NFD')
.replace(/[̀-ͯ]/g, '')
.replace(/[.,]/g, '')
.toUpperCase()
.split(/\s+/)
.filter(Boolean)
.sort()
.join(' ');
}
isAssigneeLikelyPerson(assignee: string, patent: PatentEntry): boolean {
if (PersonPatentsComponent.ORG_SUFFIX_PATTERN.test(assignee)) {
return false;
}
const normalizedAssignee = this.normalizeNameForComparison(
assignee.replace(PersonPatentsComponent.PERSON_SUFFIX_PATTERN, ''),
);
const matchesInventor = (patent.inventors ?? []).some(
(inventor) =>
this.normalizeNameForComparison(inventor) === normalizedAssignee,
);
if (matchesInventor) {
return true;
}
return PersonPatentsComponent.PERSON_SUFFIX_PATTERN.test(assignee);
}
formatDate(date: string | null | undefined): string {
return formatPatentDate(date);
}
@@ -262,15 +254,6 @@ export class PersonPatentsComponent {
return this.patents.filter((p) => p.source === 'USPTO').length;
}
trackPatent(_index: number, patent: PatentEntry): string {
return [
patent.source,
patent.patent_id,
patent.publication_date ?? '',
patent.kind ?? patent.application_type ?? '',
].join('|');
}
getAbstractPreview(abstract: string | null | undefined): string | null {
if (!abstract?.trim()) {
return null;
@@ -23,13 +23,13 @@
(click)="toggleBookmark()">
<mat-icon>{{
bookmarkService.isBookmarked(person()?.id)
? 'bookmark'
: 'bookmark_border'
? BOOKMARK_ICON
: BOOKMARK_BORDER_ICON
}}</mat-icon>
</button>
</div>
<div class="institution-line">
<mat-icon class="institution-icon">apartment</mat-icon>
<mat-icon class="institution-icon">{{ APARTMENT_ICON }}</mat-icon>
@if (institutionId(); as institutionId) {
<a
class="institution-link"
@@ -52,7 +52,7 @@
<span class="stats-line">
@if (worksCount() !== null) {
<span class="stat-item">
<mat-icon class="stat-icon">menu_book</mat-icon>
<mat-icon class="stat-icon">{{ PUBLICATION_ICON }}</mat-icon>
{{ worksCount() | number }} Publikationen
</span>
}
@@ -61,7 +61,7 @@
}
@if (citedByCount() !== null) {
<span class="stat-item">
<mat-icon class="stat-icon">format_quote</mat-icon>
<mat-icon class="stat-icon">{{ CITATION_ICON }}</mat-icon>
{{ citedByCount() | number }} Zitationen
</span>
}
@@ -85,7 +85,7 @@
"
matTooltipPosition="right"
[matTooltipShowDelay]="250">
<mat-icon class="stat-icon">trending_up</mat-icon>
<mat-icon class="stat-icon">{{ TRENDING_UP_ICON }}</mat-icon>
h-Index {{ h_index() }}
</span>
}
@@ -105,7 +105,7 @@
matTooltip="ORCID-Profil öffnen"
matTooltipPosition="right"
[matTooltipShowDelay]="250">
<mat-icon>verified</mat-icon>
<mat-icon>{{ VERIFIED_ICON }}</mat-icon>
{{ orcidId }}
</a>
}
@@ -118,7 +118,7 @@
@if (isBioLoading()) {
<app-loading
text="Biografie wird geladen..."
icon="description"
[icon]="DESCRIPTION_ICON"
[size]="150"
[diameter]="150"></app-loading>
} @else if (personBio() != null) {
@@ -130,6 +130,8 @@
<app-person-interesting
[topics]="primaryTopicCounts()"
[loading]="isTopicsLoading()"
[personName]="personName()"
[personPublicationsLink]="personPublicationsLink()"
(tagClick)="onInterestingTagClick($event)"></app-person-interesting>
</section>
@if (this.links()) {
@@ -141,7 +143,7 @@
} @else {
<app-loading
text="Person wird geladen..."
icon="person"
[icon]="PERSON_ICON"
[size]="150"
[diameter]="150"></app-loading>
}
@@ -5,6 +5,7 @@ import {
inject,
signal,
DestroyRef,
ElementRef,
input,
viewChild,
} from '@angular/core';
@@ -18,11 +19,20 @@ import { MatTabsModule } from '@angular/material/tabs';
import { MatTooltipModule } from '@angular/material/tooltip';
import {
ActivatedRoute,
NavigationEnd,
Router,
RouterModule,
RouterOutlet,
} from '@angular/router';
import { of, switchMap, finalize, map, catchError, combineLatest } from 'rxjs';
import {
of,
switchMap,
finalize,
map,
catchError,
combineLatest,
filter,
} from 'rxjs';
import { PersonInterestingComponent } from '../person-interesting/person-interesting.component';
import { CountryFlagComponent } from '../../shared/ui/country-flag/country-flag.component';
@@ -39,14 +49,22 @@ import {
LinkTabNavBarItem,
} from '../../shared/ui/link-tab-nav-bar/link-tab-nav-bar.component';
import {
APARTMENT_ICON,
BOOKMARK_BORDER_ICON,
BOOKMARK_ICON,
CITATION_ICON,
COMPANY_CONNECTION_ICON,
DESCRIPTION_ICON,
FUNDING_ICON,
NETWORK_ICON,
NEWS_ICON,
OVERVIEW_ICON,
PATENT_ICON,
PERSON_ICON,
PROJECT_ICON,
PUBLICATION_ICON,
TRENDING_UP_ICON,
VERIFIED_ICON,
} from '../../shared/ui/icons';
@Component({
@@ -68,6 +86,16 @@ import {
styleUrl: './person.component.scss',
})
export class PersonComponent {
readonly BOOKMARK_ICON = BOOKMARK_ICON;
readonly BOOKMARK_BORDER_ICON = BOOKMARK_BORDER_ICON;
readonly APARTMENT_ICON = APARTMENT_ICON;
readonly PUBLICATION_ICON = PUBLICATION_ICON;
readonly CITATION_ICON = CITATION_ICON;
readonly TRENDING_UP_ICON = TRENDING_UP_ICON;
readonly VERIFIED_ICON = VERIFIED_ICON;
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
readonly PERSON_ICON = PERSON_ICON;
private readonly router = inject(Router);
private readonly activatedRoute = inject(ActivatedRoute);
@@ -82,11 +110,28 @@ export class PersonComponent {
() => this.navBar()?.activeLink() ?? null,
);
private readonly tabPanelElement = viewChild('tabPanel', {
read: ElementRef,
});
private publicationFilterKey: string | null = null;
constructor() {
this.bookmarkService
.load()
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe();
this.router.events
.pipe(
filter(
(event): event is NavigationEnd => event instanceof NavigationEnd,
),
takeUntilDestroyed(this.destroyRef),
)
.subscribe((event) =>
this.scrollToPanelOnFilterChange(event.urlAfterRedirects),
);
}
readonly params = toSignal(this.activatedRoute.paramMap);
@@ -169,6 +214,13 @@ export class PersonComponent {
readonly displayName = computed(
() => this.person()?.display_name ?? 'Unbekannte Person',
);
readonly personName = computed(() => this.person()?.display_name ?? '');
readonly personPublicationsLink = computed<unknown[] | null>(() => {
const authorId = this.authorId();
return authorId ? ['/person', authorId, 'publications'] : null;
});
readonly initials = computed(() => this.buildInitials(this.displayName()));
readonly primaryAffiliation = computed(
() => this.person()?.affiliations?.[0] ?? null,
@@ -368,6 +420,46 @@ export class PersonComponent {
});
}
private scrollToPanelOnFilterChange(url: string): void {
const { queryParams } = this.router.parseUrl(url);
const filterKey = [workQueryParamKeys.topicId, workQueryParamKeys.years]
.map((key) => {
const value = queryParams[key];
return Array.isArray(value) ? value.join(',') : (value ?? '');
})
.join('|');
const previousFilterKey = this.publicationFilterKey;
this.publicationFilterKey = filterKey;
const hasFilter = filterKey !== '|';
const isFirstNavigation = previousFilterKey === null;
if (isFirstNavigation || !hasFilter || filterKey === previousFilterKey) {
return;
}
this.scrollPanelIntoView();
}
private scrollPanelIntoView(): void {
const scrollToPanel = (): void => {
this.tabPanelElement()?.nativeElement.scrollIntoView({
behavior: 'smooth',
block: 'start',
});
};
requestAnimationFrame(scrollToPanel);
setTimeout(() => {
const panel = this.tabPanelElement();
if (panel && panel.nativeElement.getBoundingClientRect().top > 8) {
scrollToPanel();
}
}, 400);
}
private getId(key: string): string | null {
const ids = this.person()?.ids as Record<string, string> | undefined;
if (!ids) {
@@ -2,7 +2,7 @@
<div class="page-header">
<div class="breadcrumb">
<span>Bund Projekte</span>
<mat-icon>chevron_right</mat-icon>
<mat-icon>{{ CHEVRON_RIGHT_ICON }}</mat-icon>
<span>Projektdetails</span>
</div>
</div>
@@ -31,18 +31,18 @@
[style.background-color]="
getStatusColor(getStatusDisplay(bundProject.funding_end_date))
">
<mat-icon>circle</mat-icon>
<mat-icon>{{ CIRCLE_ICON }}</mat-icon>
<span>{{ getStatusDisplay(bundProject.funding_end_date) }}</span>
</div>
<!-- @if (bundProject.project_agency) {
<div class="agency-info" (click)="searchForAgency(bundProject.project_agency)">
<mat-icon>account_balance</mat-icon>
<mat-icon>{{ ACCOUNT_BALANCE_ICON }}</mat-icon>
<span>{{ bundProject.project_agency_fullname || bundProject.project_agency }}</span>
</div>
} -->
<!-- @if (bundProject.funding_type) {
<div class="funding-type-info" (click)="searchForFundingType(bundProject.funding_type)">
<mat-icon>category</mat-icon>
<mat-icon>{{ CATEGORY_ICON }}</mat-icon>
<span>{{ bundProject.funding_type }}</span>
</div>
} -->
@@ -51,7 +51,7 @@
<div class="metrics-grid">
<div class="metric-item">
<mat-icon>calendar_today</mat-icon>
<mat-icon>{{ CALENDAR_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{
bundProject.funding_start_date | date: 'dd.MM.yyyy'
@@ -60,7 +60,7 @@
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<mat-icon>{{ EVENT_BUSY_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{
getFundingStatus(bundProject.funding_end_date)
@@ -70,7 +70,7 @@
</div>
</div>
<div class="metric-item">
<mat-icon>access_time</mat-icon>
<mat-icon>{{ ACCESS_TIME_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{
getStatusDisplay(bundProject.funding_end_date)
@@ -80,7 +80,7 @@
</div>
@if (bundProject.funding_amount) {
<div class="metric-item">
<mat-icon>paid</mat-icon>
<mat-icon>{{ PAID_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{
bundProject.funding_amount
@@ -92,7 +92,7 @@
}
@if (bundProject.funding_profile) {
<div class="metric-item">
<mat-icon>assignment</mat-icon>
<mat-icon>{{ ASSIGNMENT_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{ bundProject.funding_profile }}</strong>
<span>Förderprofil</span>
@@ -107,7 +107,7 @@
@if (bundProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<mat-icon>{{ DESCRIPTION_ICON }}</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ bundProject.description }}</p>
@@ -122,7 +122,7 @@
@if (getAssociatedPersons().length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>people</mat-icon>
<mat-icon>{{ PEOPLE_ICON }}</mat-icon>
<h2>Beteiligte Personen</h2>
<span class="count-badge">{{
getAssociatedPersons().length
@@ -148,7 +148,7 @@
) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>business</mat-icon>
<mat-icon>{{ BUSINESS_ICON }}</mat-icon>
<h2>Beteiligte Institution</h2>
</div>
<dl class="details-list">
@@ -234,7 +234,7 @@
) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>location_on</mat-icon>
<mat-icon>{{ LOCATION_ICON }}</mat-icon>
<h2>Standort</h2>
</div>
<dl class="details-list">
@@ -285,7 +285,7 @@
) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>more_info</mat-icon>
<mat-icon>{{ MORE_INFO_ICON }}</mat-icon>
<h2>Weitere Informationen</h2>
</div>
<dl class="details-list">
@@ -322,7 +322,7 @@
<!-- Projektdetails -->
<mat-card appearance="outlined" class="card details-card">
<div class="section-header">
<mat-icon>info</mat-icon>
<mat-icon>{{ INFO_ICON }}</mat-icon>
<h2>Projektdetails</h2>
</div>
<dl class="details-list">
@@ -408,7 +408,7 @@
} @else {
<div class="error-container">
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
<p>Bund Projekt nicht gefunden.</p>
</div>
</div>
@@ -5,6 +5,24 @@ import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { BundProjectDetails } from '../../../api/model/bundProjectDetails';
import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/project-oa-topics.component';
import {
ACCESS_TIME_ICON,
ACCOUNT_BALANCE_ICON,
ASSIGNMENT_ICON,
BUSINESS_ICON,
CALENDAR_ICON,
CATEGORY_ICON,
CHEVRON_RIGHT_ICON,
CIRCLE_ICON,
DESCRIPTION_ICON,
ERROR_OUTLINE_ICON,
EVENT_BUSY_ICON,
INFO_ICON,
LOCATION_ICON,
MORE_INFO_ICON,
PAID_ICON,
PEOPLE_ICON,
} from '../../../shared/ui/icons';
export interface InstitutionEntry {
label: string;
@@ -23,6 +41,23 @@ export interface InstitutionEntry {
styleUrl: './bund-details.component.scss',
})
export class BundDetailsComponent implements OnInit {
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
readonly CIRCLE_ICON = CIRCLE_ICON;
readonly CALENDAR_ICON = CALENDAR_ICON;
readonly EVENT_BUSY_ICON = EVENT_BUSY_ICON;
readonly ACCESS_TIME_ICON = ACCESS_TIME_ICON;
readonly PAID_ICON = PAID_ICON;
readonly ASSIGNMENT_ICON = ASSIGNMENT_ICON;
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
readonly PEOPLE_ICON = PEOPLE_ICON;
readonly BUSINESS_ICON = BUSINESS_ICON;
readonly LOCATION_ICON = LOCATION_ICON;
readonly MORE_INFO_ICON = MORE_INFO_ICON;
readonly INFO_ICON = INFO_ICON;
readonly ERROR_OUTLINE_ICON = ERROR_OUTLINE_ICON;
readonly ACCOUNT_BALANCE_ICON = ACCOUNT_BALANCE_ICON;
readonly CATEGORY_ICON = CATEGORY_ICON;
private readonly route = inject(ActivatedRoute);
bundProject: BundProjectDetails | undefined;
@@ -2,7 +2,7 @@
<div class="page-header">
<div class="breadcrumb">
<span>DFG Projekte</span>
<mat-icon>chevron_right</mat-icon>
<mat-icon>{{ CHEVRON_RIGHT_ICON }}</mat-icon>
<span>Projektdetails</span>
</div>
</div>
@@ -34,7 +34,7 @@
[style.background-color]="
getStatusColor(getStatusDisplay(dfgProject.funding_end))
">
<mat-icon>circle</mat-icon>
<mat-icon>{{ CIRCLE_ICON }}</mat-icon>
<span>{{ getStatusDisplay(dfgProject.funding_end) }}</span>
</div>
@if (dfgProject.page_url) {
@@ -42,7 +42,7 @@
[href]="dfgProject.page_url"
target="_blank"
class="primary-action">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
<span>Zum Projekt</span>
</a>
}
@@ -51,7 +51,7 @@
[href]="dfgProject.external_link"
target="_blank"
class="secondary-action">
<mat-icon>language</mat-icon>
<mat-icon>{{ LANGUAGE_ICON }}</mat-icon>
<span>Webseite</span>
</a>
}
@@ -60,21 +60,21 @@
<div class="metrics-grid">
<div class="metric-item">
<mat-icon>calendar_today</mat-icon>
<mat-icon>{{ CALENDAR_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.funding_start || 'N/A' }}</strong>
<span>Förderbeginn</span>
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<mat-icon>{{ EVENT_BUSY_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{ getFundingEndDisplay(dfgProject.funding_end) }}</strong>
<span>Förderende</span>
</div>
</div>
<div class="metric-item">
<mat-icon>access_time</mat-icon>
<mat-icon>{{ ACCESS_TIME_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{ getStatusDisplay(dfgProject.funding_end) }}</strong>
<span>Status</span>
@@ -82,7 +82,7 @@
</div>
@if (dfgProject.dfg_procedure) {
<div class="metric-item">
<mat-icon>gavel</mat-icon>
<mat-icon>{{ GAVEL_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{ dfgProject.dfg_procedure }}</strong>
<span>DFG Verfahren</span>
@@ -91,7 +91,7 @@
}
@if (getFundingType()) {
<div class="metric-item">
<mat-icon>paid</mat-icon>
<mat-icon>{{ PAID_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{ getFundingType() }}</strong>
<span>Förderung</span>
@@ -100,7 +100,7 @@
}
@if (getInternationalRelation()) {
<div class="metric-item">
<mat-icon>public</mat-icon>
<mat-icon>{{ PUBLIC_ICON }}</mat-icon>
<div class="metric-content">
<strong>{{ getInternationalRelation() }}</strong>
<span>Internationaler Bezug</span>
@@ -115,7 +115,7 @@
@if (getDescription()) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>description</mat-icon>
<mat-icon>{{ DESCRIPTION_ICON }}</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ getDescription() }}</p>
@@ -125,7 +125,7 @@
@if (getFinalReportAbstract()) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>fact_check</mat-icon>
<mat-icon>{{ FACT_CHECK_ICON }}</mat-icon>
<h2>Abschlussbericht</h2>
</div>
<p class="description-text">{{ getFinalReportAbstract() }}</p>
@@ -138,46 +138,15 @@
}
<!-- Fachsystematik -->
@if (getSubjectClassifications().length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>category</mat-icon>
<h2>Fachsystematik</h2>
<span class="count-badge">{{
getSubjectClassifications().length
}}</span>
</div>
<div class="classification-list">
@for (entry of getSubjectClassifications(); track $index) {
<div class="classification-path">
@for (
segment of getClassificationParentSegments(entry);
track $index
) {
<span class="classification-segment">{{ segment }}</span>
<mat-icon class="classification-separator"
>chevron_right</mat-icon
>
}
<div class="classification-leaf-group">
@for (
leaf of getClassificationLeafSegments(entry);
track $index
) {
<span
class="classification-segment classification-segment--leaf">
{{ leaf }}
</span>
}
</div>
</div>
}
</div>
</mat-card>
<app-dfg-classification
[classifications]="
getSubjectClassifications()
"></app-dfg-classification>
}
<!-- Beteiligte Personen -->
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>people</mat-icon>
<mat-icon>{{ PEOPLE_ICON }}</mat-icon>
<h2>Beteiligte Personen</h2>
<span class="count-badge">{{ getPersonCount() }}</span>
</div>
@@ -215,7 +184,7 @@
<!-- Beteiligte Institutionen -->
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>business</mat-icon>
<mat-icon>{{ BUSINESS_ICON }}</mat-icon>
<h2>Beteiligte Institutionen</h2>
<span class="count-badge">{{ getInstitutionCount() }}</span>
</div>
@@ -227,7 +196,7 @@
searchForInstitutionName(getInstitutionName(institution))
"
class="institution-item">
<mat-icon>apartment</mat-icon>
<mat-icon>{{ APARTMENT_ICON }}</mat-icon>
<div class="institution-details">
<span>{{ getInstitutionName(institution) }}</span>
@if (getInstitutionRoleLabel(institution)) {
@@ -251,7 +220,7 @@
@if (getSubprojects().length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>account_tree</mat-icon>
<mat-icon>{{ ACCOUNT_TREE_ICON }}</mat-icon>
<h2>Teilprojekte</h2>
<span class="count-badge">{{ getSubprojects().length }}</span>
</div>
@@ -295,7 +264,7 @@
@if (getPublications().length > 0) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>menu_book</mat-icon>
<mat-icon>{{ MENU_BOOK_ICON }}</mat-icon>
<h2>Publikationen</h2>
<span class="count-badge">{{ getPublications().length }}</span>
</div>
@@ -332,7 +301,7 @@
@if (getWebsiteHtml()) {
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>language</mat-icon>
<mat-icon>{{ LANGUAGE_ICON }}</mat-icon>
<h2>Projektwebseite</h2>
</div>
<div class="website-html" [innerHTML]="getWebsiteHtml()"></div>
@@ -344,7 +313,7 @@
<!-- Projektdetails -->
<mat-card appearance="outlined" class="card details-card">
<div class="section-header">
<mat-icon>info</mat-icon>
<mat-icon>{{ INFO_ICON }}</mat-icon>
<h2>Projektdetails</h2>
</div>
<dl class="details-list">
@@ -426,7 +395,7 @@
} @else {
<div class="error-container">
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<mat-icon>{{ ERROR_OUTLINE_ICON }}</mat-icon>
<p>DFG Projekt nicht gefunden.</p>
</div>
</div>
@@ -473,56 +473,6 @@ h1 {
color: var(--sg-text-muted);
}
.classification-list {
display: flex;
flex-direction: column;
gap: 10px;
padding: 16px 20px 20px;
}
.classification-path {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px 2px;
padding: 10px 12px;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
background: var(--sg-surface);
}
.classification-segment {
font-size: 12px;
line-height: 1.3;
padding: 3px 10px;
border-radius: 10px;
background: var(--sg-surface-soft);
color: var(--sg-text-muted);
white-space: nowrap;
&--leaf {
background: var(--sg-primary-soft);
color: var(--sg-text);
font-weight: 500;
white-space: normal;
}
}
.classification-leaf-group {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
.classification-separator {
width: 16px;
height: 16px;
font-size: 16px;
color: var(--sg-text-muted);
flex-shrink: 0;
opacity: 0.5;
}
.website-html {
padding: 16px 20px 20px;
font-size: 14px;
@@ -10,6 +10,28 @@ import { DfgProjectInstitutionRole } from '../../../api/model/dfgProjectInstitut
import { DfgProjectPersonRole } from '../../../api/model/dfgProjectPersonRole';
import { DFGProjectFachgebieteInner } from '../../../api/model/dFGProjectFachgebieteInner';
import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/project-oa-topics.component';
import { DfgClassificationComponent } from '../../../shared/ui/dfg-classification/dfg-classification.component';
import {
ACCESS_TIME_ICON,
ACCOUNT_TREE_ICON,
APARTMENT_ICON,
BUSINESS_ICON,
CALENDAR_ICON,
CHEVRON_RIGHT_ICON,
CIRCLE_ICON,
DESCRIPTION_ICON,
ERROR_OUTLINE_ICON,
EVENT_BUSY_ICON,
FACT_CHECK_ICON,
GAVEL_ICON,
INFO_ICON,
LANGUAGE_ICON,
MENU_BOOK_ICON,
OPEN_IN_NEW_ICON,
PAID_ICON,
PEOPLE_ICON,
PUBLIC_ICON,
} from '../../../shared/ui/icons';
@Component({
selector: 'app-dfg-details',
@@ -19,11 +41,32 @@ import { ProjectOaTopicsComponent } from '../../../shared/ui/project-oa-topics/p
MatCardModule,
MatIconModule,
ProjectOaTopicsComponent,
DfgClassificationComponent,
],
templateUrl: './dfg-details.component.html',
styleUrl: './dfg-details.component.scss',
})
export class DfgDetailsComponent implements OnInit {
readonly CHEVRON_RIGHT_ICON = CHEVRON_RIGHT_ICON;
readonly CIRCLE_ICON = CIRCLE_ICON;
readonly OPEN_IN_NEW_ICON = OPEN_IN_NEW_ICON;
readonly LANGUAGE_ICON = LANGUAGE_ICON;
readonly CALENDAR_ICON = CALENDAR_ICON;
readonly EVENT_BUSY_ICON = EVENT_BUSY_ICON;
readonly ACCESS_TIME_ICON = ACCESS_TIME_ICON;
readonly GAVEL_ICON = GAVEL_ICON;
readonly PAID_ICON = PAID_ICON;
readonly PUBLIC_ICON = PUBLIC_ICON;
readonly DESCRIPTION_ICON = DESCRIPTION_ICON;
readonly FACT_CHECK_ICON = FACT_CHECK_ICON;
readonly PEOPLE_ICON = PEOPLE_ICON;
readonly BUSINESS_ICON = BUSINESS_ICON;
readonly APARTMENT_ICON = APARTMENT_ICON;
readonly ACCOUNT_TREE_ICON = ACCOUNT_TREE_ICON;
readonly MENU_BOOK_ICON = MENU_BOOK_ICON;
readonly INFO_ICON = INFO_ICON;
readonly ERROR_OUTLINE_ICON = ERROR_OUTLINE_ICON;
private route = inject(ActivatedRoute);
dfgProject: DfgProjectDetails | undefined;
@@ -154,29 +197,9 @@ export class DfgDetailsComponent implements OnInit {
this.getInstitutionsList().length
);
}
//(DFG Fachsystematik)
getSubjectClassifications(): DFGProjectFachgebieteInner[] {
return this.dfgProject?.subject_classifications ?? [];
}
getClassificationParentSegments(entry: DFGProjectFachgebieteInner): string[] {
return [
entry.wissenschaftsbereich,
entry.fachkollegium,
entry.fachgebiet,
].filter((part): part is string => !!part);
}
getClassificationLeafSegments(entry: DFGProjectFachgebieteInner): string[] {
if (!entry.fach) return [];
return entry.fach
.split(',')
.map((s) => s.trim())
.filter((s) => !!s);
}
// --- Subprojects & publications ---
getSubprojects(): DfgProjectSubprojectSummary[] {
@@ -1,14 +1,14 @@
<div class="deliverables-tab">
<mat-card appearance="outlined" class="card">
<div class="section-header">
<mat-icon>assignment</mat-icon>
<mat-icon>{{ ASSIGNMENT_ICON }}</mat-icon>
<h2>Deliverables ({{ deliverables.length }})</h2>
</div>
<div class="deliverables-list">
@for (deliv of deliverables; track deliv.url) {
<div class="deliverable-item">
<div class="deliv-icon">
<mat-icon>file_present</mat-icon>
<mat-icon>{{ FILE_PRESENT_ICON }}</mat-icon>
</div>
<div class="deliv-info">
<div class="deliv-description">
@@ -20,7 +20,7 @@
}
@if (deliv.url) {
<a [href]="deliv.url" target="_blank" class="deliv-link">
<mat-icon>open_in_new</mat-icon>
<mat-icon>{{ OPEN_IN_NEW_ICON }}</mat-icon>
<span>Zum Deliverable</span>
</a>
}

Some files were not shown because too many files have changed in this diff Show More