Replace author with "Relevant" label in news list

This commit is contained in:
Steven Tischer
2026-06-20 15:15:23 +02:00
parent dc2ef6fd20
commit 08cfec6be0
5 changed files with 96 additions and 6 deletions
@@ -42,10 +42,25 @@
</td>
</ng-container>
<ng-container matColumnDef="author">
<th mat-header-cell *matHeaderCellDef>Autor</th>
<ng-container matColumnDef="relevance">
<th mat-header-cell *matHeaderCellDef>Relevanz</th>
<td mat-cell *matCellDef="let article">
{{ article.author || '-' }}
@if (article.relevant === true) {
<span class="relevance-badge is-relevant">
<mat-icon>check_circle</mat-icon>
Relevant
</span>
} @else if (article.relevant === false) {
<span class="relevance-badge not-relevant">
<mat-icon>cancel</mat-icon>
Nicht relevant
</span>
} @else {
<span class="relevance-badge undetermined">
<mat-icon>help</mat-icon>
Nicht bestimmt
</span>
}
</td>
</ng-container>
@@ -114,6 +114,42 @@ table {
background: transparent;
}
.relevance-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 5px 12px;
border-radius: 999px;
font-size: 13px;
font-weight: 600;
line-height: 1;
white-space: nowrap;
mat-icon {
font-size: 16px;
width: 16px;
height: 16px;
}
&.is-relevant {
background: #effaf3;
border: 1px solid #bdebcf;
color: #24834f;
}
&.not-relevant {
background: var(--sg-surface-muted);
border: 1px solid #e2e2e2;
color: var(--sg-text-muted);
}
&.undetermined {
background: #fff7e8;
border: 1px solid #ffd796;
color: #c67500;
}
}
::ng-deep .mat-mdc-header-cell {
color: var(--sg-text-muted);
font-size: 12px;
@@ -21,6 +21,7 @@ interface NewsArticle {
maintitle?: string | null;
author?: string | null;
url?: string | null;
relevant?: boolean | null;
}
interface NewsPage {
@@ -59,7 +60,7 @@ export class NewsComponent implements OnInit {
readonly searchControl = new FormControl('', { nonNullable: true });
displayedColumns = ['maintitle', 'author', 'date'];
displayedColumns = ['maintitle', 'relevance', 'date'];
articles: NewsArticle[] = [];
total = 0;
loading = false;