added navigate event to keywords-search on keyword click

This commit is contained in:
2026-07-08 03:30:55 +02:00
parent 134055b8b9
commit a6d30dd897
3 changed files with 24 additions and 2 deletions
@@ -215,6 +215,13 @@
<p class="kw-suggestion-label">
Vorgeschlagen durch das Schlüsselwort im Text:
</p>
<button
mat-icon-button
class="analyse-btn"
matTooltip="Suche nach dem Schlüsselwort"
(click)="analyseKeyword(topic.source_keyword)">
<mat-icon>search</mat-icon>
</button>
<button
type="button"
class="kw-pill"
@@ -417,12 +417,21 @@ main {
}
.topic-item-body {
position: relative;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
padding: 14px 14px 14px;
background: #ffffff;
.analyse-btn {
position: absolute;
color: color-mix(in srgb, var(--t) 90%, #0f172a);
font-size: 18px;
top: 0.1em;
right: 0.1em;
}
}
.kw-suggestion-label {
@@ -8,7 +8,7 @@ import {
} from '@angular/core';
import { Location } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
@@ -61,7 +61,7 @@ interface NewsArticleDetail {
})
export class NewsDetailComponent implements OnInit {
@ViewChild('articleBody') articleBodyRef?: ElementRef<HTMLElement>;
private readonly router = inject(Router);
private readonly destroyRef = inject(DestroyRef);
private readonly route = inject(ActivatedRoute);
private readonly httpClient = inject(HttpClient);
@@ -132,6 +132,12 @@ export class NewsDetailComponent implements OnInit {
}
}
analyseKeyword(keyword: string | null | undefined): void {
this.router.navigate(['/keywords'], {
queryParams: { manual: keyword ?? '', selected: keyword ?? '' },
});
}
ngOnInit(): void {
this.route.paramMap
.pipe(takeUntilDestroyed(this.destroyRef))