feat(patents): add interactive detail view with source card navigation
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit

This commit is contained in:
2026-06-19 22:05:47 +02:00
parent c211e8d210
commit fc9c18f965
3 changed files with 124 additions and 100 deletions
@@ -6,7 +6,6 @@
<p class="message">Keine Patente gefunden.</p>
} @else {
<div class="patents-container">
<div class="patents-summary">
<p class="summary-line">
<span class="summary-value">{{ filteredPatents.length }}</span>
@@ -22,9 +21,58 @@
</p>
</div>
<div class="patents-content">
@if (showDetail && selectedPatent) {
<button class="back-btn" (click)="showDetail = false">
← Zurück zu den Patenten
</button>
}
<div class="patents-list">
<div class="patents-content">
@if (showDetail && selectedPatent) {
<div class="patent-full-detail">
<h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3>
@if (selectedPatent.abstract) {
<div class="detail-section">
<h4>Abstract</h4>
<p>{{ selectedPatent.abstract }}</p>
</div>
}
<div class="detail-section">
<h4>Erfinder</h4>
<ul class="tag-list">
@for (inventor of selectedPatent.inventors; track inventor) {
<li class="tag">{{ inventor }}</li>
}
</ul>
</div>
@if (selectedPatent.assignees.length > 0) {
<div class="detail-section">
<h4>Anmelder</h4>
<ul class="tag-list">
@for (assignee of selectedPatent.assignees; track assignee) {
<li class="tag">{{ assignee }}</li>
}
</ul>
</div>
}
@if (selectedPatent.ipc.length > 0) {
<div class="detail-section">
<h4>Klassifikation (IPC)</h4>
<ul class="tag-list tag-list--compact">
@for (ipc of selectedPatent.ipc; track ipc) {
<li class="tag">{{ ipc }}</li>
}
</ul>
</div>
}
</div>
}
<div class="patents-list" [class.hidden]="showDetail">
<div class="patents-list-toolbar">
<label class="sort-control">
<span>Filter nach Quelle:</span>
@@ -80,11 +128,14 @@
@if (selectedPatent) {
<div class="patent-detail">
<h3>{{ selectedPatent.title ?? selectedPatent.patent_id }}</h3>
<div class="detail-stats">
<div class="stat">
<div class="stat stat--clickable" (click)="openDetail()">
<span class="stat-label">Quelle</span>
<span class="stat-value">{{ selectedPatent.source }}</span>
<span class="stat-value">
<span class="source-badge source-badge--{{ selectedPatent.source.toLowerCase() }}">
{{ selectedPatent.source }}
</span>
</span>
</div>
<div class="stat">
<span class="stat-label">Patent-Nr.</span>
@@ -95,51 +146,12 @@
<span class="stat-value">{{ formatDate(selectedPatent.publication_date) }}</span>
</div>
</div>
@if (selectedPatent.abstract) {
<div class="detail-section">
<h4>Abstract</h4>
<p>{{ selectedPatent.abstract }}</p>
</div>
}
<div class="detail-section">
<h4>Erfinder</h4>
<ul class="tag-list">
@for (inventor of selectedPatent.inventors; track inventor) {
<li class="tag">{{ inventor }}</li>
}
</ul>
</div>
@if (selectedPatent.assignees.length > 0) {
<div class="detail-section">
<h4>Anmelder</h4>
<ul class="tag-list">
@for (assignee of selectedPatent.assignees; track assignee) {
<li class="tag">{{ assignee }}</li>
}
</ul>
</div>
}
@if (selectedPatent.ipc.length > 0) {
<div class="detail-section">
<h4>Klassifikation (IPC)</h4>
<ul class="tag-list tag-list--compact">
@for (ipc of selectedPatent.ipc; track ipc) {
<li class="tag">{{ ipc }}</li>
}
</ul>
</div>
}
</div>
} @else {
<div class="patent-detail empty">
<p>Klicke auf ein Patent für Details.</p>
</div>
}
</div>
</div>
}
@@ -31,40 +31,6 @@
}
}
.filter-bar {
display: inline-flex;
align-items: center;
gap: 6px;
width: fit-content;
padding: 10px 14px;
border-radius: 20px;
background: #f2f2f2;
color: #333;
font-size: 14px;
span {
color: #555;
}
button {
border: 0;
background: transparent;
color: #111827;
font: inherit;
cursor: pointer;
outline: none;
&.active {
font-weight: 600;
color: #0b63ce;
}
&:hover {
text-decoration: underline;
}
}
}
.sort-control {
display: inline-flex;
align-items: center;
@@ -99,6 +65,10 @@
.patents-list {
flex: 1;
&.hidden {
display: none;
}
.patents-list-toolbar {
display: flex;
align-items: center;
@@ -190,27 +160,12 @@
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;
}
}
.detail-stats {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-bottom: 16px;
.stat {
background: white;
@@ -237,6 +192,60 @@
}
}
.stat--clickable {
cursor: pointer;
transition: border-color 0.15s, background 0.15s;
&:hover {
border-color: #0b63ce;
background: #f0f6ff;
}
}
.patent-full-detail {
flex: 1;
border: 1px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
background: #fafafa;
h3 {
margin: 0 0 16px 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 {
border: none;
background: none;
color: #333;
cursor: pointer;
font-size: 14px;
font-weight: 400;
padding: 0;
align-self: flex-start; // NEU
&:hover {
text-decoration: underline;
}
}
.detail-section {
margin-top: 12px;
padding-top: 12px;
@@ -21,6 +21,7 @@ export class PersonPatentsComponent implements OnInit {
filteredPatents: PatentEntry[] = [];
authorName: string | null = null;
selectedPatent: PatentEntry | null = null;
showDetail = false;
loading = true;
error = false;
@@ -66,6 +67,7 @@ export class PersonPatentsComponent implements OnInit {
this.activeFilter = filter;
this.selectedPage = 1;
this.selectedPatent = null;
this.showDetail = false;
this.applyFilter();
this.updateQueryParams();
}
@@ -78,9 +80,14 @@ export class PersonPatentsComponent implements OnInit {
selectPatent(patent: PatentEntry): void {
this.selectedPatent = patent;
this.showDetail = false;
this.updateQueryParams();
}
openDetail(): void {
this.showDetail = true;
}
private applyFilter(): void {
let patents = this.patents;
@@ -94,13 +101,9 @@ export class PersonPatentsComponent implements OnInit {
private sortPatents(patents: PatentEntry[]): PatentEntry[] {
return [...patents].sort((a, b) => {
if (this.sortMode === 'date') {
return (b.publication_date ?? '').localeCompare(
a.publication_date ?? '',
);
return (b.publication_date ?? '').localeCompare(a.publication_date ?? '');
}
return (a.title ?? '').localeCompare(b.title ?? '', 'de', {
sensitivity: 'base',
});
return (a.title ?? '').localeCompare(b.title ?? '', 'de', { sensitivity: 'base' });
});
}