-
-
- groups
- Newsliste
-
- Die aktuelle Gewichtung ist unter normalized verfügbar.
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+ @if (hasActiveFilters()) {
+
+ filter_alt_off
+ Zurücksetzen
+
+ }
+
+
+
+
+
+
+
+ @if (article.date) {
+ {{ article.date }}
+ } @else {
+ -
+ }
+
+
+
+ @if (article.relevant === true) {
+
+ check_circle
+ Relevant
+
+ } @else if (article.relevant === false) {
+
+ cancel
+ Nicht relevant
+
+ } @else {
+
+ help
+ Nicht bestimmt
+
+ }
+
+
+
+ @let topics = article.topics ?? [];
+ @let topicsExpanded = isTopicsExpanded(article);
+ @let visibleTopics =
+ topicsExpanded ? topics : topics.slice(0, topicPreviewCount);
+
+
+ @for (topic of visibleTopics; track topic.id ?? topic.display_name) {
+
+ } @empty {
+
-
+ }
+
+ @if (topics.length > topicPreviewCount) {
+
+ }
+
+
+
+
+
+ open_in_new
+
+
+
+ @if (!hasSearchInput()) {
+
+ Keine Keywords ausgewählt.
+
+ } @else if (total() === 0) {
+
+ @if (hasNarrowingFilters()) {
+ Keine Nachrichten für die aktuellen Filter.
+
+ Setzen Sie die Filter zurück, um mehr Ergebnisse zu sehen.
+
+ } @else if (searchedByTopics()) {
+ Zu diesen Themen gibt es keine Nachrichten.
+
+ Campus Aktuell deckt nicht jedes Forschungsthema ab. Schalten Sie die
+ Fuzzy Search aus, um direkt nach den Keywords zu suchen.
+
+ } @else {
+ Keine Nachrichten zu diesen Keywords gefunden.
+ }
+
+ } @else {
+
+
+
+ }
diff --git a/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.scss
index aeffa51c..69f83d60 100644
--- a/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.scss
+++ b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.scss
@@ -1,29 +1,199 @@
+.content {
+ display: flex;
+ flex-direction: column;
+ gap: 1rem;
+}
+
/* ============================================================
- RESULT LAYOUT
+ FILTERS
============================================================ */
-.result-layout {
- display: grid;
- grid-template-columns: minmax(300px, 420px) 1fr;
- grid-template-areas: 'summary results';
+.filters {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: stretch;
gap: 0.75rem;
- align-items: start;
-}
-.search-summary-card {
- grid-area: summary;
-}
+ .relevance-field,
+ .sort-order-field {
+ min-width: 200px;
+ }
-.results-card {
- grid-area: results;
-}
+ app-year-range-slider {
+ display: flex;
+ }
-.search-summary-card,
-.results-card {
- background: var(--sg-surface);
- border: 1px solid var(--sg-border);
- box-shadow: none;
+ ::ng-deep app-year-range-slider .year-filter {
+ height: 100%;
+ }
- .mat-mdc-card-content {
- padding: 0.75rem;
+ ::ng-deep .mat-mdc-form-field-subscript-wrapper {
+ display: none;
+ }
+
+ ::ng-deep .mat-mdc-form-field-icon-prefix {
+ padding: 0 4px 0 10px;
+ }
+}
+
+.reset-filter-btn {
+ display: flex;
+ align-self: center;
+ align-items: center;
+ gap: 0.25rem;
+ height: 40px;
+}
+
+/* ============================================================
+ TABLE
+ ============================================================ */
+.table-wrap {
+ position: relative;
+ overflow-x: auto;
+}
+
+::ng-deep .table-wrap table {
+ width: 100%;
+ min-width: 960px;
+ border-collapse: separate;
+ border-spacing: 0 10px;
+ box-shadow: none;
+ background: transparent;
+}
+
+::ng-deep .table-wrap .mat-mdc-header-cell {
+ color: var(--sg-text-muted);
+ font-size: 12px;
+ font-weight: 700;
+}
+
+::ng-deep .table-wrap .mat-mdc-row {
+ height: 86px;
+}
+
+::ng-deep .table-wrap .mat-mdc-cell {
+ color: var(--sg-text);
+ border-bottom-color: var(--sg-border);
+ font-size: 13px;
+}
+
+::ng-deep .table-wrap {
+ .mat-column-date,
+ .mat-column-relevant,
+ .mat-mdc-header-cell {
+ text-align: center;
+ }
+
+ .mat-column-topics {
+ overflow: visible;
+ }
+}
+
+/* ============================================================
+ TABLE CELLS
+ ============================================================ */
+.title-cell {
+ display: flex;
+ flex-direction: column;
+ gap: 0.25rem;
+ padding: 0.5rem 0;
+ max-width: 32rem;
+}
+
+.title {
+ display: inline-block;
+ max-width: 520px;
+ line-height: 1.35;
+ color: var(--sg-text);
+ font-size: 14px;
+ font-weight: 700;
+ text-decoration: none;
+
+ &:hover {
+ color: var(--sg-text);
+ text-decoration: underline;
+ }
+}
+
+.snippet {
+ font-size: 12.5px;
+ line-height: 1.5;
+ color: var(--sg-text-secondary);
+ overflow-wrap: anywhere;
+
+ ::ng-deep em {
+ font-style: normal;
+ font-weight: 700;
+ color: var(--sg-blue-highlight);
+ }
+}
+
+.date-text {
+ white-space: nowrap;
+}
+
+.empty-text {
+ color: var(--sg-text-muted);
+}
+
+.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: var(--sg-success-soft);
+ border: 1px solid var(--sg-success);
+ color: var(--sg-success);
+ }
+
+ &.not-relevant {
+ background: var(--sg-surface-muted);
+ border: 1px solid var(--sg-border);
+ color: var(--sg-text-muted);
+ }
+
+ &.undetermined {
+ background: var(--sg-warning-soft);
+ border: 1px solid var(--sg-warning);
+ color: var(--sg-warning);
+ cursor: help;
+ }
+}
+
+.topic-chips {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.25rem;
+ align-items: flex-start;
+ padding: 0.5rem 0;
+ max-width: 350px;
+}
+
+.no-results {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 2rem;
+ color: var(--sg-text-muted);
+ text-align: center;
+
+ &__hint {
+ max-width: 34rem;
+ color: var(--sg-text-soft);
+ font-size: 0.8125rem;
+ line-height: 1.5;
}
}
diff --git a/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.ts
index 6c904810..1240f3a6 100644
--- a/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.ts
+++ b/webapp/src/app/modules/keywords-search/search-results/news-results/news-results.component.ts
@@ -1,115 +1,284 @@
-import { Component, inject, signal } from '@angular/core';
-
-import { MatCardModule } from '@angular/material/card';
-import { MatIconModule } from '@angular/material/icon';
-
import {
- WeightMap,
- WeightSliderOption,
- WeightsSlidersComponent,
- WeightsSlidersValue,
-} from '../../../../shared/ui/weights-sliders/weights-sliders.component';
+ Component,
+ DestroyRef,
+ computed,
+ inject,
+ input,
+ signal,
+ TemplateRef,
+ viewChild,
+} from '@angular/core';
+import { ActivatedRoute, Router, RouterModule } from '@angular/router';
+import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
+import { MatButtonModule } from '@angular/material/button';
+import { MatIconModule } from '@angular/material/icon';
+import { MatTooltipModule } from '@angular/material/tooltip';
+
+import { MatchedTopic, NewsPage, Topic } from '../../../../api';
+import {
+ DataTableComponent,
+ GenericColumn,
+} from '../../../../shared/ui/data-table/data-table.component';
+import { QueryParamPaginatorComponent } from '../../../../shared/ui/query-param-paginator/query-param-paginator.component';
+import { AppTopicChipComponent } from '../../../../shared/ui/app-topic-chip/app-topic-chip.component';
+import { ChipOverflowToggleComponent } from '../../../../shared/ui/chip-overflow-toggle/chip-overflow-toggle.component';
+import { FilterCardComponent } from '../../../../shared/ui/filter-card/filter-card.component';
+import {
+ QueryParamSelectorComponent,
+ SelectorOption,
+} from '../../../../shared/ui/query-param-selector/query-param-selector.component';
+import { NEWS_MIN_YEAR } from '../../../../shared/ui/news-card/news-card.component';
+import { keywordsNewsQueryParamKeys } from '../../../../resolvers/keywords-news-page.resolver';
import { SearchResultsStateService } from '../search-results-state.service';
+import { YearRangeSliderComponent } from '../../../../shared/ui/year-range-slider/year-range-slider.component';
+
+type NewsResult = NewsPage['results'][number];
@Component({
selector: 'app-news-results',
- imports: [MatCardModule, MatIconModule, WeightsSlidersComponent],
+ imports: [
+ RouterModule,
+ MatButtonModule,
+ MatIconModule,
+ MatTooltipModule,
+ DataTableComponent,
+ AppTopicChipComponent,
+ ChipOverflowToggleComponent,
+ FilterCardComponent,
+ QueryParamPaginatorComponent,
+ QueryParamSelectorComponent,
+ YearRangeSliderComponent,
+ ],
templateUrl: './news-results.component.html',
styleUrl: './news-results.component.scss',
})
export class KeywordsToNewsResultsComponent {
- // injects the state set by the parent route — no duplicate parsing here
+ protected readonly keywordsNewsQueryParamKeys = keywordsNewsQueryParamKeys;
+
private readonly state = inject(SearchResultsStateService);
+ private readonly route = inject(ActivatedRoute);
+ private readonly router = inject(Router);
+ private readonly destroyRef = inject(DestroyRef);
- readonly defaultWeights: WeightMap = {
- param1: 0.33,
- param2: 0.33,
- param3: 0.34,
- };
+ newsPage = input.required
();
- readonly weightOptions: WeightSliderOption[] = [
- {
- key: 'param1',
- label: 'Parameter 1',
- icon: 'workspace_premium',
- description: 'Gewichtet Parameter 1.',
- defaultValue: 0.5,
- queryParamName: 'wParam1',
- },
- {
- key: 'param2',
- label: 'Parameter 2',
- icon: 'workspace_premium',
- description: 'Gewichtet Parameter 2.',
- defaultValue: 0.5,
- queryParamName: 'wParam2',
- },
- {
- key: 'param3',
- label: 'Parameter 3',
- icon: 'workspace_premium',
- description: 'Gewichtet Parameter 3.',
- defaultValue: 0.5,
- queryParamName: 'wParam3',
- },
+ readonly minYear = NEWS_MIN_YEAR;
+ readonly maxYear = new Date().getFullYear();
+
+ readonly relevanceHelp =
+ 'Ein Artikel gilt als relevant, wenn er für Gründungsforschende interessante Inhalte enthält.';
+
+ readonly sortOrderOptions: SelectorOption[] = [
+ { value: 'desc', display_name: 'Neueste zuerst' },
+ { value: 'asc', display_name: 'Älteste zuerst' },
];
- readonly currentWeights = signal({
- raw: this.defaultWeights,
- normalized: {
- param1: 0.33,
- param2: 0.33,
- param3: 0.34,
- },
- rawSum: 2.5,
- normalizedSum: 1,
- valid: true,
+ readonly relevanceOptions: SelectorOption[] = [
+ { value: 'relevant', display_name: 'Relevant' },
+ { value: 'not_relevant', display_name: 'Nicht relevant' },
+ ];
+
+ readonly yearFrom = signal(this.minYear);
+ readonly yearTo = signal(this.maxYear);
+
+ protected readonly topicPreviewCount = 3;
+ private readonly expandedTopicsIds = signal>(new Set());
+
+ private readonly queryParamMap = toSignal(this.route.queryParamMap, {
+ initialValue: this.route.snapshot.queryParamMap,
});
- readonly projects = signal([]); // placeholder until the results service lands
+ readonly total = computed(() => this.newsPage().total ?? 0);
+ readonly elements = computed(() => this.newsPage().results ?? []);
+ readonly fuzzySearch = computed(
+ () => this.queryParamMap().get('fuzzy') === 'true',
+ );
- private hasLoadedInitial = false;
- constructor() {
- console.log('check', this.state.payload());
- }
- onWeightsChange(value: WeightsSlidersValue): void {
- this.currentWeights.set(value);
+ readonly hasSearchInput = computed(() =>
+ this.fuzzySearch()
+ ? this.state.topicIds().length > 0 || this.state.keywords().length > 0
+ : this.state.keywords().length > 0,
+ );
- // fires once with the query-param-aware initial state — use it to load
- if (!this.hasLoadedInitial) {
- this.hasLoadedInitial = true;
- this.loadprojects();
+ readonly selectedTopicIds = computed(() =>
+ this.queryParamMap().getAll(keywordsNewsQueryParamKeys.topicId),
+ );
+
+ readonly hasActiveFilters = computed(() => {
+ const params = this.queryParamMap();
+ return (
+ !!params.get(keywordsNewsQueryParamKeys.relevance) ||
+ !!params.get(keywordsNewsQueryParamKeys.yearFrom) ||
+ !!params.get(keywordsNewsQueryParamKeys.yearTo) ||
+ !!params.get(keywordsNewsQueryParamKeys.sortOrder) ||
+ this.selectedTopicIds().length > 0
+ );
+ });
+
+ readonly hasNarrowingFilters = computed(() => {
+ const params = this.queryParamMap();
+ return (
+ !!params.get(keywordsNewsQueryParamKeys.relevance) ||
+ !!params.get(keywordsNewsQueryParamKeys.yearFrom) ||
+ !!params.get(keywordsNewsQueryParamKeys.yearTo) ||
+ this.selectedTopicIds().length > 0
+ );
+ });
+
+ readonly searchedByTopics = computed(() => {
+ if (!this.fuzzySearch()) {
+ return false;
}
+ const baseTopicIds = (this.queryParamMap().get('topics') ?? '')
+ .split(',')
+ .filter((value) => value.trim());
+ return baseTopicIds.length > 0 || this.selectedTopicIds().length > 0;
+ });
+
+ titleTmp = viewChild.required>('titleTmp');
+ dateTmp = viewChild.required>('dateTmp');
+ relevanceTmp = viewChild.required>('relevanceTmp');
+ topicsTmp = viewChild.required>('topicsTmp');
+ actionsTmp = viewChild.required>('actionsTmp');
+
+ readonly columns = computed[]>(() => [
+ {
+ id: 'maintitle',
+ header: 'Titel',
+ type: 'display',
+ cellTemplate: this.titleTmp(),
+ },
+ {
+ id: 'date',
+ header: 'Datum',
+ type: 'display',
+ cellTemplate: this.dateTmp(),
+ },
+ {
+ id: 'relevant',
+ header: 'Relevanz',
+ type: 'display',
+ cellTemplate: this.relevanceTmp(),
+ },
+ {
+ id: 'topics',
+ header: 'Themen',
+ type: 'display',
+ cellTemplate: this.topicsTmp(),
+ },
+ {
+ id: 'actions',
+ header: 'Aktionen',
+ type: 'display',
+ cellTemplate: this.actionsTmp(),
+ },
+ ]);
+
+ constructor() {
+ this.route.queryParamMap
+ .pipe(takeUntilDestroyed(this.destroyRef))
+ .subscribe((params) => {
+ this.yearFrom.set(
+ this.parseYear(params.get(keywordsNewsQueryParamKeys.yearFrom)) ??
+ this.minYear,
+ );
+ this.yearTo.set(
+ this.parseYear(params.get(keywordsNewsQueryParamKeys.yearTo)) ??
+ this.maxYear,
+ );
+ });
}
- onApplyWeights(value: WeightsSlidersValue): void {
- this.currentWeights.set(value);
- this.loadprojects();
- }
-
- private loadprojects(): void {
- const weights = this.currentWeights();
-
- const requestPayload = {
- manualKeywords: this.state.manualKeywords(),
- extractedKeywords: this.state.extractedKeywords(),
- keywords: this.state.keywords(),
- fuzzy: this.state.fuzzySearch(),
- weights: {
- raw: weights.raw,
- normalized: weights.normalized,
+ applyYearFilter(): void {
+ this.router.navigate([], {
+ relativeTo: this.route,
+ queryParams: {
+ [keywordsNewsQueryParamKeys.yearFrom]:
+ this.yearFrom() > this.minYear ? this.yearFrom() : null,
+ [keywordsNewsQueryParamKeys.yearTo]:
+ this.yearTo() < this.maxYear ? this.yearTo() : null,
+ [keywordsNewsQueryParamKeys.page]: 0,
},
+ queryParamsHandling: 'merge',
+ });
+ }
+
+ toTopic(matched: MatchedTopic): Topic {
+ return {
+ id: matched.id,
+ display_name: matched.display_name,
+ subfield: matched.subfield_name
+ ? { display_name: matched.subfield_name }
+ : null,
+ field: matched.field_name ? { display_name: matched.field_name } : null,
+ domain: matched.domain_name
+ ? { display_name: matched.domain_name }
+ : null,
};
+ }
- console.log(requestPayload);
+ isTopicActive(topic: MatchedTopic): boolean {
+ return !!topic.id && this.selectedTopicIds().includes(topic.id);
+ }
- /**
- * TODO:
- * this.projectsService.searchprojects(requestPayload).subscribe({
- * next: results => this.projects.set(results),
- * error: error => console.error(error),
- * });
- */
+ isTopicsExpanded(article: NewsResult): boolean {
+ return this.expandedTopicsIds().has(article.id);
+ }
+
+ toggleTopicsExpansion(article: NewsResult): void {
+ if (!article.id) {
+ return;
+ }
+
+ this.expandedTopicsIds.update((ids) => {
+ const next = new Set(ids);
+ if (next.has(article.id)) {
+ next.delete(article.id);
+ } else {
+ next.add(article.id);
+ }
+ return next;
+ });
+ }
+
+ toggleTopicFilter(topic: Topic): void {
+ if (!topic.id || !this.fuzzySearch()) {
+ return;
+ }
+
+ const selected = this.selectedTopicIds();
+ const next = selected.includes(topic.id)
+ ? selected.filter((id) => id !== topic.id)
+ : [...selected, topic.id];
+
+ this.router.navigate([], {
+ relativeTo: this.route,
+ queryParams: {
+ [keywordsNewsQueryParamKeys.topicId]: next.length ? next : null,
+ [keywordsNewsQueryParamKeys.page]: 0,
+ },
+ queryParamsHandling: 'merge',
+ });
+ }
+
+ resetFilters(): void {
+ this.router.navigate([], {
+ relativeTo: this.route,
+ queryParams: {
+ [keywordsNewsQueryParamKeys.relevance]: null,
+ [keywordsNewsQueryParamKeys.yearFrom]: null,
+ [keywordsNewsQueryParamKeys.yearTo]: null,
+ [keywordsNewsQueryParamKeys.topicId]: null,
+ [keywordsNewsQueryParamKeys.sortOrder]: null,
+ [keywordsNewsQueryParamKeys.page]: 0,
+ },
+ queryParamsHandling: 'merge',
+ });
+ }
+
+ private parseYear(raw: string | null): number | null {
+ const year = Number.parseInt(raw ?? '', 10);
+ return Number.isNaN(year) ? null : year;
}
}
diff --git a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html
index 8f444995..0a3d5296 100644
--- a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html
+++ b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.html
@@ -40,13 +40,10 @@
}
@if (authorList.length > 3) {
-
- {{ isExpanded ? 'weniger' : '+' + (authorList.length - 3) }}
-
+
}
} @else {
diff --git a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss
index c60fa1a1..18be839d 100644
--- a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss
+++ b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.scss
@@ -6,29 +6,6 @@
background: var(--sg-card-bg);
border: 1px solid var(--sg-border);
}
- .publication-institution-more {
- display: inline-flex;
- align-items: center;
- min-height: 24px;
- padding: 3px 8px;
- border: 1px solid var(--sg-border);
- border-radius: var(--sg-radius-sm);
- background: var(--sg-surface);
- color: var(--sg-text-muted);
- font-family: inherit;
- font-size: 11px;
- line-height: 1.2;
- cursor: pointer;
- transition: all 0.2s ease;
-
- &:hover,
- &:focus-visible {
- border-color: var(--sg-primary);
- color: var(--sg-primary);
- background: var(--sg-surface-soft);
- outline: none;
- }
- }
.section-header {
display: flex;
align-items: center;
diff --git a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts
index bf71247b..840fe398 100644
--- a/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts
+++ b/webapp/src/app/modules/projects/eu-cordis-details/publications-table/publications-table.component.ts
@@ -20,10 +20,12 @@ import {
DataTableComponent,
GenericColumn,
} from '../../../../shared/ui/data-table/data-table.component';
+import { ChipOverflowToggleComponent } from '../../../../shared/ui/chip-overflow-toggle/chip-overflow-toggle.component';
@Component({
selector: 'app-publications-table',
imports: [
+ ChipOverflowToggleComponent,
CommonModule,
MatIcon,
MatCard,
diff --git a/webapp/src/app/resolvers/keywords-news-page.resolver.ts b/webapp/src/app/resolvers/keywords-news-page.resolver.ts
new file mode 100644
index 00000000..a347122c
--- /dev/null
+++ b/webapp/src/app/resolvers/keywords-news-page.resolver.ts
@@ -0,0 +1,80 @@
+import { ResolveFn } from '@angular/router';
+import { inject } from '@angular/core';
+import { of } from 'rxjs';
+
+import { NewsPage, NewsService } from '../api';
+
+export const keywordsNewsQueryParamKeys = {
+ page: 'page',
+ size: 'size',
+ relevance: 'relevance',
+ yearFrom: 'yearFrom',
+ yearTo: 'yearTo',
+ topicId: 'topicId',
+ sortOrder: 'sorting_order',
+} as const;
+
+const emptyPage = (page: number, pageSize: number): NewsPage => ({
+ total: 0,
+ page,
+ page_size: pageSize,
+ results: [],
+});
+
+export const keywordsNewsPageResolver: ResolveFn