From d73ee592ead1a285b3931aad500061479c02046d Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 16 Aug 2026 20:45:55 +0200 Subject: [PATCH 1/8] fixed Bund highlight model --- service/src/main/inse/projects/model.py | 8 ++++---- webapp/src/app/api/model/bundProjectHighlight.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py index 4714225f..f1625692 100644 --- a/service/src/main/inse/projects/model.py +++ b/service/src/main/inse/projects/model.py @@ -88,7 +88,7 @@ class BundProjectHighlight(BaseModel): default_factory=list, description='Highlights from the Elasticsearch field "Zuwendungsempfänger".', ) - implementing_agency: list[str] = Field( + executing_agency: list[str] = Field( default_factory=list, description='Highlights from the Elasticsearch field "Ausführende Stelle".', ) @@ -146,7 +146,7 @@ class BundProjectSummary(BundProject): place=source.get("Ort"), state=source.get("Bundesland"), country=source.get("Staat"), - implementing_agency=source.get("Ausführende Stelle"), + executing_agency=source.get("Ausführende Stelle"), topic=source.get("Thema"), performance_plan_system=source.get("Leistungsplansystematik"), performance_plan_system_text=source.get( @@ -205,7 +205,7 @@ class BundProjectSummary(BundProject): recipient=cls._highlight_fragments( raw_highlight.get("Zuwendungsempfänger") ), - implementing_agency=cls._highlight_fragments( + executing_agency=cls._highlight_fragments( raw_highlight.get("Ausführende Stelle") ), ) @@ -215,7 +215,7 @@ class BundProjectSummary(BundProject): highlight.joint_project, highlight.topic, highlight.recipient, - highlight.implementing_agency, + highlight.executing_agency, ) ) diff --git a/webapp/src/app/api/model/bundProjectHighlight.ts b/webapp/src/app/api/model/bundProjectHighlight.ts index 40fd90d6..565f238b 100644 --- a/webapp/src/app/api/model/bundProjectHighlight.ts +++ b/webapp/src/app/api/model/bundProjectHighlight.ts @@ -28,6 +28,6 @@ export interface BundProjectHighlight { /** * Highlights from the Elasticsearch field \"Ausführende Stelle\". */ - implementing_agency?: Array; + executing_agency?: Array; } -- 2.56.1 From f4656fcf3981adcc37973bacb5271457e8336978 Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 16 Aug 2026 20:46:16 +0200 Subject: [PATCH 2/8] fixed eu projects resolver --- .../resolvers/eu-cordis-projects.resolver.ts | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/webapp/src/app/resolvers/eu-cordis-projects.resolver.ts b/webapp/src/app/resolvers/eu-cordis-projects.resolver.ts index a9a14e26..0c602553 100644 --- a/webapp/src/app/resolvers/eu-cordis-projects.resolver.ts +++ b/webapp/src/app/resolvers/eu-cordis-projects.resolver.ts @@ -41,25 +41,6 @@ export const RESOLVING_PROJECT_PAGE_FOR = { type ResolvingEuProjectPageFor = (typeof RESOLVING_PROJECT_PAGE_FOR)[keyof typeof RESOLVING_PROJECT_PAGE_FOR]; -function getRepeatedOrCsv(routeQueryParamMap: any, key: string): string[] { - const repeatedValues = routeQueryParamMap.getAll(key) ?? []; - - const csvValues = - routeQueryParamMap - .get(key) - ?.split(',') - .map((value: string) => value.trim()) - .filter(Boolean) ?? []; - - return Array.from( - new Set( - [...repeatedValues, ...csvValues] - .map((value) => String(value).trim()) - .filter(Boolean), - ), - ); -} - export const euCordisProjectsResolver: ResolveFn = ( route, state, @@ -169,7 +150,7 @@ export const euCordisProjectsResolver: ResolveFn = ( } if (resolvingFor === RESOLVING_PROJECT_PAGE_FOR.KEYWORDS_SEARCH) { - const keywords = getRepeatedOrCsv(route.queryParamMap, 'keywords'); + const keywords = route.queryParamMap.get('keywords')?.split(',') ?? []; const selectedTopicIds = route.queryParamMap.getAll('topics'); const fuzzySearch = route.queryParamMap.get('fuzzy') === 'true'; -- 2.56.1 From a0fdc8799bd29cf4b2ebd5dc528aded4e750f5a9 Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 16 Aug 2026 20:47:03 +0200 Subject: [PATCH 3/8] added expanded Row for bund project table --- .../bund-project-table.component.html | 58 ++++++++++++ .../bund-project-table.component.scss | 91 +++++++++++++++++++ .../bund-project-table.component.ts | 39 +++++++- 3 files changed, 187 insertions(+), 1 deletion(-) diff --git a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html index cdaae4cd..e5656409 100644 --- a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html +++ b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.html @@ -1,6 +1,7 @@ @@ -106,3 +107,60 @@ } + +
+
+ @if (project.highlight?.topic.length > 0) { +
+

Titel

+ +
+ } + + @if (project.highlight?.recipient.length > 0) { +
+

Zuwendungsempfänger

+ +
+ } + @if (project.highlight?.joint_project.length > 0) { +
+

Verbundprojekt

+ +
+ } + @if (project.highlight?.executing_agency.length > 0) { +
+

Ausführende Stelle

+ +
+ } +
+
+
diff --git a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.scss b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.scss index 57b73879..63d6ff2d 100644 --- a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.scss +++ b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.scss @@ -205,6 +205,97 @@ } } } +// ------------------------ +// Expanded project panel +// ------------------------ + +.project-panel { + width: 100%; + padding: 12px 16px 14px; + color: var(--sg-text); + background: var(--sg-background); + border-top: 1px solid var(--sg-border); +} + +.project-panel__header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + margin-bottom: 10px; +} + +.project-panel__heading { + display: flex; + align-items: flex-start; + gap: 8px; + + > mat-icon { + flex: 0 0 auto; + width: 19px; + height: 19px; + color: var(--sg-primary); + font-size: 19px; + } + + h3 { + margin: 0; + font-size: 13px; + font-weight: 700; + line-height: 1.2; + } + + p { + margin: 1px 0 0; + color: var(--sg-text-muted); + font-size: 11px; + line-height: 1.3; + } +} + +.project-panel__content { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); + gap: 10px; +} + +.panel-field { + min-width: 0; + + &--full { + grid-column: 1 / -1; + } +} + +.panel-field__label { + color: var(--sg-text-muted); + font-size: 10px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.02em; +} + +.panel-field__text { + margin: 0; + font-size: 12px; + line-height: 1.5; + overflow-wrap: anywhere; +} + +.project-panel__empty { + display: flex; + align-items: center; + gap: 6px; + grid-column: 1 / -1; + color: var(--sg-text-muted); + font-size: 12px; + + mat-icon { + width: 16px; + height: 16px; + font-size: 16px; + } +} // ------------------------ // Responsive adjustments diff --git a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts index 90a62735..33243ad7 100644 --- a/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts +++ b/webapp/src/app/shared/ui/bund-project-table/bund-project-table.component.ts @@ -27,6 +27,12 @@ import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; import { bundProjectQueryParamKeys } from '../../../resolvers/bund-projects.resolver'; import { SkTextDirective } from '../../../custom-directives/sk-text.directive'; import { ChipOverflowToggleComponent } from '../chip-overflow-toggle/chip-overflow-toggle.component'; +import { SearchResultsStateService } from '../../../modules/keywords-search/search-results/search-results-state.service'; +import { + HighlightedTextComponent, + HighlightTerm, +} from '../highlighted-text/highlighted-text.component'; +import { MatDividerModule } from '@angular/material/divider'; @Component({ selector: 'app-bund-project-table', imports: [ @@ -42,6 +48,7 @@ import { ChipOverflowToggleComponent } from '../chip-overflow-toggle/chip-overfl ChipComponent, AppTopicChipComponent, SkTextDirective, + HighlightedTextComponent, ], templateUrl: './bund-project-table.component.html', styleUrl: './bund-project-table.component.scss', @@ -49,7 +56,10 @@ import { ChipOverflowToggleComponent } from '../chip-overflow-toggle/chip-overfl export class BundProjectTableComponent implements OnInit { private readonly activatedRoute = inject(ActivatedRoute); private readonly router = inject(Router); - + private readonly searchResultsStateService = inject( + SearchResultsStateService, + { optional: true }, + ); page = input.required(); authorFilterEnabled = input(false); institutionFilterEnabled = input(false); @@ -353,4 +363,31 @@ export class BundProjectTableComponent implements OnInit { return this.expandedProjectTopicsId.includes(project.funding_code); } + /** + * Extracts the distinct matched terms out of Elasticsearch-style + * highlight fragments (terms wrapped in ...). + */ + extractHighlightTerms(fragments: string[] | null | undefined): string[] { + const terms = new Set(); + + for (const fragment of fragments ?? []) { + if (typeof fragment !== 'string') continue; + + const matches = fragment.matchAll(/(.*?)<\/em>/gi); + for (const match of matches) { + const term = match[1]?.trim(); + if (term) { + terms.add(term); + } + } + } + + return Array.from(terms); + } + getHighlightTerms(terms: string[] | null | undefined): HighlightTerm[] { + return (terms ?? []).map((term) => ({ + term, + topic: this.searchResultsStateService?.resolveTopicForTerm(term) ?? null, + })); + } } -- 2.56.1 From 6e0acb9cdec622f92b6173afb8a13240f1a63ad5 Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 16 Aug 2026 20:47:23 +0200 Subject: [PATCH 4/8] added expanded row for EU projects table --- .../eu-project-table.component.html | 71 +++++++++++++++ .../eu-project-table.component.scss | 90 +++++++++++++++++++ .../eu-project-table.component.ts | 49 +++++++++- 3 files changed, 208 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html index 4e4a2b50..c7921e71 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html @@ -1,6 +1,7 @@ @@ -146,3 +147,73 @@ open_in_new + +
+
+ @if (project.highlight?.title.length > 0) { +
+

Titel

+ +
+ } + + @if (project.highlight?.objective.length > 0) { +
+

Zusammenfassung

+ +
+ } + @if (project.highlight?.acronym.length > 0) { +
+

Akronym

+ +
+ } + @if (project.highlight?.cordis_topic_text.length > 0) { +
+

Cordis-Thema

+ +
+ } + @if (project.highlight?.keywords.length > 0) { +
+

Schlüsselwörter

+ +
+ } +
+
+
diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.scss b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.scss index 39334f9f..abe02090 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.scss +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.scss @@ -142,7 +142,97 @@ .classification-container { max-width: 200px; } +// ------------------------ +// Expanded project panel +// ------------------------ +.project-panel { + width: 100%; + padding: 12px 16px 14px; + color: var(--sg-text); + background: var(--sg-background); + border-top: 1px solid var(--sg-border); +} + +.project-panel__header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + margin-bottom: 10px; +} + +.project-panel__heading { + display: flex; + align-items: flex-start; + gap: 8px; + + > mat-icon { + flex: 0 0 auto; + width: 19px; + height: 19px; + color: var(--sg-primary); + font-size: 19px; + } + + h3 { + margin: 0; + font-size: 13px; + font-weight: 700; + line-height: 1.2; + } + + p { + margin: 1px 0 0; + color: var(--sg-text-muted); + font-size: 11px; + line-height: 1.3; + } +} + +.project-panel__content { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); + gap: 10px; +} + +.panel-field { + min-width: 0; + + &--full { + grid-column: 1 / -1; + } +} + +.panel-field__label { + color: var(--sg-text-muted); + font-size: 10px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.02em; +} + +.panel-field__text { + margin: 0; + font-size: 12px; + line-height: 1.5; + overflow-wrap: anywhere; +} + +.project-panel__empty { + display: flex; + align-items: center; + gap: 6px; + grid-column: 1 / -1; + color: var(--sg-text-muted); + font-size: 12px; + + mat-icon { + width: 16px; + height: 16px; + font-size: 16px; + } +} // ------------------------ // Data table overrides (applied via ::ng-deep) // ------------------------ diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts index 3ce72773..9641bdd8 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts @@ -33,6 +33,12 @@ import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; import { ChipComponent } from '../chip/chip.component'; import { AppAuthorChipComponent } from '../app-author-chip/app-author-chip.component'; import { ChipOverflowToggleComponent } from '../chip-overflow-toggle/chip-overflow-toggle.component'; +import { + HighlightedTextComponent, + HighlightTerm, +} from '../highlighted-text/highlighted-text.component'; +import { MatDividerModule } from '@angular/material/divider'; +import { SearchResultsStateService } from '../../../modules/keywords-search/search-results/search-results-state.service'; @Component({ selector: 'app-eu-project-table', imports: [ @@ -49,6 +55,8 @@ import { ChipOverflowToggleComponent } from '../chip-overflow-toggle/chip-overfl ChipComponent, AppAuthorChipComponent, SkTextDirective, + MatDividerModule, + HighlightedTextComponent, ], templateUrl: './eu-project-table.component.html', styleUrl: './eu-project-table.component.scss', @@ -56,7 +64,10 @@ import { ChipOverflowToggleComponent } from '../chip-overflow-toggle/chip-overfl export class EuProjectTableComponent { private readonly activatedRoute = inject(ActivatedRoute); private readonly router = inject(Router); - + private readonly searchResultsStateService = inject( + SearchResultsStateService, + { optional: true }, + ); queryParamKeys = euProjectQueryParamKeys; page = input(); @@ -94,7 +105,12 @@ export class EuProjectTableComponent { selectedTypesQueryParams = computed(() => { return this.queryParamMap().getAll(this.queryParamKeys.projectType); }); - + keywordTopicMap = computed(() => { + return ( + this.searchResultsStateService?.keywordTopicMap() ?? + new Map() + ); + }); projectTypeTmp = viewChild.required>('projectTypeTmp'); fundingStartTmp = viewChild.required>('fundingStartTmp'); fundingEndTmp = viewChild.required>('fundingEndTmp'); @@ -507,4 +523,33 @@ export class EuProjectTableComponent { ? this.expandedProjectTopicsIds.filter((id) => id !== projectId) : [...this.expandedProjectTopicsIds, projectId]; } + // Highlighted Text + /** + * Extracts the distinct matched terms out of Elasticsearch-style + * highlight fragments (terms wrapped in ...). + */ + extractHighlightTerms(fragments: string[] | null | undefined): string[] { + const terms = new Set(); + + for (const fragment of fragments ?? []) { + if (typeof fragment !== 'string') continue; + + const matches = fragment.matchAll(/(.*?)<\/em>/gi); + for (const match of matches) { + const term = match[1]?.trim(); + if (term) { + terms.add(term); + } + } + } + + return Array.from(terms); + } + + getHighlightTerms(terms: string[] | null | undefined): HighlightTerm[] { + return (terms ?? []).map((term) => ({ + term, + topic: this.searchResultsStateService?.resolveTopicForTerm(term) ?? null, + })); + } } -- 2.56.1 From f02e510847ea2d1b2a5ff9cd6836a6f40053c1ff Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 16 Aug 2026 20:48:32 +0200 Subject: [PATCH 5/8] expanded row view adjusted for DFG project table --- .../dfg-project-table.component.html | 19 ++---- .../dfg-project-table.component.ts | 66 +++++++------------ 2 files changed, 29 insertions(+), 56 deletions(-) diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html index ec8f7600..7fdc1821 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html @@ -67,6 +67,7 @@
-
-
-
- - -
-
- -
- @if (getPanelLanguage(project) === 'de') { - @if (project.highlight?.title_de.length > 0) { -
-

Titel

- -
- } - - @if (project.highlight?.abstract_de.length > 0) { -
-

Zusammenfassung

- -
- } - } @else { - @if (project.highlight?.title_en.length > 0) { -
-

Title

- -
- } - - @if (project.highlight?.abstract_en.length > 0) { -
-

Abstract

- -
- } - } - @if (project.highlight.subject_classifications?.length > 0) { -
-

Fachsystematik

- @for ( - classification of getProjectClassifications(project); - track $index - ) { - - } @empty { - - + @if (project.highlight) { + @let highlight = project.highlight; +
+
+
+ + +
+
+ +
+ @if (getPanelLanguage(project) === 'de') { + @if (highlight.title_de.length > 0) { +
+

Titel

+ +
} -
- } -
-
+ + @if (project.highlight?.abstract_de.length > 0) { +
+

Zusammenfassung

+ +
+ } + } @else { + @if (project.highlight?.title_en.length > 0) { +
+

Title

+ +
+ } + + @if (highlight.abstract_en.length > 0) { +
+

Abstract

+ +
+ } + } + @if (project.highlight?.subject_classifications?.length > 0) { +
+

Fachsystematik

+ @for ( + classification of getProjectClassifications(project); + track $index + ) { + + } @empty { + - + } +
+ } + + + }
@let projectAuthors = getProjectAuthors(project); diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts index c60e5852..f785d1ba 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts @@ -64,7 +64,9 @@ export class DfgProjectTableComponent implements OnInit { topicFilterEnabled = input(false); elements = computed(() => this.page().elements ?? []); - + highlightRowEnabled = computed(() => { + return this.elements()[0]?.highlight ? true : false; + }); queryParamMap = toSignal(this.activatedRoute.queryParamMap, { initialValue: this.activatedRoute.snapshot.queryParamMap, }); diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html index c7921e71..026b639b 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.html @@ -1,7 +1,7 @@ @@ -148,72 +148,69 @@ -
-
- @if (project.highlight?.title.length > 0) { -
-

Titel

- -
- } + @if (project.highlight) { + @let highlight = project.highlight; +
+
+ @if (highlight.title.length > 0) { +
+

Titel

+ +
+ } - @if (project.highlight?.objective.length > 0) { -
-

Zusammenfassung

- -
- } - @if (project.highlight?.acronym.length > 0) { -
-

Akronym

- -
- } - @if (project.highlight?.cordis_topic_text.length > 0) { -
-

Cordis-Thema

- -
- } - @if (project.highlight?.keywords.length > 0) { -
-

Schlüsselwörter

- -
- } -
-
+ @if (highlight.objective.length > 0) { +
+

Zusammenfassung

+ +
+ } + @if (highlight.acronym.length > 0) { +
+

Akronym

+ +
+ } + @if (highlight.cordis_topic_text.length > 0) { +
+

Cordis-Thema

+ +
+ } + @if (highlight.keywords.length > 0) { +
+

Schlüsselwörter

+ +
+ } +
+
+ }
diff --git a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts index 9641bdd8..585b9b30 100644 --- a/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts +++ b/webapp/src/app/shared/ui/eu-project-table/eu-project-table.component.ts @@ -84,6 +84,9 @@ export class EuProjectTableComponent { return this.page()?.total ?? 0; }); + highlightRowEnabled = computed(() => { + return this.projects()[0]?.highlight ? true : false; + }); queryParamMap = toSignal(this.activatedRoute.queryParamMap, { initialValue: this.activatedRoute.snapshot.queryParamMap, }); -- 2.56.1