refactor(person-funding, person-patents, institution-patents): match publication-table styling and pagination #256

Merged
khalti merged 1 commits from ts-136-patent-to-researchers-v2 into dev 2026-08-01 20:48:03 +02:00
11 changed files with 478 additions and 925 deletions
@@ -127,21 +127,12 @@
</tbody>
</table>
@if (hasPagination()) {
<div class="pagination">
<button
[disabled]="selectedPage === 1"
(click)="setPage(selectedPage - 1)">
Zurück
</button>
<span>Seite {{ selectedPage }} von {{ getPageCount() }}</span>
<button
[disabled]="selectedPage === getPageCount()"
(click)="setPage(selectedPage + 1)">
Weiter
</button>
</div>
}
<app-query-param-paginator
[total]="totalPatents"
queryParamPageKey="page"
queryParamSizeKey="size"
[pageSizeOptions]="[10, 20, 50]"
(handlePageChange)="onPatentPageChange($event)" />
</div>
@if (selectedPatent) {
@@ -26,6 +26,11 @@
gap: 16px;
}
app-query-param-paginator {
display: block;
margin-top: 14px;
}
.patents-toolbar-field {
width: fit-content;
min-width: 180px;
@@ -55,36 +60,52 @@
table {
width: 100%;
border-collapse: collapse;
border-collapse: separate;
border-spacing: 0;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
overflow: hidden;
th {
text-align: left;
padding: 10px 12px;
border-bottom: 2px solid #e0e0e0;
font-weight: 600;
color: #333;
padding: 12px 16px;
background: var(--sg-surface-muted);
border-bottom: 1px solid var(--sg-border);
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.02em;
color: var(--sg-text-muted);
}
tr {
cursor: pointer;
transition: background-color 0.15s ease;
&:hover {
background: #f5f5f5;
&:hover td {
background: rgba(16, 26, 61, 0.04);
}
&.selected {
background: #f0f0f0;
&.selected td {
background: var(--sg-primary-soft);
}
&:last-child td {
border-bottom: 0;
}
}
td {
padding: 10px 12px;
border-bottom: 1px solid #f0f0f0;
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: #333;
font-weight: 500;
color: var(--sg-text);
font-weight: 600;
max-width: 280px;
white-space: nowrap;
overflow: hidden;
@@ -96,7 +117,7 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #555;
color: var(--sg-text-muted);
font-size: 13px;
}
@@ -169,16 +190,17 @@
.patent-detail {
width: 440px;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
background: #fafafa;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 24px;
background: var(--sg-surface);
box-shadow: var(--sg-shadow-sm);
&.empty {
display: flex;
align-items: center;
justify-content: center;
color: #999;
color: var(--sg-text-muted);
min-height: 200px;
}
@@ -189,14 +211,14 @@
.overview-title {
font-size: 15px;
font-weight: 600;
color: #333;
font-weight: 700;
color: var(--sg-text);
margin: 0;
}
.overview-subtitle {
font-size: 13px;
color: #888;
color: var(--sg-text-muted);
margin: 0;
}
@@ -208,9 +230,9 @@
}
.overview-stat {
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
background: var(--sg-surface);
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 12px 8px;
text-align: center;
@@ -218,13 +240,13 @@
display: block;
font-size: 22px;
font-weight: 700;
color: #333;
color: var(--sg-text);
}
.overview-label {
display: block;
font-size: 12px;
color: #888;
color: var(--sg-text-muted);
margin-top: 4px;
}
@@ -259,7 +281,7 @@
.overview-hint {
font-size: 12px;
color: #aaa;
color: var(--sg-text-muted);
margin: 0;
}
}
@@ -267,7 +289,8 @@
h3 {
margin: 0 0 16px 0;
font-size: 16px;
color: #333;
font-weight: 700;
color: var(--sg-text);
line-height: 1.4;
}
}
@@ -278,16 +301,16 @@
gap: 10px;
.stat {
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
background: var(--sg-surface);
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 10px;
text-align: center;
.stat-label {
display: block;
font-size: 11px;
color: #666;
color: var(--sg-text-muted);
margin-bottom: 4px;
text-transform: uppercase;
letter-spacing: 0.03em;
@@ -297,7 +320,7 @@
display: block;
font-size: 15px;
font-weight: bold;
color: #333;
color: var(--sg-text);
}
}
}
@@ -306,7 +329,7 @@
margin: 14px 0 0;
font-size: 13px;
line-height: 1.55;
color: #555;
color: var(--sg-text-muted);
}
.patent-detail-action {
@@ -348,122 +371,10 @@
text-align: center;
}
.patent-full-detail {
flex: 1;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
background: #fafafa;
h3 {
margin: 0 0 4px 0;
font-size: 16px;
color: #333;
line-height: 1.4;
}
h4 {
margin: 16px 0 8px 0;
font-size: 14px;
color: #555;
font-weight: 600;
}
p {
font-size: 13px;
color: #444;
line-height: 1.6;
margin: 0;
}
}
.back-btn {
display: inline-flex;
align-items: center;
gap: 0.4rem;
width: auto;
margin-bottom: 1rem;
padding: 0.5rem 0.85rem;
border: 1px solid #d6e3f8;
border-radius: 999px;
background: #f8fbff;
color: #2563eb;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition:
background-color 0.15s ease,
border-color 0.15s ease,
color 0.15s ease,
box-shadow 0.15s ease;
&:hover {
background: #eef5ff;
border-color: #bcd3f7;
color: #1d4ed8;
box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
}
&:focus-visible {
outline: 2px solid #93c5fd;
outline-offset: 2px;
}
}
.detail-section {
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid #eee;
}
.patent-meta {
&--inline {
margin: 12px 0 20px;
}
&__list {
margin: 0;
border: 1px solid #e2e8f4;
border-radius: 12px;
background: linear-gradient(180deg, #fff 0%, #f8faff 100%);
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
overflow: hidden;
}
&__row {
display: grid;
grid-template-columns: minmax(130px, 38%) 1fr;
gap: 12px 16px;
align-items: center;
padding: 11px 16px;
border-top: 1px solid #eef2f8;
&:first-child {
border-top: 0;
}
dt {
margin: 0;
font-size: 12px;
font-weight: 500;
color: #64748b;
line-height: 1.35;
}
dd {
margin: 0;
font-size: 14px;
font-weight: 600;
color: #1e293b;
line-height: 1.35;
word-break: break-word;
}
}
border-top: 1px solid var(--sg-border);
}
.tag-list {
@@ -490,155 +401,3 @@
line-height: 1.3;
}
.classification-section {
&--ipc .classification-card {
background: #f0f6ff;
border-color: #bfdbfe;
}
&--ipc .classification-badge--system {
background: #dbeafe;
color: #1d4ed8;
}
&--cpc .classification-card {
background: #f0fdf4;
border-color: #bbf7d0;
}
&--cpc .classification-badge--system {
background: #dcfce7;
color: #15803d;
}
}
.classification-cards {
display: flex;
flex-direction: column;
gap: 10px;
}
.classification-card {
padding: 12px 14px;
border-radius: 10px;
border: 1px solid #dbeafe;
}
.classification-card__header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}
.classification-card__codes {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.classification-card__badges {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.classification-code {
font-size: 0.9rem;
font-weight: 700;
color: #0f172a;
}
.classification-badge {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
font-size: 0.68rem;
font-weight: 700;
letter-spacing: 0.02em;
text-transform: uppercase;
}
.classification-badge--level {
background: #e2e8f0;
color: #475569;
}
.classification-summary {
margin: 10px 0 0;
font-size: 0.84rem;
line-height: 1.5;
color: #334155;
}
.classification-toggle {
margin-top: 6px;
padding: 0;
border: 0;
background: none;
color: #2563eb;
font-size: 0.78rem;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.classification-hierarchy {
margin: 10px 0 0;
padding-top: 10px;
border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.classification-hierarchy__row {
display: grid;
grid-template-columns: 88px 1fr;
gap: 8px;
margin-bottom: 6px;
dt {
margin: 0;
font-size: 0.72rem;
font-weight: 700;
color: #64748b;
text-transform: uppercase;
letter-spacing: 0.03em;
}
dd {
margin: 0;
font-size: 0.8rem;
line-height: 1.45;
color: #334155;
}
}
.pagination {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-top: 12px;
button {
padding: 4px 10px;
border: 1px solid #d0d0d0;
border-radius: 6px;
background: white;
cursor: pointer;
font-size: 12px;
&:disabled {
opacity: 0.5;
cursor: default;
}
}
span {
font-size: 12px;
color: #666;
}
}
@@ -11,6 +11,8 @@ import {
getPublicationStageLabel,
} from '../patent-detail/patent-detail.utils';
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';
type SortMode = 'date' | 'title';
type SourceFilter = 'all' | 'EPO' | 'USPTO';
@@ -25,6 +27,7 @@ type OrgPatentMatchTypeFilter = 'all' | 'institution' | 'name' | 'both';
MatFormFieldModule,
MatSelectModule,
MatIconModule,
QueryParamPaginatorComponent,
],
templateUrl: './institution-patents.component.html',
styleUrl: './institution-patents.component.scss',
@@ -47,8 +50,8 @@ export class InstitutionPatentsComponent implements OnInit {
activeMatchType: OrgPatentMatchTypeFilter = 'all';
sortMode: SortMode = 'date';
selectedPage = 1;
readonly pageSize = 20;
pageIndex = 0;
pageSize = 20;
totalPatents = 0;
ngOnInit(): void {
@@ -59,6 +62,12 @@ export class InstitutionPatentsComponent implements OnInit {
const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy');
const matchTypeFromUrl =
this.route.snapshot.queryParamMap.get('matchType');
this.pageIndex = this.parsePageIndexParam(
this.route.snapshot.queryParamMap.get('page'),
);
this.pageSize = this.parsePageSizeParam(
this.route.snapshot.queryParamMap.get('size'),
);
if (this.isValidFilter(filterFromUrl)) {
this.activeFilter = filterFromUrl;
@@ -79,7 +88,7 @@ export class InstitutionPatentsComponent implements OnInit {
setFilter(filter: SourceFilter): void {
this.activeFilter = filter;
this.selectedPage = 1;
this.pageIndex = 0;
this.selectedPatent = null;
this.reloadPatents();
}
@@ -87,7 +96,7 @@ export class InstitutionPatentsComponent implements OnInit {
setMatchType(matchType: OrgPatentMatchTypeFilter): void {
if (this.activeMatchType === matchType) return;
this.activeMatchType = matchType;
this.selectedPage = 1;
this.pageIndex = 0;
this.selectedPatent = null;
this.reloadPatents();
}
@@ -108,8 +117,9 @@ export class InstitutionPatentsComponent implements OnInit {
this.router.navigate(['/patent', this.selectedPatent.patent_id]);
}
setPage(page: number): void {
this.selectedPage = Math.min(Math.max(page, 1), this.getPageCount());
onPatentPageChange(event: PageEvent): void {
this.pageIndex = event.pageIndex;
this.pageSize = event.pageSize;
this.selectedPatent = null;
this.reloadPatents();
}
@@ -118,14 +128,6 @@ export class InstitutionPatentsComponent implements OnInit {
return this.filteredPatents;
}
getPageCount(): number {
return Math.max(1, Math.ceil(this.totalPatents / this.pageSize));
}
hasPagination(): boolean {
return this.totalPatents > this.pageSize;
}
private reloadPatents(): void {
const institutionId =
this.institutionId ??
@@ -145,7 +147,7 @@ export class InstitutionPatentsComponent implements OnInit {
institutionId,
this.activeMatchType !== 'all' ? this.activeMatchType : undefined,
this.selectedPage - 1,
this.pageIndex,
this.pageSize,
this.activeFilter !== 'all' ? this.activeFilter : undefined,
)
@@ -183,13 +185,24 @@ export class InstitutionPatentsComponent implements OnInit {
filter: this.activeFilter,
sortBy: this.sortMode,
matchType: this.activeMatchType,
page: this.selectedPage,
page: this.pageIndex,
size: this.pageSize,
},
queryParamsHandling: 'merge',
replaceUrl: true,
});
}
private parsePageIndexParam(value: string | null): number {
const parsed = Number(value);
return Number.isInteger(parsed) && parsed >= 0 ? parsed : 0;
}
private parsePageSizeParam(value: string | null): number {
const parsed = Number(value);
return Number.isInteger(parsed) && parsed > 0 ? parsed : 20;
}
private isValidFilter(value: string | null): value is SourceFilter {
return value === 'all' || value === 'EPO' || value === 'USPTO';
}
@@ -1,5 +1,9 @@
@if (loading) {
<p class="message">Lade Förderungen...</p>
<app-loading
text="Förderdaten werden geladen..."
icon="volunteer_activism"
[size]="150"
[diameter]="150" />
} @else if (error) {
<p class="message">Fehler beim Laden der Förderungen.</p>
} @else if (funders.length === 0) {
@@ -41,7 +45,10 @@
<thead>
<tr>
<th>Förderer</th>
<th>Publikationen</th>
<th class="text-center">Publikationen</th>
<th class="text-center">Erstautor</th>
<th class="text-center">Mitautor</th>
<th class="text-center">Letztautor</th>
</tr>
</thead>
<tbody>
@@ -50,29 +57,32 @@
[class.selected]="selectedFunder === funder"
(click)="selectFunder(funder)">
<td class="funder-name">{{ funder.funder_name }}</td>
<td>{{ getPublicationCount(funder) }}</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>
@if (hasFunderListPagination()) {
<div class="publication-pagination">
<button
[disabled]="selectedFunderListPage === 1"
(click)="setFunderListPage(selectedFunderListPage - 1)">
Zurück
</button>
<span
>Seite {{ selectedFunderListPage }} von
{{ getFunderListPageCount() }}</span
>
<button
[disabled]="selectedFunderListPage === getFunderListPageCount()"
(click)="setFunderListPage(selectedFunderListPage + 1)">
Weiter
</button>
</div>
}
<app-query-param-paginator
[total]="filteredFunders.length"
queryParamPageKey="funderPage"
queryParamSizeKey="funderSize"
[pageSizeOptions]="[10, 25, 50]"
(handlePageChange)="onFunderPageChange($event)" />
</div>
<!-- Rechte Seite: Details -->
@@ -129,26 +139,12 @@
</li>
}
</ul>
@if (hasPublicationPagination()) {
<div class="publication-pagination">
<button
[disabled]="selectedPublicationPage === 1"
(click)="setPublicationPage(selectedPublicationPage - 1)">
Zurück
</button>
<span
>Seite {{ selectedPublicationPage }} von
{{ getSelectedPublicationPageCount() }}</span
>
<button
[disabled]="
selectedPublicationPage === getSelectedPublicationPageCount()
"
(click)="setPublicationPage(selectedPublicationPage + 1)">
Weiter
</button>
</div>
}
<app-query-param-paginator
[total]="getSelectedPublicationTotal()"
queryParamPageKey="pubPage"
queryParamSizeKey="pubSize"
[pageSizeOptions]="[10, 25, 50]"
(handlePageChange)="onPublicationPageChange($event)" />
</div>
} @else {
<div class="funding-detail empty">
@@ -1,10 +1,13 @@
.message {
padding: 16px;
color: #666;
}
app-query-param-paginator {
display: block;
margin-top: 14px;
}
.funding-container {
padding: 16px;
display: flex;
flex-direction: column;
gap: 16px;
@@ -35,52 +38,108 @@
table {
width: 100%;
border-collapse: collapse;
border-collapse: separate;
border-spacing: 0;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
overflow: hidden;
th {
text-align: left;
padding: 10px 12px;
border-bottom: 2px solid #e0e0e0;
font-weight: 600;
color: #333;
padding: 12px 16px;
background: var(--sg-surface-muted);
border-bottom: 1px solid var(--sg-border);
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.02em;
color: var(--sg-text-muted);
}
tr {
cursor: pointer;
&.selected {
background: #f0f0f0;
transition: background-color 0.15s ease;
&:hover td {
background: rgba(16, 26, 61, 0.04);
}
&.selected td {
background: var(--sg-primary-soft);
}
&:last-child td {
border-bottom: 0;
}
}
td {
padding: 10px 12px;
border-bottom: 1px solid #f0f0f0;
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: #333;
font-weight: 500;
color: var(--sg-text);
font-weight: 600;
}
.text-center {
text-align: center;
}
}
}
.position-count-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 26px;
padding: 2px 8px;
border-radius: 999px;
font-size: 12px;
font-weight: 700;
&--first {
background: #effaf3;
color: #24834f;
}
&--middle {
background: #f6f0ff;
color: #7255d9;
}
&--last {
background: #fff1f2;
color: #be123c;
}
}
.funding-detail {
width: 440px;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
background: #fafafa;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 24px;
background: var(--sg-surface);
box-shadow: var(--sg-shadow-sm);
h3 {
margin: 0 0 16px;
font-size: 16px;
color: #333;
font-weight: 700;
color: var(--sg-text);
}
h4 {
margin: 16px 0 8px;
font-size: 14px;
color: #555;
margin: 20px 0 10px;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.02em;
color: var(--sg-text-muted);
}
}
@@ -93,15 +152,15 @@
.stat {
min-width: 100px;
text-align: center;
background: #fff;
border: 1px solid #e0e0e0;
border-radius: 8px;
background: var(--sg-surface);
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 10px;
.stat-label {
display: block;
font-size: 12px;
color: #666;
color: var(--sg-text-muted);
margin-bottom: 4px;
}
@@ -109,13 +168,10 @@
display: block;
font-size: 22px;
font-weight: bold;
color: #333;
color: var(--sg-text);
}
&.stat-first {
background: #effaf3;
border-color: #bdebcf;
.stat-label,
.stat-value {
color: #24834f;
@@ -123,9 +179,6 @@
}
&.stat-middle {
background: #f6f0ff;
border-color: #d8cafe;
.stat-label,
.stat-value {
color: #7255d9;
@@ -133,9 +186,6 @@
}
&.stat-last {
background: #fff1f2;
border-color: #fda4af;
.stat-label,
.stat-value {
color: #be123c;
@@ -173,41 +223,10 @@
list-style: none;
padding: 0;
margin: 0;
max-height: 300px;
max-height: 320px;
overflow-y: auto;
li {
padding: 6px 0;
border-bottom: 1px solid #5b5555;
font-size: 13px;
}
}
.publication-pagination {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-top: 12px;
button {
padding: 4px 10px;
border: 1px solid #d0d0d0;
border-radius: 6px;
background: #fff;
cursor: pointer;
font-size: 12px;
&:disabled {
opacity: 0.5;
cursor: default;
}
}
span {
font-size: 12px;
color: #666;
}
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
}
.empty-overview {
@@ -267,9 +286,9 @@
&__stat {
text-align: center;
padding: 12px 8px;
border: 1px solid #e0e0e0;
border-radius: 8px;
background: #fff;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
background: var(--sg-surface);
}
&__stat-value {
@@ -312,24 +331,42 @@
.publication-more-info {
display: inline-flex;
align-items: center;
border: 0;
background: transparent;
cursor: pointer;
gap: 4px;
margin-top: 6px;
padding: 0;
margin-top: 8px;
padding: 4px 10px;
border: 1px solid var(--sg-border);
border-radius: 999px;
background: var(--sg-surface);
cursor: pointer;
text-decoration: none;
transition: all 0.15s ease;
&:hover,
&:focus-visible {
border-color: #1976d2;
background: rgba(16, 26, 61, 0.04);
outline: none;
}
}
.publication-item {
padding: 8px 0;
border-bottom: 2px solid #5b5555;
padding: 10px 14px;
border-bottom: 1px solid var(--sg-border);
cursor: pointer;
transition: background-color 0.15s ease;
&:last-child {
border-bottom: 0;
}
&:hover {
background: rgba(16, 26, 61, 0.04);
}
}
.publication-title {
font-size: 0.875rem;
color: #333;
color: var(--sg-text);
white-space: normal;
word-break: break-word;
display: block;
@@ -342,7 +379,7 @@
.mehr-infos-label {
font-size: 0.8rem;
font-weight: 500;
font-weight: 600;
}
.publication-link-icon {
@@ -5,7 +5,10 @@ import { Router } from '@angular/router';
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 { FundingService } from '../../api';
import { LoadingComponent } from '../../shared/ui/loading/loading.component';
import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component';
type SortMode = 'name' | 'top';
type AuthorPosition = 'first' | 'middle' | 'last' | 'unknown';
@@ -26,6 +29,8 @@ type FundingPublicationDetail = {
MatFormFieldModule,
MatSelectModule,
MatIconModule,
LoadingComponent,
QueryParamPaginatorComponent,
],
templateUrl: './person-funding.component.html',
styleUrl: './person-funding.component.scss',
@@ -35,16 +40,18 @@ export class PersonFundingComponent implements OnInit {
private router = inject(Router);
private fundingApi = inject(FundingService);
private initialSelectedFunderKey: string | null = null;
private initialPublicationPage = 1;
private initialFunderListPage = 1;
private initialFunderPageIndex = 0;
private initialFunderPageSize = 10;
private initialPublicationPageIndex = 0;
private initialPublicationPageSize = 10;
funders: any[] = [];
filteredFunders: any[] = [];
selectedFunder: any = null;
selectedFunderListPage = 1;
selectedPublicationPage = 1;
readonly funderListPageSize = 10;
readonly publicationPageSize = 10;
funderPageIndex = 0;
funderPageSize = 10;
publicationPageIndex = 0;
publicationPageSize = 10;
activeFilter: 'all' | 'first' | 'middle' | 'last' = 'all';
sortMode: SortMode = 'name';
loading = true;
@@ -58,13 +65,18 @@ export class PersonFundingComponent implements OnInit {
const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy');
this.initialSelectedFunderKey =
this.route.snapshot.queryParamMap.get('funder');
this.initialPublicationPage = this.parsePageParam(
this.route.snapshot.queryParamMap.get('publicationPage') ??
this.route.snapshot.queryParamMap.get('page'),
);
this.initialFunderListPage = this.parsePageParam(
this.initialFunderPageIndex = this.parsePageIndexParam(
this.route.snapshot.queryParamMap.get('funderPage'),
);
this.initialFunderPageSize = this.parsePageSizeParam(
this.route.snapshot.queryParamMap.get('funderSize'),
);
this.initialPublicationPageIndex = this.parsePageIndexParam(
this.route.snapshot.queryParamMap.get('pubPage'),
);
this.initialPublicationPageSize = this.parsePageSizeParam(
this.route.snapshot.queryParamMap.get('pubSize'),
);
if (this.isValidFilter(filterFromUrl)) {
this.activeFilter = filterFromUrl;
}
@@ -77,9 +89,11 @@ export class PersonFundingComponent implements OnInit {
next: (result: any) => {
this.funders = result.funders ?? [];
this.applyFilter();
this.selectedFunderListPage = this.clampPage(
this.initialFunderListPage,
this.getFunderListPageCount(),
this.funderPageSize = this.initialFunderPageSize;
this.funderPageIndex = this.clampPageIndex(
this.initialFunderPageIndex,
this.funderPageSize,
this.filteredFunders.length,
);
this.restoreSelectedFunderFromUrl();
this.loading = false;
@@ -95,7 +109,7 @@ export class PersonFundingComponent implements OnInit {
selectFunder(funder: any): void {
this.selectedFunder = funder;
this.selectedPublicationPage = 1;
this.publicationPageIndex = 0;
this.updateQueryParams();
}
@@ -111,10 +125,20 @@ export class PersonFundingComponent implements OnInit {
this.updateQueryParams();
}
onFunderPageChange(event: PageEvent): void {
this.funderPageIndex = event.pageIndex;
this.funderPageSize = event.pageSize;
}
onPublicationPageChange(event: PageEvent): void {
this.publicationPageIndex = event.pageIndex;
this.publicationPageSize = event.pageSize;
}
private applyFilter(): void {
this.selectedFunder = null;
this.selectedFunderListPage = 1;
this.selectedPublicationPage = 1;
this.funderPageIndex = 0;
this.publicationPageIndex = 0;
let funders: any[];
if (this.activeFilter === 'all') {
funders = this.funders;
@@ -143,12 +167,13 @@ export class PersonFundingComponent implements OnInit {
this.getFunderKey(funder) === this.getFunderKey(matchedFunder),
);
if (matchedIndex >= 0) {
this.selectedFunderListPage =
Math.floor(matchedIndex / this.funderListPageSize) + 1;
this.funderPageIndex = Math.floor(matchedIndex / this.funderPageSize);
}
this.selectedPublicationPage = this.clampPublicationPage(
this.initialPublicationPage,
this.getPublicationPageCountForFunder(matchedFunder),
this.publicationPageSize = this.initialPublicationPageSize;
this.publicationPageIndex = this.clampPageIndex(
this.initialPublicationPageIndex,
this.publicationPageSize,
this.getPublicationIds(matchedFunder).length,
);
this.updateQueryParams();
} else {
@@ -165,10 +190,10 @@ export class PersonFundingComponent implements OnInit {
funder: this.selectedFunder
? this.getFunderKey(this.selectedFunder)
: null,
publicationPage: this.selectedFunder
? this.selectedPublicationPage
: null,
funderPage: this.selectedFunderListPage,
funderPage: this.funderPageIndex,
funderSize: this.funderPageSize,
pubPage: this.selectedFunder ? this.publicationPageIndex : null,
pubSize: this.selectedFunder ? this.publicationPageSize : null,
},
queryParamsHandling: 'merge',
replaceUrl: true,
@@ -214,61 +239,29 @@ export class PersonFundingComponent implements OnInit {
}
getPagedFunders(): any[] {
const startIndex =
(this.selectedFunderListPage - 1) * this.funderListPageSize;
const startIndex = this.funderPageIndex * this.funderPageSize;
return this.filteredFunders.slice(
startIndex,
startIndex + this.funderListPageSize,
startIndex + this.funderPageSize,
);
}
hasFunderListPagination(): boolean {
return this.getFunderListPageCount() > 1;
}
getFunderListPageCount(): number {
return Math.max(
1,
Math.ceil(this.filteredFunders.length / this.funderListPageSize),
);
}
setFunderListPage(page: number): void {
this.selectedFunderListPage = this.clampPage(
page,
this.getFunderListPageCount(),
);
this.updateQueryParams();
}
getSelectedPublicationIdsPage(): string[] {
if (!this.selectedFunder) {
return [];
}
const allPublicationIds = this.getPublicationIds(this.selectedFunder);
const startIndex =
(this.selectedPublicationPage - 1) * this.publicationPageSize;
const startIndex = this.publicationPageIndex * this.publicationPageSize;
return allPublicationIds.slice(
startIndex,
startIndex + this.publicationPageSize,
);
}
hasPublicationPagination(): boolean {
return this.getSelectedPublicationPageCount() > 1;
}
getSelectedPublicationPageCount(): number {
if (!this.selectedFunder) {
return 1;
}
return this.getPublicationPageCountForFunder(this.selectedFunder);
}
setPublicationPage(page: number): void {
const totalPages = this.getSelectedPublicationPageCount();
this.selectedPublicationPage = this.clampPublicationPage(page, totalPages);
this.updateQueryParams();
getSelectedPublicationTotal(): number {
return this.selectedFunder
? this.getPublicationIds(this.selectedFunder).length
: 0;
}
getPositionLabel(position: string): string {
@@ -301,11 +294,6 @@ export class PersonFundingComponent implements OnInit {
return allIds.size;
}
private getPublicationPageCountForFunder(funder: any): number {
const publicationCount = this.getPublicationIds(funder).length;
return Math.max(1, Math.ceil(publicationCount / this.publicationPageSize));
}
private sortFunders(funders: any[]): any[] {
const sortedFunders = [...funders];
return sortedFunders.sort((first, second) => {
@@ -329,21 +317,25 @@ export class PersonFundingComponent implements OnInit {
return funder.funder_name ?? '';
}
private clampPublicationPage(page: number, totalPages: number): number {
return this.clampPage(page, totalPages);
private clampPageIndex(
pageIndex: number,
pageSize: number,
total: number,
): number {
const maxIndex = Math.max(0, Math.ceil(total / pageSize) - 1);
return Math.min(Math.max(pageIndex, 0), maxIndex);
}
private clampPage(page: number, totalPages: number): number {
return Math.min(Math.max(page, 1), totalPages);
}
private parsePageParam(value: string | null): number {
private parsePageIndexParam(value: string | null): number {
const parsed = Number(value);
if (!Number.isInteger(parsed) || parsed < 1) {
return 1;
}
return parsed;
return Number.isInteger(parsed) && parsed >= 0 ? parsed : 0;
}
private parsePageSizeParam(value: string | null): number {
const parsed = Number(value);
return Number.isInteger(parsed) && parsed > 0 ? parsed : 10;
}
getPublicationTitle(publicationId: string): string {
const detailTitle = this.getPublicationDetail(publicationId)?.title;
if (detailTitle) return detailTitle;
@@ -46,6 +46,8 @@
<th>Patent</th>
<th>Quelle</th>
<th>Jahr</th>
<th>Erfinder</th>
<th>Anmelder</th>
</tr>
</thead>
<tbody>
@@ -68,26 +70,27 @@
</span>
</td>
<td>{{ patent.publication_year ?? '-' }}</td>
<td
class="patent-people"
[title]="getInventorsLabel(patent)">
{{ getInventorsLabel(patent) }}
</td>
<td
class="patent-people"
[title]="getAssigneesLabel(patent)">
{{ getAssigneesLabel(patent) }}
</td>
</tr>
}
</tbody>
</table>
@if (hasPagination()) {
<div class="pagination">
<button
[disabled]="selectedPage === 1"
(click)="setPage(selectedPage - 1)">
Zurück
</button>
<span>Seite {{ selectedPage }} von {{ getPageCount() }}</span>
<button
[disabled]="selectedPage === getPageCount()"
(click)="setPage(selectedPage + 1)">
Weiter
</button>
</div>
}
<app-query-param-paginator
[total]="filteredPatents.length"
queryParamPageKey="page"
queryParamSizeKey="size"
[pageSizeOptions]="[10, 25, 50]"
(handlePageChange)="onPatentPageChange($event)" />
</div>
@if (selectedPatent) {
@@ -1,15 +1,18 @@
.message {
padding: 16px;
color: #666;
}
.patents-container {
padding: 16px;
display: flex;
flex-direction: column;
gap: 16px;
}
app-query-param-paginator {
display: block;
margin-top: 14px;
}
.patents-toolbar-field {
width: fit-content;
min-width: 180px;
@@ -39,76 +42,68 @@
table {
width: 100%;
border-collapse: collapse;
border-collapse: separate;
border-spacing: 0;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
overflow: hidden;
th {
text-align: left;
padding: 10px 12px;
border-bottom: 2px solid #e0e0e0;
font-weight: 600;
color: #333;
padding: 12px 16px;
background: var(--sg-surface-muted);
border-bottom: 1px solid var(--sg-border);
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.02em;
color: var(--sg-text-muted);
}
tr {
cursor: pointer;
transition: background-color 0.15s ease;
&:hover {
background: #f5f5f5;
&:hover td {
background: rgba(16, 26, 61, 0.04);
}
&.selected {
background: #f0f0f0;
&.selected td {
background: var(--sg-primary-soft);
}
&:last-child td {
border-bottom: 0;
}
}
td {
padding: 10px 12px;
border-bottom: 1px solid #f0f0f0;
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: #333;
font-weight: 500;
color: var(--sg-text);
font-weight: 600;
max-width: 400px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.patent-people {
max-width: 220px;
color: var(--sg-text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.match-badges {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-top: 4px;
}
.match-badge {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
background: #f3f4f6;
border: 1px solid #e5e7eb;
color: #374151;
font-size: 0.68rem;
font-weight: 600;
&--signal {
padding: 4px 10px;
font-size: 0.75rem;
background: #ecfdf5;
border-color: #a7f3d0;
color: #047857;
}
}
.match-badges--detail {
margin-top: 14px;
gap: 6px;
}
.source-badge {
display: inline-flex;
align-items: center;
@@ -132,16 +127,17 @@
.patent-detail {
width: 440px;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
background: #fafafa;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 24px;
background: var(--sg-surface);
box-shadow: var(--sg-shadow-sm);
&.empty {
display: flex;
align-items: center;
justify-content: center;
color: #999;
color: var(--sg-text-muted);
min-height: 200px;
}
@@ -152,14 +148,14 @@
.overview-title {
font-size: 15px;
font-weight: 600;
color: #333;
font-weight: 700;
color: var(--sg-text);
margin: 0;
}
.overview-subtitle {
font-size: 13px;
color: #888;
color: var(--sg-text-muted);
margin: 0;
}
@@ -171,9 +167,9 @@
}
.overview-stat {
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
background: var(--sg-surface);
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 12px 8px;
text-align: center;
@@ -181,13 +177,13 @@
display: block;
font-size: 22px;
font-weight: 700;
color: #333;
color: var(--sg-text);
}
.overview-label {
display: block;
font-size: 12px;
color: #888;
color: var(--sg-text-muted);
margin-top: 4px;
}
@@ -215,7 +211,7 @@
.overview-hint {
font-size: 12px;
color: #aaa;
color: var(--sg-text-muted);
margin: 0;
}
}
@@ -223,7 +219,8 @@
h3 {
margin: 0 0 16px 0;
font-size: 16px;
color: #333;
font-weight: 700;
color: var(--sg-text);
line-height: 1.4;
}
}
@@ -234,16 +231,16 @@
gap: 10px;
.stat {
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
background: var(--sg-surface);
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
padding: 10px;
text-align: center;
.stat-label {
display: block;
font-size: 11px;
color: #666;
color: var(--sg-text-muted);
margin-bottom: 4px;
text-transform: uppercase;
letter-spacing: 0.03em;
@@ -253,7 +250,7 @@
display: block;
font-size: 15px;
font-weight: bold;
color: #333;
color: var(--sg-text);
}
}
}
@@ -262,7 +259,7 @@
margin: 14px 0 0;
font-size: 13px;
line-height: 1.55;
color: #555;
color: var(--sg-text-muted);
}
.patent-detail-action {
@@ -304,297 +301,3 @@
text-align: center;
}
.patent-full-detail {
flex: 1;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
background: #fafafa;
h3 {
margin: 0 0 4px 0;
font-size: 16px;
color: #333;
line-height: 1.4;
}
h4 {
margin: 16px 0 8px 0;
font-size: 14px;
color: #555;
font-weight: 600;
}
p {
font-size: 13px;
color: #444;
line-height: 1.6;
margin: 0;
}
}
.back-btn {
display: inline-flex;
align-items: center;
gap: 0.4rem;
width: auto;
margin-bottom: 1rem;
padding: 0.5rem 0.85rem;
border: 1px solid #d6e3f8;
border-radius: 999px;
background: #f8fbff;
color: #2563eb;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition:
background-color 0.15s ease,
border-color 0.15s ease,
color 0.15s ease,
box-shadow 0.15s ease;
&:hover {
background: #eef5ff;
border-color: #bcd3f7;
color: #1d4ed8;
box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
}
&:focus-visible {
outline: 2px solid #93c5fd;
outline-offset: 2px;
}
}
.detail-section {
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid #eee;
}
.patent-meta {
&--inline {
margin: 12px 0 20px;
}
&__list {
margin: 0;
border: 1px solid #e2e8f4;
border-radius: 12px;
background: linear-gradient(180deg, #fff 0%, #f8faff 100%);
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
overflow: hidden;
}
&__row {
display: grid;
grid-template-columns: minmax(130px, 38%) 1fr;
gap: 12px 16px;
align-items: center;
padding: 11px 16px;
border-top: 1px solid #eef2f8;
&:first-child {
border-top: 0;
}
dt {
margin: 0;
font-size: 12px;
font-weight: 500;
color: #64748b;
line-height: 1.35;
}
dd {
margin: 0;
font-size: 14px;
font-weight: 600;
color: #1e293b;
line-height: 1.35;
word-break: break-word;
}
}
}
.tag-list {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin: 0;
padding: 0;
list-style: none;
&--compact .tag {
font-size: 0.75rem;
padding: 3px 8px;
}
}
.tag {
padding: 4px 10px;
border-radius: 999px;
background: #f0f6ff;
border: 1px solid #dbeafe;
color: #1e40af;
font-size: 0.8rem;
line-height: 1.3;
}
.classification-section {
&--ipc .classification-card {
background: #f0f6ff;
border-color: #bfdbfe;
}
&--ipc .classification-badge--system {
background: #dbeafe;
color: #1d4ed8;
}
&--cpc .classification-card {
background: #f0fdf4;
border-color: #bbf7d0;
}
&--cpc .classification-badge--system {
background: #dcfce7;
color: #15803d;
}
}
.classification-cards {
display: flex;
flex-direction: column;
gap: 10px;
}
.classification-card {
padding: 12px 14px;
border-radius: 10px;
border: 1px solid #dbeafe;
}
.classification-card__header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}
.classification-card__codes {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.classification-card__badges {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.classification-code {
font-size: 0.9rem;
font-weight: 700;
color: #0f172a;
}
.classification-badge {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 999px;
font-size: 0.68rem;
font-weight: 700;
letter-spacing: 0.02em;
text-transform: uppercase;
}
.classification-badge--level {
background: #e2e8f0;
color: #475569;
}
.classification-summary {
margin: 10px 0 0;
font-size: 0.84rem;
line-height: 1.5;
color: #334155;
}
.classification-toggle {
margin-top: 6px;
padding: 0;
border: 0;
background: none;
color: #2563eb;
font-size: 0.78rem;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.classification-hierarchy {
margin: 10px 0 0;
padding-top: 10px;
border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.classification-hierarchy__row {
display: grid;
grid-template-columns: 88px 1fr;
gap: 8px;
margin-bottom: 6px;
dt {
margin: 0;
font-size: 0.72rem;
font-weight: 700;
color: #64748b;
text-transform: uppercase;
letter-spacing: 0.03em;
}
dd {
margin: 0;
font-size: 0.8rem;
line-height: 1.45;
color: #334155;
}
}
.pagination {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-top: 12px;
button {
padding: 4px 10px;
border: 1px solid #d0d0d0;
border-radius: 6px;
background: white;
cursor: pointer;
font-size: 12px;
&:disabled {
opacity: 0.5;
cursor: default;
}
}
span {
font-size: 12px;
color: #666;
}
}
@@ -13,6 +13,8 @@ import {
getPublicationStageLabel,
} from '../patent-detail/patent-detail.utils';
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';
type SortMode = 'date' | 'title';
type SourceFilter = 'all' | 'EPO' | 'USPTO';
@@ -25,6 +27,7 @@ type SourceFilter = 'all' | 'EPO' | 'USPTO';
MatFormFieldModule,
MatSelectModule,
MatIconModule,
QueryParamPaginatorComponent,
],
templateUrl: './person-patents.component.html',
styleUrl: './person-patents.component.scss',
@@ -45,12 +48,18 @@ export class PersonPatentsComponent {
activeFilter: SourceFilter = 'all';
sortMode: SortMode = 'date';
selectedPage = 1;
readonly pageSize = 10;
pageIndex = 0;
pageSize = 10;
constructor() {
const filterFromUrl = this.route.snapshot.queryParamMap.get('filter');
const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy');
this.pageIndex = this.parsePageIndexParam(
this.route.snapshot.queryParamMap.get('page'),
);
this.pageSize = this.parsePageSizeParam(
this.route.snapshot.queryParamMap.get('size'),
);
if (this.isValidFilter(filterFromUrl)) {
this.activeFilter = filterFromUrl;
@@ -93,12 +102,17 @@ export class PersonPatentsComponent {
setFilter(filter: SourceFilter): void {
this.activeFilter = filter;
this.selectedPage = 1;
this.pageIndex = 0;
this.selectedPatent = null;
this.applyFilter();
this.updateQueryParams();
}
onPatentPageChange(event: PageEvent): void {
this.pageIndex = event.pageIndex;
this.pageSize = event.pageSize;
}
setSortMode(sortMode: SortMode): void {
this.sortMode = sortMode;
this.applyFilter();
@@ -144,12 +158,24 @@ export class PersonPatentsComponent {
queryParams: {
filter: this.activeFilter,
sortBy: this.sortMode,
page: this.pageIndex,
size: this.pageSize,
},
queryParamsHandling: 'merge',
replaceUrl: true,
});
}
private parsePageIndexParam(value: string | null): number {
const parsed = Number(value);
return Number.isInteger(parsed) && parsed >= 0 ? parsed : 0;
}
private parsePageSizeParam(value: string | null): number {
const parsed = Number(value);
return Number.isInteger(parsed) && parsed > 0 ? parsed : 10;
}
private isValidFilter(value: string | null): value is SourceFilter {
return value === 'all' || value === 'EPO' || value === 'USPTO';
}
@@ -159,21 +185,16 @@ export class PersonPatentsComponent {
}
getPagedPatents(): PatentEntry[] {
const start = (this.selectedPage - 1) * this.pageSize;
const start = this.pageIndex * this.pageSize;
return this.filteredPatents.slice(start, start + this.pageSize);
}
getPageCount(): number {
return Math.max(1, Math.ceil(this.filteredPatents.length / this.pageSize));
getInventorsLabel(patent: PatentEntry): string {
return patent.inventors?.length ? patent.inventors.join(', ') : '-';
}
hasPagination(): boolean {
return this.getPageCount() > 1;
}
setPage(page: number): void {
this.selectedPage = Math.min(Math.max(page, 1), this.getPageCount());
this.updateQueryParams();
getAssigneesLabel(patent: PatentEntry): string {
return patent.assignees?.length ? patent.assignees.join(', ') : '-';
}
formatDate(date: string | null | undefined): string {
@@ -77,6 +77,20 @@
<mat-icon>work</mat-icon>
Projekte
</a>
@if (hasPatents()) {
<a
class="card-action"
[routerLink]="[
'/institution',
stripOpenAlexId(institution().id),
'patents',
]"
matButton="outlined"
(click)="$event.stopPropagation()">
<mat-icon>verified</mat-icon>
Patente
</a>
}
</mat-card-actions>
</mat-card-footer>
</mat-card>
@@ -1,5 +1,6 @@
import { Component, computed, input } from '@angular/core';
import { Component, computed, effect, inject, input, signal } from '@angular/core';
import { Institution } from '../../../api';
import { PatentsService } from '../../../api/api/patents.service';
import { MatCardModule } from '@angular/material/card';
import { RouterModule } from '@angular/router';
import { MatDividerModule } from '@angular/material/divider';
@@ -21,6 +22,8 @@ import { DecimalPipe } from '@angular/common';
styleUrl: './app-institution-card.component.scss',
})
export class AppInstitutionCardComponent {
private readonly patentsApi = inject(PatentsService);
institution = input.required<Institution>();
displayName = computed(() => {
@@ -33,6 +36,27 @@ export class AppInstitutionCardComponent {
return 'Unbekannte Institution';
});
// The "Patente" action only makes sense once org_patents has been indexed
// for this institution (currently a manual, per-institution process), so
// it's hidden by default and only shown once a cheap count check confirms
// there is actually data behind it.
private readonly hasPatentsSignal = signal(false);
hasPatents = this.hasPatentsSignal.asReadonly();
constructor() {
effect(() => {
const id = this.stripOpenAlexId(this.institution().id);
this.hasPatentsSignal.set(false);
if (!id) return;
this.patentsApi.getOrgPatentsByInstitution(id, undefined, 0, 0).subscribe({
next: (result) => {
this.hasPatentsSignal.set((result.patent_count ?? 0) > 0);
},
});
});
}
stripOpenAlexId(id: string | null | undefined): string | undefined {
if (!id) {
return undefined;