Files
smartguide/webapp/src/app/shared/ui/patent-table/patent-table.component.html
T
khalti 83c809983c
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
refactor(patents): share app-card-search/source-filter across patent page.
2026-08-18 10:39:01 +02:00

128 lines
3.7 KiB
HTML

<app-data-table
[columns]="columns()"
[data]="patents()"
[queryParamSortKey]="queryParamSortKey()"
[queryParamSortDirectionKey]="queryParamSortDirectionKey()"
(handleSortChange)="handleSortChange.emit($event)" />
<ng-template #titleTmp let-patent>
<button
type="button"
class="patent-title-btn"
[class.selected]="isSelected(patent)"
(click)="selectPatent.emit(patent)">
@if (isSelected(patent)) {
<mat-icon class="patent-title-btn__icon">chevron_right</mat-icon>
}
<span>{{ patent.title ?? patent.patent_id }}</span>
</button>
</ng-template>
<ng-template #sourceTmp let-patent>
<app-chip
variant="outlined"
[color]="patent.source === 'EPO' ? 'success' : 'info'">
{{ patent.source }}
</app-chip>
</ng-template>
<ng-template #yearTmp let-patent>
@if (patent.publication_year) {
<span class="year-badge">{{ patent.publication_year }}</span>
} @else {
<span class="empty-text">-</span>
}
</ng-template>
<ng-template #inventorsTmp let-patent>
@let expanded = isInventorsExpanded(patent);
@let visibleInventors =
expanded ? patent.inventors : (patent.inventors ?? []).slice(0, 3);
<div class="person-chips">
@for (inventor of visibleInventors; track inventor; let last = $last) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>person</mat-icon>
{{ inventor }}
</span>
@if (last && (patent.inventors ?? []).length > 3) {
<button
type="button"
class="patent-chip-more"
[attr.aria-expanded]="expanded"
(click)="toggleInventorsExpansion(patent)">
{{ expanded ? 'weniger' : '+' + (patent.inventors!.length - 3) }}
</button>
}
</span>
} @empty {
<span class="empty-text">-</span>
}
</div>
</ng-template>
<ng-template #assigneesTmp let-patent>
@let expanded = isAssigneesExpanded(patent);
@let visibleAssignees =
expanded ? patent.assignees : (patent.assignees ?? []).slice(0, 3);
<div class="person-chips">
@for (assignee of visibleAssignees; track assignee; let last = $last) {
<span class="person-chip-row">
<span class="person-chip">
<mat-icon>{{
isAssigneeLikelyPerson(assignee, patent) ? 'person' : 'apartment'
}}</mat-icon>
{{ assignee }}
</span>
@if (last && (patent.assignees ?? []).length > 3) {
<button
type="button"
class="patent-chip-more"
[attr.aria-expanded]="expanded"
(click)="toggleAssigneesExpansion(patent)">
{{ expanded ? 'weniger' : '+' + (patent.assignees!.length - 3) }}
</button>
}
</span>
} @empty {
<span class="empty-text">-</span>
}
</div>
</ng-template>
<ng-template #matchTypeTmp let-patent>
<span class="match-badge match-badge--{{ patent.match_type }}">
{{ getMatchTypeLabel(patent.match_type) }}
</span>
</ng-template>
<ng-template #matchedAuthorsTmp let-patent>
<div class="cell-authors">
@if (patent.matched_authors && patent.matched_authors.length) {
@for (
author of patent.matched_authors.slice(0, 3);
track author.openalex_author_id
) {
<app-author-chip
size="mini"
[showIcon]="true"
[isClickable]="true"
[authorId]="author.openalex_author_id"
(handleChipClick)="navigateToPerson(author.openalex_author_id)" />
}
} @else {
<span class="empty-text">-</span>
}
</div>
</ng-template>
<ng-template #actionsTmp let-patent>
<a
mat-icon-button
color="primary"
[routerLink]="['/patent', patent.patent_id]"
matTooltip="Patentdetails anzeigen">
<mat-icon>open_in_new</mat-icon>
</a>
</ng-template>