From 127f5ca28708798dabf125a34d18ec49caee0d64 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 10 Aug 2026 13:45:59 +0200 Subject: [PATCH 1/4] added skeleton loading for projects data table --- .../custom-directives/sk-text.directive.ts | 4 --- .../app-author-chip.component.ts | 9 ++++-- .../app-topic-chip.component.ts | 9 ++++-- .../bund-project-table.component.html | 30 ++++++++----------- .../bund-project-table.component.ts | 2 ++ .../ui/data-table/data-table.component.html | 2 +- .../ui/data-table/data-table.component.ts | 4 +-- .../dfg-project-table.component.html | 12 ++++---- .../dfg-project-table.component.ts | 2 ++ .../eu-project-table.component.html | 10 ++++--- .../eu-project-table.component.ts | 3 +- 11 files changed, 48 insertions(+), 39 deletions(-) diff --git a/webapp/src/app/custom-directives/sk-text.directive.ts b/webapp/src/app/custom-directives/sk-text.directive.ts index 14246539..07ef9d17 100644 --- a/webapp/src/app/custom-directives/sk-text.directive.ts +++ b/webapp/src/app/custom-directives/sk-text.directive.ts @@ -15,10 +15,6 @@ import { ResolverStateService } from '../../app/shared/services/resolver-state.s standalone: true, }) export class SkTextDirective implements OnChanges { - /** - * Optional manual loading state. - * The directive also reacts to global route/resolver loading. - */ @Input() skText = false; private readonly el = inject(ElementRef); diff --git a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts index 60995687..58b4af86 100644 --- a/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts +++ b/webapp/src/app/shared/ui/app-author-chip/app-author-chip.component.ts @@ -12,7 +12,7 @@ import { AppAuthorTooltipComponent } from '../app-author-tooltip/app-author-tool import { MatIconModule } from '@angular/material/icon'; import { ComponentTooltipDirective } from '../../../directives/component-tooltip.directive'; import { MatChipsModule } from '@angular/material/chips'; - +import { SkTextDirective } from '../../../custom-directives/sk-text.directive'; @Component({ host: { '[style.--border-width]': 'isSelected() ? "2px" : "1px"', @@ -22,7 +22,12 @@ import { MatChipsModule } from '@angular/material/chips'; '[class.is-mini-size]': 'isMiniSize()', }, selector: 'app-author-chip', - imports: [MatIconModule, MatChipsModule, ComponentTooltipDirective], + imports: [ + MatIconModule, + MatChipsModule, + ComponentTooltipDirective, + SkTextDirective, + ], templateUrl: './app-author-chip.component.html', styleUrl: './app-author-chip.component.scss', }) diff --git a/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts b/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts index d0859901..51d5f3ca 100644 --- a/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts +++ b/webapp/src/app/shared/ui/app-topic-chip/app-topic-chip.component.ts @@ -13,7 +13,7 @@ import { ComponentTooltipDirective } from '../../../directives/component-tooltip import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; import { MatIconModule } from '@angular/material/icon'; import { AppTopicTooltipComponent } from '../app-topic-tooltip/app-topic-tooltip.component'; - +import { SkTextDirective } from '../../../custom-directives/sk-text.directive'; @Component({ host: { '[style.--topic-color]': 'color()', @@ -23,7 +23,12 @@ import { AppTopicTooltipComponent } from '../app-topic-tooltip/app-topic-tooltip '[class.is-mini-size]': 'isMiniSize()', }, selector: 'app-topic-chip-2', - imports: [MatChipsModule, ComponentTooltipDirective, MatIconModule], + imports: [ + MatChipsModule, + ComponentTooltipDirective, + MatIconModule, + SkTextDirective, + ], templateUrl: './app-topic-chip.component.html', styleUrl: './app-topic-chip.component.scss', }) 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 b078bd8d..93a7982f 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 @@ -11,15 +11,23 @@ [pageSizeOptions]="[10, 25, 50]" /> - {{ getStartDate(element) | date: 'dd.MM.yyyy' }} + + {{ getStartDate(element) | date: 'dd.MM.yyyy' }} + - {{ getEndDate(element) | date: 'dd.MM.yyyy' }} + + {{ getEndDate(element) | date: 'dd.MM.yyyy' }} + - {{ getFundingAmount(element) | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} + + {{ + getFundingAmount(element) | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' + }} + @@ -31,20 +39,6 @@ open_in_new - -
- @for (classification of element.subject_classifications; track $index) { -

- {{ classification.wissenschaftsbereich || '-' }} - → {{ classification.fachkollegium || '-' }} → - {{ classification.fachgebiet || '-' }} → - {{ classification.fach || '-' }} -

- } @empty { - - - } -
-
@let institutions = getProjectInstitutions(project); @@ -79,7 +73,7 @@ matTooltipPosition="above" (click)="toggleFundingTypeFilter(project.funding_type)"> - {{ project.funding_type }} + {{ project.funding_type }} } @else { 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 f5a333e5..46fbbfc9 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 @@ -25,6 +25,7 @@ import { ChipComponent } from '../chip/chip.component'; import { MatTooltip } from '@angular/material/tooltip'; import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; import { bundProjectQueryParamKeys } from '../../../resolvers/bund-projects.resolver'; +import { SkTextDirective } from '../../../custom-directives/sk-text.directive'; @Component({ selector: 'app-bund-project-table', imports: [ @@ -38,6 +39,7 @@ import { bundProjectQueryParamKeys } from '../../../resolvers/bund-projects.reso DatePipe, ChipComponent, AppTopicChipComponent, + SkTextDirective, ], templateUrl: './bund-project-table.component.html', styleUrl: './bund-project-table.component.scss', diff --git a/webapp/src/app/shared/ui/data-table/data-table.component.html b/webapp/src/app/shared/ui/data-table/data-table.component.html index c7a62547..85b8df3f 100644 --- a/webapp/src/app/shared/ui/data-table/data-table.component.html +++ b/webapp/src/app/shared/ui/data-table/data-table.component.html @@ -30,7 +30,7 @@ context: { $implicit: row } "> } @else if (col.type === 'accessor') { - {{ row[col.accessorKey] }} + {{ row[col.accessorKey] }} } diff --git a/webapp/src/app/shared/ui/data-table/data-table.component.ts b/webapp/src/app/shared/ui/data-table/data-table.component.ts index 6be5c79e..092488b2 100644 --- a/webapp/src/app/shared/ui/data-table/data-table.component.ts +++ b/webapp/src/app/shared/ui/data-table/data-table.component.ts @@ -20,7 +20,7 @@ import { } from '@angular/material/sort'; import { MatTableDataSource, MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; - +import { SkTextDirective } from '../../../custom-directives/sk-text.directive'; export interface BaseColumn { id: string; header: string; @@ -43,7 +43,7 @@ export type GenericColumn = AccessorColumn | DisplayColumn; @Component({ selector: 'app-data-table', standalone: true, - imports: [MatTableModule, NgTemplateOutlet, MatSortModule], + imports: [MatTableModule, NgTemplateOutlet, MatSortModule, SkTextDirective], templateUrl: './data-table.component.html', styleUrl: './data-table.component.scss', }) 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 9c86010c..12376734 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 @@ -11,11 +11,13 @@ [pageSizeOptions]="[10, 25, 50]" /> - {{ - element.funding_end == '2999' || element.funding_end == null - ? 'laufend' - : element.funding_end - }} + + {{ + element.funding_end == '2999' || element.funding_end == null + ? 'laufend' + : element.funding_end + }} 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 baa2ae18..cf1a8819 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 @@ -23,6 +23,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { DfgPersonSummary } from '../../../api/model/dfgPersonSummary'; import { MatTooltip } from '@angular/material/tooltip'; import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; +import { SkTextDirective } from '../../../custom-directives/sk-text.directive'; @Component({ selector: 'app-dfg-project-table', imports: [ @@ -33,6 +34,7 @@ import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors'; QueryParamPaginatorComponent, MatTooltip, AppTopicChipComponent, + SkTextDirective, ], templateUrl: './dfg-project-table.component.html', styleUrl: './dfg-project-table.component.scss', 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 68ef7152..00b3ae95 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 @@ -20,7 +20,7 @@ matTooltipPosition="above" (click)="toggleTypeFilter(project.project_type)"> - {{ getProjectTypeLabel(project) }} + {{ getProjectTypeLabel(project) }} } @else { @@ -29,15 +29,17 @@ - {{ getStartDate(element) | date: 'dd.MM.yyyy' }} + {{ getStartDate(element) | date: 'dd.MM.yyyy' }} - {{ getEndDate(element) | date: 'dd.MM.yyyy' }} + {{ getEndDate(element) | date: 'dd.MM.yyyy' }} - {{ getFundingAmount(element) | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} + {{ + getFundingAmount(element) | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' + }} 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 0a3fca02..6b752e77 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 @@ -14,7 +14,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatButtonModule } from '@angular/material/button'; import { MatTooltip } from '@angular/material/tooltip'; import { CurrencyPipe, DatePipe } from '@angular/common'; - +import { SkTextDirective } from '../../../custom-directives/sk-text.directive'; import { DataTableComponent, GenericColumn, @@ -46,6 +46,7 @@ import { AppAuthorChipComponent } from '../app-author-chip/app-author-chip.compo AppTopicChipComponent, ChipComponent, AppAuthorChipComponent, + SkTextDirective, ], templateUrl: './eu-project-table.component.html', styleUrl: './eu-project-table.component.scss', -- 2.56.1 From 1e5d0c4517ea30caf35c622e1fabe531990bbc90 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 10 Aug 2026 13:59:34 +0200 Subject: [PATCH 2/4] enabled ALWAYS tracking total hits to avoid 10000 cuts on data count in elastic client --- service/src/main/inse/integrations/elasticsearch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/service/src/main/inse/integrations/elasticsearch.py b/service/src/main/inse/integrations/elasticsearch.py index c0553de1..b48e6c78 100644 --- a/service/src/main/inse/integrations/elasticsearch.py +++ b/service/src/main/inse/integrations/elasticsearch.py @@ -261,11 +261,10 @@ async def search( payload["sort"] = sort if aggs is not None: payload["aggs"] = aggs - if track_total_hits: - payload["track_total_hits"] = True if highlight is not None: payload["highlight"] = highlight - + + payload["track_total_hits"] = True # always track total hits for accurate pagination and counts if len(payload) == 0: raise ValueError( "At least one of 'query', 'body', 'source', 'size', 'offset', 'sort', 'aggs' must be provided" -- 2.56.1 From aa22fad67db2226c89b927a1e58afa7a7bf6e53a Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 10 Aug 2026 20:43:17 +0200 Subject: [PATCH 3/4] added external link button --- .../projects/dfg-details/dfg-details.component.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html index c9b6c1e9..8d6c9db9 100644 --- a/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html +++ b/webapp/src/app/modules/projects/dfg-details/dfg-details.component.html @@ -37,8 +37,11 @@ circle {{ getStatusDisplay(dfgProject.funding_end) }} - @if (dfgProject.link) { - + @if (dfgProject.page_url) { + open_in_new Zum Projekt @@ -218,10 +221,7 @@ @if (getInstitutionsList().length > 0) {
- @for ( - institution of getInstitutionsList(); - track institution.institute_id + (institution.role_key || '') - ) { + @for (institution of getInstitutionsList(); track $index) {
list[str] | None: try: body = { diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py index d0430d63..0a7a5fae 100644 --- a/service/src/main/inse/projects/router.py +++ b/service/src/main/inse/projects/router.py @@ -7,9 +7,6 @@ from inse.auth.service import CurrentUserAccessTokenPayloadDep from inse.institutions.institutions_search_client import ( InstitutionsSearchClient, ) -from inse.projects.logic import ( - is_projects_access_forbidden -) from inse.institutions.router import get_institutions_search_client from inse.models.bund_project_details import BundProjectDetails from inse.models.dfg_project_details import DfgProjectDetails @@ -33,6 +30,7 @@ from inse.projects.model import ( SortDirection, ) from inse.tags import Tags +from inse.auth.service import can_fetch_gdpr_relevant_data from fastapi import HTTPException as HttpException logger = logging.getLogger(__name__) @@ -146,8 +144,8 @@ async def get_dfg_projects( sort_direction, fuzzy, ) - is_forbidden = await is_projects_access_forbidden(access_token_metadata, raw_oa_institution_id, author_id) - if is_forbidden: + is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = author_id, raw_oa_institution_id = raw_oa_institution_id) + if not is_allowed: raise HttpException( status_code=403, detail="Access denied for the provided author ID or institution ID", @@ -266,8 +264,8 @@ async def search_bund_projects( Query(description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."), ] = False, ) -> BundProjectPage: - is_forbidden = await is_projects_access_forbidden(access_token_metadata, raw_oa_institution_id, None) - if is_forbidden: + is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = None, raw_oa_institution_id = raw_oa_institution_id) + if not is_allowed: raise HttpException( status_code=403, detail="Access denied for the provided author ID or institution ID", @@ -450,8 +448,8 @@ async def search_eu_cordis_projects_endpoint( sort_direction, fuzzy, ) - is_forbidden = await is_projects_access_forbidden(access_token_metadata, raw_oa_institution_id, author_id) - if is_forbidden: + is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = author_id, raw_oa_institution_id = raw_oa_institution_id) + if not is_allowed: raise HttpException( status_code=403, detail="Access denied for the provided author ID or institution ID", -- 2.56.1